aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-03-11 10:26:18 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-03-26 10:15:04 -0400
commit19c98825941cb10b59c9953665fc4495bc82c0ae (patch)
tree0004f7c73171fdd29c4e94fbf0e93922622c9cbe /drivers/regulator
parent7a32b589a9c856493bccb02db55047edc04eee7b (diff)
regulator: switch the ab3100 to use enable_time()
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> This switches the ab3100 core to use the enable_time() infrastructure from the regulator core. Cc: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/ab3100.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c
index 2dec589a8908..b1d77946e9c6 100644
--- a/drivers/regulator/ab3100.c
+++ b/drivers/regulator/ab3100.c
@@ -206,29 +206,6 @@ static int ab3100_enable_regulator(struct regulator_dev *reg)
206 return err; 206 return err;
207 } 207 }
208 208
209 /* Per-regulator power on delay from spec */
210 switch (abreg->regreg) {
211 case AB3100_LDO_A: /* Fallthrough */
212 case AB3100_LDO_C: /* Fallthrough */
213 case AB3100_LDO_D: /* Fallthrough */
214 case AB3100_LDO_E: /* Fallthrough */
215 case AB3100_LDO_H: /* Fallthrough */
216 case AB3100_LDO_K:
217 udelay(200);
218 break;
219 case AB3100_LDO_F:
220 udelay(600);
221 break;
222 case AB3100_LDO_G:
223 udelay(400);
224 break;
225 case AB3100_BUCK:
226 mdelay(1);
227 break;
228 default:
229 break;
230 }
231
232 return 0; 209 return 0;
233} 210}
234 211
@@ -450,11 +427,37 @@ static int ab3100_get_voltage_regulator_external(struct regulator_dev *reg)
450 return abreg->plfdata->external_voltage; 427 return abreg->plfdata->external_voltage;
451} 428}
452 429
430static int ab3100_enable_time_regulator(struct regulator_dev *reg)
431{
432 struct ab3100_regulator *abreg = reg->reg_data;
433
434 /* Per-regulator power on delay from spec */
435 switch (abreg->regreg) {
436 case AB3100_LDO_A: /* Fallthrough */
437 case AB3100_LDO_C: /* Fallthrough */
438 case AB3100_LDO_D: /* Fallthrough */
439 case AB3100_LDO_E: /* Fallthrough */
440 case AB3100_LDO_H: /* Fallthrough */
441 case AB3100_LDO_K:
442 return 200;
443 case AB3100_LDO_F:
444 return 600;
445 case AB3100_LDO_G:
446 return 400;
447 case AB3100_BUCK:
448 return 1000;
449 default:
450 break;
451 }
452 return 0;
453}
454
453static struct regulator_ops regulator_ops_fixed = { 455static struct regulator_ops regulator_ops_fixed = {
454 .enable = ab3100_enable_regulator, 456 .enable = ab3100_enable_regulator,
455 .disable = ab3100_disable_regulator, 457 .disable = ab3100_disable_regulator,
456 .is_enabled = ab3100_is_enabled_regulator, 458 .is_enabled = ab3100_is_enabled_regulator,
457 .get_voltage = ab3100_get_voltage_regulator, 459 .get_voltage = ab3100_get_voltage_regulator,
460 .enable_time = ab3100_enable_time_regulator,
458}; 461};
459 462
460static struct regulator_ops regulator_ops_variable = { 463static struct regulator_ops regulator_ops_variable = {
@@ -464,6 +467,7 @@ static struct regulator_ops regulator_ops_variable = {
464 .get_voltage = ab3100_get_voltage_regulator, 467 .get_voltage = ab3100_get_voltage_regulator,
465 .set_voltage = ab3100_set_voltage_regulator, 468 .set_voltage = ab3100_set_voltage_regulator,
466 .list_voltage = ab3100_list_voltage_regulator, 469 .list_voltage = ab3100_list_voltage_regulator,
470 .enable_time = ab3100_enable_time_regulator,
467}; 471};
468 472
469static struct regulator_ops regulator_ops_variable_sleepable = { 473static struct regulator_ops regulator_ops_variable_sleepable = {
@@ -474,6 +478,7 @@ static struct regulator_ops regulator_ops_variable_sleepable = {
474 .set_voltage = ab3100_set_voltage_regulator, 478 .set_voltage = ab3100_set_voltage_regulator,
475 .set_suspend_voltage = ab3100_set_suspend_voltage_regulator, 479 .set_suspend_voltage = ab3100_set_suspend_voltage_regulator,
476 .list_voltage = ab3100_list_voltage_regulator, 480 .list_voltage = ab3100_list_voltage_regulator,
481 .enable_time = ab3100_enable_time_regulator,
477}; 482};
478 483
479/* 484/*