Re: [PATCH v8 5/9] mfd: bcm590xx: Add PMU ID/revision parsing function

Stanislav Jakubek
2025-05-06T23:36:03Z

Hi Artur,
one note below.

On Wed, Apr 30, 2025 at 09:07:09AM +0200, Artur Weber wrote:
> The BCM590xx PMUs have two I2C registers for reading the PMU ID
> and revision. The revision is useful for subdevice drivers, since
> different revisions may have slight differences in behavior (for
> example - BCM59054 has different regulator configurations for
> revision A0 and A1).
>
> Check the PMU ID register and make sure it matches the DT compatible.
> Fetch the digital and analog revision from the PMUREV register
> so that it can be used in subdevice drivers.
>
> Also add some known revision values to bcm590xx.h, for convenience
> when writing subdevice drivers.
>
> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> ---

[snip]

> diff --git a/include/linux/mfd/bcm590xx.h b/include/linux/mfd/bcm590xx.h
> index 8d146e3b102a7dbce6f4dbab9f8ae5a9c4e68c0e..fbc458e94bef923ca1b69afe2cac944adf6fedf8 100644
> --- a/include/linux/mfd/bcm590xx.h
> +++ b/include/linux/mfd/bcm590xx.h
> @@ -17,6 +17,16 @@
> #define BCM590XX_PMUID_BCM59054 0x54
> #define BCM590XX_PMUID_BCM59056 0x56
>
> +/* Known chip revision IDs */
> +#define BCM59054_REV_DIGITAL_A1 1

1 seems to be the digital revision ID for A0 (couldn't find the analog
revision ID), see [1].

Other values seems to match downstream (as far as I can tell anyway).

[1] https://github.com/Samsung-KYLEPROXX/android_kernel_samsung_kyleproxx/blob/cm-13.0/include/linux/mfd/bcmpmu59xxx.h#L82

Regards,
Stanislav

> +#define BCM59054_REV_ANALOG_A1 2
> +
> +#define BCM59056_REV_DIGITAL_A0 1
> +#define BCM59056_REV_ANALOG_A0 1
> +
> +#define BCM59056_REV_DIGITAL_B0 2
> +#define BCM59056_REV_ANALOG_B0 2
> +