public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Chris Ball <chris@printf.net>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: Balaji T K <balajitk@ti.com>,
	Florian Vaussard <florian.vaussard@epfl.ch>,
	Stefan Roese <sr@denx.de>,
	linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org
Subject: [PATCH 1/3] regulator: pbias: Fix is_enabled callback implementation
Date: Fri, 07 Mar 2014 23:41:37 +0800	[thread overview]
Message-ID: <1394206897.17867.1.camel@phoenix> (raw)

The is_enabled implementation is wrong in some cases:
e.g. for pbias_mmc_omap5: emable_mask is : BIT(27) | BIT(25) | BIT(26)
However, pbias_regulator_enable() only sets BIT(26) | BIT(22) bits.
So is_enabled callback will always return false in this case.
Fix the logic to compare the register value with info->enable rather than
info->enable_mask.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/pbias-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c
index ded3b35..d89a1d8 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -108,7 +108,7 @@ static int pbias_regulator_is_enable(struct regulator_dev *rdev)
 
 	regmap_read(data->syscon, data->pbias_reg, &value);
 
-	return (value & info->enable_mask) == info->enable_mask;
+	return (value & info->enable_mask) == info->enable;
 }
 
 static struct regulator_ops pbias_regulator_voltage_ops = {
-- 
1.8.1.2




             reply	other threads:[~2014-03-07 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 15:41 Axel Lin [this message]
2014-03-07 15:43 ` [PATCH 2/3] regulator: pbias: Convert to use regmap helper functions Axel Lin
2014-03-07 16:46   ` Balaji T K
2014-03-07 15:50 ` [PATCH 3/3] regulator: pbias: Convert to use regulator_[enable|is_enabled]_regmap Axel Lin
2014-03-07 16:46   ` Balaji T K
2014-03-07 16:48 ` [PATCH 1/3] regulator: pbias: Fix is_enabled callback implementation Balaji T K

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=1394206897.17867.1.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=balajitk@ti.com \
    --cc=broonie@kernel.org \
    --cc=chris@printf.net \
    --cc=florian.vaussard@epfl.ch \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sr@denx.de \
    /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