aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>2016-03-26 04:28:15 -0400
committerMark Brown <broonie@kernel.org>2016-03-28 05:39:58 -0400
commit32e5deac3627a508f43806788dafa933b51d5d46 (patch)
tree9121fb2434cffa9b59d606d0de21ed1399f7f3fb
parent2330b05c095bdeaaf1261c54cd2d4b9127496996 (diff)
regulator: twl: Regulator mode should not depend on regulator enabled state
When machine constraints are applied, regulator framework first sets initial mode (if any) and then enables the regulator if needed. The current code in twl4030reg_set_mode always checks if the regulator is enabled before applying the mode. That results in -EACCES error returned for "always-on" regulators which have "initial-mode" set in the board DTS. Fix that by removing the unneeded check. Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/twl-regulator.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index aad748b00e1a..7355616194ab 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -371,7 +371,6 @@ static int twl4030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
371{ 371{
372 struct twlreg_info *info = rdev_get_drvdata(rdev); 372 struct twlreg_info *info = rdev_get_drvdata(rdev);
373 unsigned message; 373 unsigned message;
374 int status;
375 374
376 /* We can only set the mode through state machine commands... */ 375 /* We can only set the mode through state machine commands... */
377 switch (mode) { 376 switch (mode) {
@@ -385,13 +384,6 @@ static int twl4030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
385 return -EINVAL; 384 return -EINVAL;
386 } 385 }
387 386
388 /* Ensure the resource is associated with some group */
389 status = twlreg_grp(rdev);
390 if (status < 0)
391 return status;
392 if (!(status & (P3_GRP_4030 | P2_GRP_4030 | P1_GRP_4030)))
393 return -EACCES;
394
395 return twl4030_send_pb_msg(message); 387 return twl4030_send_pb_msg(message);
396} 388}
397 389