linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] regulator: pbias: Fix is_enabled callback implementation
@ 2014-03-07 15:41 Axel Lin
  2014-03-07 15:43 ` [PATCH 2/3] regulator: pbias: Convert to use regmap helper functions Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Axel Lin @ 2014-03-07 15:41 UTC (permalink / raw)
  To: Chris Ball, Liam Girdwood, Mark Brown
  Cc: Balaji T K, Florian Vaussard, Stefan Roese, linux-kernel,
	linux-mmc

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




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-07 16:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 15:41 [PATCH 1/3] regulator: pbias: Fix is_enabled callback implementation Axel Lin
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

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