mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Kryger <tim.kryger@linaro.org>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Tim Kryger <tim.kryger@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] regulator: Allow set voltage on fixed regulators
Date: Fri, 18 Apr 2014 11:30:10 -0700	[thread overview]
Message-ID: <1397845810-17002-1-git-send-email-tim.kryger@linaro.org> (raw)

If a regulator consumer requests a voltage range that can be satisfied,
the return value should indicate success even if that regulator has a
fixed voltage.  Since there is already logic to check if the requested
voltage range overlaps the allowed range, set REGULATOR_CHANGE_VOLTAGE
for regulators with constraints that include a positive voltage.

Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
---
 drivers/regulator/of_regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index ea4f36f..a205d62 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -36,7 +36,7 @@ static void of_get_regulation_constraints(struct device_node *np,
 		constraints->max_uV = be32_to_cpu(*max_uV);
 
 	/* Voltage change possible? */
-	if (constraints->min_uV != constraints->max_uV)
+	if (constraints->max_uV > 0)
 		constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE;
 	/* Only one voltage?  Then make sure it's set. */
 	if (min_uV && max_uV && constraints->min_uV == constraints->max_uV)
-- 
1.7.9.5


             reply	other threads:[~2014-04-18 18:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18 18:30 Tim Kryger [this message]
2014-04-18 18:52 ` Mark Brown
2014-04-18 21:07   ` Tim Kryger
2014-04-18 21:29     ` Mark Brown
2014-04-22 18:38   ` Tim Kryger

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=1397845810-17002-1-git-send-email-tim.kryger@linaro.org \
    --to=tim.kryger@linaro.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®