Skip to contentSkip to conversation

reuglator: gpio: Honor regulator-boot-on property

PATCH Superseded Chen-Yu Tsai 2 participants 2 messages Jul 20, 2020 Voltage and current regulator framework

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reuglator: gpio: Honor regulator-boot-on property

From: Chen-Yu Tsai <[email protected]>

When requesting the enable GPIO, the driver tries to do so with the correct output level matching the current state. This is done by checking the boot_on constraint, which is derived from the regulator-boot-on property in the device tree. This is especially important if the regulator is a critical one, such as a supply for the boot CPU.

Honor the regulator-boot-on property by checking the boot_on constraint setting. This is the same as what is done in the fixed regulator driver.

Also drop support for the undocumented enable-at-boot property. This property was not documented in the original commit introducing DT support, nor is it now, and there are no in-tree device trees that use this property.

Fixes 006694d099e8 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT")
---
 drivers/regulator/gpio-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/gpio-regulator.c +1 -1
index 110ee6fe76c4..5646b7a26288 100644
@@ -148,7 +148,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
 
 	config->supply_name = config->init_data->constraints.name;
 
-	if (of_property_read_bool(np, "enable-at-boot"))
+	if (config->init_data->constraints.boot_on)
 		config->enabled_at_boot = true;
 
 	of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
Signature · 1 line
2.27.0
#1 lore raw

Hi,

Please ignore this one. I'll send v2 shortly.

Quoted 10 lines · Chen-Yu Tsai

From: Chen-Yu Tsai <[email protected]>

When requesting the enable GPIO, the driver tries to do so with the correct output level matching the current state. This is done by checking the boot_on constraint, which is derived from the regulator-boot-on property in the device tree. This is especially important if the regulator is a critical one, such as a supply for the boot CPU.

Quoted 8 lines

Honor the regulator-boot-on property by checking the boot_on constraint setting. This is the same as what is done in the fixed regulator driver.

Also drop support for the undocumented enable-at-boot property. This property was not documented in the original commit introducing DT support, nor is it now, and there are no in-tree device trees that use this property.

I'll rework the commit log so it makes more sense. (and fix the typo ...)

ChenYu

Quoted 22 lines
Fixes 006694d099e8 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT")
---
 drivers/regulator/gpio-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/gpio-regulator.c +1 -2
index 110ee6fe76c4..5646b7a26288 100644
@@ -148,7 +148,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
 
        config->supply_name = config->init_data->constraints.name;
 
-       if (of_property_read_bool(np, "enable-at-boot"))
+       if (config->init_data->constraints.boot_on)
                config->enabled_at_boot = true;
 
        of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
--

2.27.0