[PATCH 4/6] power: regulator: s2mps11: declaratively get/set regulator mode
    Peng Fan 
    peng.fan at oss.nxp.com
       
    Wed Oct 22 10:26:47 CEST 2025
    
    
  
On Fri, Oct 17, 2025 at 08:58:19PM +0530, Kaustabh Chakraborty wrote:
>The functions s2mps11_{buck,ldo}_mode use the s2mps11_{buck,ldo}_modes
>arrays directly in order to extract the mode of a certain register.
>This approach does not allow similar devices of other variants (which
>may support a different set of modes) to work with the same driver.
>
>Instead of using these arrays hardcoded, extract them from the device's
>uclass platform data. Now the responsibility of setting these arrays
>properly is done by functions s2mps11_{buck,ldo}_probe, by implementing
>a switch-case block which can support modes of multiple variants if and
>when added.
>
>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