@@ -160,7 +160,14 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
- config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
+ if (!config->init_data->constraints.always_on) {
+ config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
+ if (config->enable_gpio < 0) {
+ dev_err(dev, "Couldn't get 'enable-gpio' (%d)\n",
+ config->enable_gpio);
+ return ERR_PTR(config->enable_gpio);
+ }
+ }
/* Fetch GPIOs. */
for (i = 0; ; i++)
If a regulator is specified as always-on, then it can't have an enable/disable pin, as it can't be turned off. Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> --- drivers/regulator/gpio-regulator.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)