linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/12] regulator: gpio-regulator: Only read GPIO [dis|en]able pin if not always-on
Date: Mon, 10 Dec 2012 08:55:51 +0000	[thread overview]
Message-ID: <1355129761-8088-3-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1355129761-8088-1-git-send-email-lee.jones@linaro.org>

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(-)

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

  parent reply	other threads:[~2012-12-10  8:55 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10  8:55 [PATCH 00/12] Functionality add and bug-fixes related to MMCI regulators Lee Jones
2012-12-10  8:55 ` [PATCH 01/12] regulator: gpio-regulator: Demote GPIO Regulator driver to start later Lee Jones
2012-12-10 14:07   ` Mark Brown
2012-12-10 14:28     ` Lee Jones
2012-12-10 14:31       ` Mark Brown
2012-12-13 11:55         ` Lee Jones
2012-12-14  2:53           ` Mark Brown
2012-12-10  8:55 ` Lee Jones [this message]
2012-12-10 14:10   ` [PATCH 02/12] regulator: gpio-regulator: Only read GPIO [dis|en]able pin if not always-on Mark Brown
2012-12-13 11:48     ` Lee Jones
2012-12-14  2:46       ` Mark Brown
2012-12-10  8:55 ` [PATCH 03/12] regulator: gpio-regulator: Fix logical error in for() loop Lee Jones
2012-12-10 14:12   ` Mark Brown
2012-12-10  8:55 ` [PATCH 04/12] regulator: gpio-regulator: gpio_set_value should use cansleep Lee Jones
2012-12-10 14:13   ` Mark Brown
2012-12-10  8:55 ` [PATCH 05/12] mmc: mmci: Move ios_handler functionality into the driver Lee Jones
2012-12-10  8:55 ` [PATCH 06/12] ARM: ux500: Set correct MMCI regulator voltages in the ux5x0 Device Tree Lee Jones
2012-12-11  9:17   ` Linus Walleij
2012-12-11  9:37     ` Ulf Hansson
2012-12-11  9:54       ` Lee Jones
2012-12-10  8:55 ` [PATCH 07/12] ARM: ux500: Specify the ux5x0 MMCI regulator's on/off GPIO as high-enable Lee Jones
2012-12-11  9:17   ` Linus Walleij
2012-12-10  8:55 ` [PATCH 08/12] ARM: ux500: Specify which IOS regulator to use for MMCI Lee Jones
2012-12-11  9:18   ` Linus Walleij
2012-12-10  8:55 ` [PATCH 09/12] ARM: ux500: Use the correct name when supplying a GPIO enable pin Lee Jones
2012-12-11  9:18   ` Linus Walleij
2012-12-10  8:55 ` [PATCH 10/12] ARM: ux500: Setup correct settling time for the MMCI regulator Lee Jones
2012-12-11  9:18   ` Linus Walleij
2012-12-10  8:56 ` [PATCH 11/12] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel' Lee Jones
2012-12-10 10:18   ` Ulf Hansson
2012-12-10 10:20     ` Ulf Hansson
2012-12-10 10:30     ` Lee Jones
2012-12-10 12:06       ` Ulf Hansson
2012-12-10 11:08   ` [PATCH 11/12 v2] " Lee Jones
2012-12-10 12:20     ` Ulf Hansson
2012-12-10  8:56 ` [PATCH 12/12] ARM: ux500: Remove traces of the ios_handler from platform code Lee Jones
2012-12-11  9:19   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355129761-8088-3-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).