[PATCH 3/6] power: regulator: s2mps11: declaratively define LDOs and BUCKs

Peng Fan peng.fan at oss.nxp.com
Wed Oct 22 10:25:17 CEST 2025


On Fri, Oct 17, 2025 at 08:58:18PM +0530, Kaustabh Chakraborty wrote:
>In the Linux kernel driver, all information related to LDO and BUCK
>regulators are stored in descriptive arrays. This also allows multiple
>variants to be supported by the same driver.
>
>Define a struct sec_regulator_desc which holds all values required by a
>regulator. Create an array of said struct containing all regulators. The
>descriptors are designed to follow a style similar to what's seen in the
>Linux driver, so comparing one with the other is simple.
>
>In functions such as s2mps11_{buck,ldo}_{val,mode} these values are to
>be used, make necessary modifications to pull them from the descriptors.
>Since multiple variants have varying descriptors, select them from
>within a switch-case block.
>
>Functions s2mps11_{buck,ldo}_{volt2hex,hex2volt} and arrays
>s2mps11_buck_{ctrl,out} are phased out as the calculations are now
>hardcoded in descriptors, thusly, it reduces clutter and enhances
>readability.
>
>Two macros in s2mps11.h, S2MPS11_LDO_NUM and S2MPS11_BUCK_NUM are
>removed as they are no longer being used.
>
>Signed-off-by: Kaustabh Chakraborty <kauschluss at disroot.org>

Reviewed-by: Peng Fan <peng.fan at nxp.com>


More information about the U-Boot mailing list