]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
regulator: fixed: Add support for gpios prop
authorJonas Karlman <jonas@kwiboo.se>
Sat, 22 Jul 2023 13:30:21 +0000 (13:30 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 28 Jul 2023 10:45:03 +0000 (18:45 +0800)
The commit 12df2c182ccb ("regulator: dt-bindings: fixed-regulator: allow
gpios property") in linux v6.3-rc1 added support for use of either a
gpios or gpio prop with a fixed-regulator.

This adds support for the new gpios prop to the fixed-regulator driver.
gpios prop is used by vcc3v3-pcie-regulator on Radxa ROCK 3 Model A.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/power/regulator/fixed.c

index ad3b4b98d6671996cb1e09af63d111fa606fca46..f7ddba8b45e4bdaa6725f2331c613f13a9db465c 100644 (file)
@@ -25,6 +25,7 @@ static int fixed_regulator_of_to_plat(struct udevice *dev)
 {
        struct dm_regulator_uclass_plat *uc_pdata;
        struct regulator_common_plat *plat;
+       bool gpios;
 
        plat = dev_get_plat(dev);
        uc_pdata = dev_get_uclass_plat(dev);
@@ -33,7 +34,8 @@ static int fixed_regulator_of_to_plat(struct udevice *dev)
 
        uc_pdata->type = REGULATOR_TYPE_FIXED;
 
-       return regulator_common_of_to_plat(dev, plat, "gpio");
+       gpios = dev_read_bool(dev, "gpios");
+       return regulator_common_of_to_plat(dev, plat, gpios ? "gpios" : "gpio");
 }
 
 static int fixed_regulator_get_value(struct udevice *dev)