Re: [PATCH v5 07/13] power: regulator: Add AB8500 AUX3 support

Stephan Gerhold <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
On Sun, Aug 23, 2026 at 10:39:26PM +0200, Linus Walleij wrote:
> Add regulator support for LDO AUX3 on AB8500 and AB8505 PMICs.
> AUX3 supplies the removable SD card on the upstream Ux500 Samsung
> device trees.
> 
> Support the AB8505-specific 3.05 V selector override and clear it after
> programming an ordinary voltage. Treat both normal and low-power modes
> as enabled and select the supported voltage closest to a requested
> target. AB8500 cut 2.0 or later is assumed.
> 
> Imply the regulator core for ARCH_U8500 so the driver can instantiate
> from the upstream device trees.
> 
> Signed-off-by: Linus Walleij <[email protected]>
> ---
>  MAINTAINERS                      |   1 +
>  arch/arm/Kconfig                 |   2 +
>  drivers/power/pmic/ab8500.c      |   1 +
>  drivers/power/regulator/Kconfig  |   7 ++
>  drivers/power/regulator/Makefile |   1 +
>  drivers/power/regulator/ab8500.c | 168 +++++++++++++++++++++++++++++++++++++++
>  6 files changed, 180 insertions(+)
> 
> [...]
> diff --git a/drivers/power/regulator/ab8500.c b/drivers/power/regulator/ab8500.c
> new file mode 100644
> index 000000000000..4eab7fcd0f40
> --- /dev/null
> +++ b/drivers/power/regulator/ab8500.c
> @@ -0,0 +1,168 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/* ST-Ericsson AB8500/AB8505 LDO AUX3 regulator */
> +
> +#include <dm.h>
> +#include <dm/lists.h>
> +#include <linux/errno.h>
> +#include <power/ab8500.h>
> +#include <power/pmic.h>
> +#include <power/regulator.h>
> +
> +#define AB8500_VAUX3_REGU	AB8500_REGU_CTRL2(0x0a)
> +#define AB8500_VAUX3_SEL	AB8500_REGU_CTRL2(0x21)
> +#define AB8500_VAUX3_EN_MASK	GENMASK(1, 0)
> +#define AB8500_VAUX3_REGU_EN	BIT(0)
> +#define AB8500_VAUX3_SEL_MASK	GENMASK(2, 0)
> +#define AB8505_VAUX3_SEL3	AB8500_REGU_CTRL2(0x01)
> +#define AB8505_VAUX3_SEL3_MASK	BIT(4)
> +#define AB8505_VAUX3_SEL3_UV	3050000

I'm a bit confused by this list now, please either have all register
addresses (AB8500_REGU_CTRL2(...)) at the top, followed by the bitmasks
or make it interleaved (probably better for readability), i.e.

+#define AB8500_VAUX3_REGU	AB8500_REGU_CTRL2(0x0a)
+#define AB8500_VAUX3_EN_MASK	GENMASK(1, 0) /* <-- would be also good
					to rename this for consistency */
+#define AB8500_VAUX3_REGU_EN	BIT(0)
+#define AB8500_VAUX3_SEL	AB8500_REGU_CTRL2(0x21)
+#define AB8500_VAUX3_SEL_MASK	GENMASK(2, 0)
+#define AB8505_VAUX3_SEL3	AB8500_REGU_CTRL2(0x01)
+#define AB8505_VAUX3_SEL3_MASK	BIT(4)
+#define AB8505_VAUX3_SEL3_UV	3050000

Am I blind or do we have no support for the AB8505 3.05V in the Linux
regulator driver?

Thanks,
Stephan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.