Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1373424 > unrolled thread

[PATCH 3/5] regulator: helpers: Ensure bypass register field matches ON value

Started byThierry Reding <thierry.reding@gmail.com>
First post2016-04-07 16:30 +0200
Last post2016-04-07 16:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/5] regulator: helpers: Ensure bypass register field matches ON value Thierry Reding <thierry.reding@gmail.com> - 2016-04-07 16:30 +0200

#1373424 — [PATCH 3/5] regulator: helpers: Ensure bypass register field matches ON value

FromThierry Reding <thierry.reding@gmail.com>
Date2016-04-07 16:30 +0200
Subject[PATCH 3/5] regulator: helpers: Ensure bypass register field matches ON value
Message-ID<rlj6y-5b8-7@gated-at.bofh.it>
From: Jon Hunter <jonathanh@nvidia.com>

When checking the bypass state for a regulator, we check to see if any
bits in the bypass mask are set. For most cases this is fine because
there is typically only a single bit used to determine if the regulator
is in bypass. However, for some regulators, such as LDO6 on AS3722, the
bypass state is indicated by a value rather than a single bit.

Therefore, when checking the bypass state, check that the bypass field
matches the ON value.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/regulator/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/helpers.c b/drivers/regulator/helpers.c
index b1e32e7482e9..bcf38fd5106a 100644
--- a/drivers/regulator/helpers.c
+++ b/drivers/regulator/helpers.c
@@ -460,7 +460,7 @@ int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable)
 	if (ret != 0)
 		return ret;
 
-	*enable = val & rdev->desc->bypass_mask;
+	*enable = (val & rdev->desc->bypass_mask) == rdev->desc->bypass_val_on;
 
 	return 0;
 }
-- 
2.8.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web