[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1355129761-8088-3-git-send-email-lee.jones@linaro.org>
Date: Mon, 10 Dec 2012 08:55:51 +0000
From: Lee Jones <lee.jones@...aro.org>
To: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: arnd@...db.de, linus.walleij@...ricsson.com,
ulf.hansson@...aro.org, Lee Jones <lee.jones@...aro.org>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH 02/12] regulator: gpio-regulator: Only read GPIO [dis|en]able pin if not always-on
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@...nsource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
drivers/regulator/gpio-regulator.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 1a71be2..3afa46a 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -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++)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists