public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: s2mps11: Fix accidental enable of buck6 ramp delay
@ 2014-05-05 15:10 Krzysztof Kozlowski
  2014-05-05 15:10 ` [PATCH 2/2] regulator: s2mpa01: Fix accidental enable of buck4 " Krzysztof Kozlowski
  2014-05-17 13:26 ` [PATCH 1/2] regulator: s2mps11: Fix accidental enable of buck6 " Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2014-05-05 15:10 UTC (permalink / raw)
  To: Sangbeom Kim, Liam Girdwood, Mark Brown, linux-kernel,
	Sachin Kamat
  Cc: Axel Lin, Krzysztof Kozlowski

S2MPS11 supports enabling/disabling ramp delay only for buck[2346].
Other bucks have ramp delay enabled always.

However the bit shift for enabling buck6 ramp delay in register is equal
to 0. When ramp delay was set for these other bucks (buck[15789] and
buck10), the ramp delay for buck6 was also enabled.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: b96244fad953 ("regulator: s2mps11: Don't check enable_shift before setting enable ramp rate")
---
 drivers/regulator/s2mps11.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index e713c162fbd4..db677a4be4d3 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -110,7 +110,8 @@ static int s2mps11_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 {
 	struct s2mps11_info *s2mps11 = rdev_get_drvdata(rdev);
 	unsigned int ramp_val, ramp_shift, ramp_reg = S2MPS11_REG_RAMP_BUCK;
-	unsigned int ramp_enable = 1, enable_shift = 0;
+	unsigned int ramp_enable = 1;
+	int enable_shift = -1;
 	int ret;
 
 	switch (rdev_get_id(rdev)) {
@@ -202,11 +203,13 @@ static int s2mps11_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 	if (!ramp_enable)
 		goto ramp_disable;
 
-	ret = regmap_update_bits(rdev->regmap, S2MPS11_REG_RAMP,
-				 1 << enable_shift, 1 << enable_shift);
-	if (ret) {
-		dev_err(&rdev->dev, "failed to enable ramp rate\n");
-		return ret;
+	if (enable_shift >= 0) {
+		ret = regmap_update_bits(rdev->regmap, S2MPS11_REG_RAMP,
+					 1 << enable_shift, 1 << enable_shift);
+		if (ret) {
+			dev_err(&rdev->dev, "failed to enable ramp rate\n");
+			return ret;
+		}
 	}
 
 	ramp_val = get_ramp_delay(ramp_delay);
-- 
1.9.1


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

end of thread, other threads:[~2014-05-17 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-05 15:10 [PATCH 1/2] regulator: s2mps11: Fix accidental enable of buck6 ramp delay Krzysztof Kozlowski
2014-05-05 15:10 ` [PATCH 2/2] regulator: s2mpa01: Fix accidental enable of buck4 " Krzysztof Kozlowski
2014-05-05 15:27   ` Axel Lin
2014-05-06  6:25     ` Krzysztof Kozlowski
2014-05-17 13:27   ` Mark Brown
2014-05-17 13:26 ` [PATCH 1/2] regulator: s2mps11: Fix accidental enable of buck6 " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox