Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Linus Walleij and committed by
Liam Girdwood
19c98825 7a32b589

+28 -23
+28 -23
drivers/regulator/ab3100.c
··· 206 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 209 return 0; 233 210 } 234 211 ··· 427 450 return abreg->plfdata->external_voltage; 428 451 } 429 452 453 + static int ab3100_enable_time_regulator(struct regulator_dev *reg) 454 + { 455 + struct ab3100_regulator *abreg = reg->reg_data; 456 + 457 + /* Per-regulator power on delay from spec */ 458 + switch (abreg->regreg) { 459 + case AB3100_LDO_A: /* Fallthrough */ 460 + case AB3100_LDO_C: /* Fallthrough */ 461 + case AB3100_LDO_D: /* Fallthrough */ 462 + case AB3100_LDO_E: /* Fallthrough */ 463 + case AB3100_LDO_H: /* Fallthrough */ 464 + case AB3100_LDO_K: 465 + return 200; 466 + case AB3100_LDO_F: 467 + return 600; 468 + case AB3100_LDO_G: 469 + return 400; 470 + case AB3100_BUCK: 471 + return 1000; 472 + default: 473 + break; 474 + } 475 + return 0; 476 + } 477 + 430 478 static struct regulator_ops regulator_ops_fixed = { 431 479 .enable = ab3100_enable_regulator, 432 480 .disable = ab3100_disable_regulator, 433 481 .is_enabled = ab3100_is_enabled_regulator, 434 482 .get_voltage = ab3100_get_voltage_regulator, 483 + .enable_time = ab3100_enable_time_regulator, 435 484 }; 436 485 437 486 static struct regulator_ops regulator_ops_variable = { ··· 467 464 .get_voltage = ab3100_get_voltage_regulator, 468 465 .set_voltage = ab3100_set_voltage_regulator, 469 466 .list_voltage = ab3100_list_voltage_regulator, 467 + .enable_time = ab3100_enable_time_regulator, 470 468 }; 471 469 472 470 static struct regulator_ops regulator_ops_variable_sleepable = { ··· 478 474 .set_voltage = ab3100_set_voltage_regulator, 479 475 .set_suspend_voltage = ab3100_set_suspend_voltage_regulator, 480 476 .list_voltage = ab3100_list_voltage_regulator, 477 + .enable_time = ab3100_enable_time_regulator, 481 478 }; 482 479 483 480 /*