Skip to content

Commit 19c9882

Browse files
Linus WalleijLiam Girdwood
authored andcommitted
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>
1 parent 7a32b58 commit 19c9882

1 file changed

Lines changed: 28 additions & 23 deletions

File tree

‎drivers/regulator/ab3100.c‎

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -206,29 +206,6 @@ static int ab3100_enable_regulator(struct regulator_dev *reg)
206206
return err;
207207
}
208208

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-
232209
return 0;
233210
}
234211

@@ -450,11 +427,37 @@ static int ab3100_get_voltage_regulator_external(struct regulator_dev *reg)
450427
return abreg->plfdata->external_voltage;
451428
}
452429

430+
static 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+
453455
static struct regulator_ops regulator_ops_fixed = {
454456
.enable = ab3100_enable_regulator,
455457
.disable = ab3100_disable_regulator,
456458
.is_enabled = ab3100_is_enabled_regulator,
457459
.get_voltage = ab3100_get_voltage_regulator,
460+
.enable_time = ab3100_enable_time_regulator,
458461
};
459462

460463
static struct regulator_ops regulator_ops_variable = {
@@ -464,6 +467,7 @@ static struct regulator_ops regulator_ops_variable = {
464467
.get_voltage = ab3100_get_voltage_regulator,
465468
.set_voltage = ab3100_set_voltage_regulator,
466469
.list_voltage = ab3100_list_voltage_regulator,
470+
.enable_time = ab3100_enable_time_regulator,
467471
};
468472

469473
static struct regulator_ops regulator_ops_variable_sleepable = {
@@ -474,6 +478,7 @@ static struct regulator_ops regulator_ops_variable_sleepable = {
474478
.set_voltage = ab3100_set_voltage_regulator,
475479
.set_suspend_voltage = ab3100_set_suspend_voltage_regulator,
476480
.list_voltage = ab3100_list_voltage_regulator,
481+
.enable_time = ab3100_enable_time_regulator,
477482
};
478483

479484
/*

0 commit comments

Comments
 (0)