aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-07-03 22:03:23 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-05 08:34:00 -0400
commitf8568cbd9459b87d989efdd9c67a9dd9c6ebef3b (patch)
treec787e26d5a3db57397a57b3549445f5c1cd1aa11
parent8c5e461df77c14254a408e792bb32ddf08213726 (diff)
regulator: ab3100: Set enable enable_time in regulator_desc
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/ab3100.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c
index 16d420b2f7a8..5f771a86f6e6 100644
--- a/drivers/regulator/ab3100.c
+++ b/drivers/regulator/ab3100.c
@@ -347,31 +347,6 @@ static int ab3100_get_voltage_regulator_external(struct regulator_dev *reg)
347 return abreg->plfdata->external_voltage; 347 return abreg->plfdata->external_voltage;
348} 348}
349 349
350static int ab3100_enable_time_regulator(struct regulator_dev *reg)
351{
352 struct ab3100_regulator *abreg = reg->reg_data;
353
354 /* Per-regulator power on delay from spec */
355 switch (abreg->regreg) {
356 case AB3100_LDO_A: /* Fallthrough */
357 case AB3100_LDO_C: /* Fallthrough */
358 case AB3100_LDO_D: /* Fallthrough */
359 case AB3100_LDO_E: /* Fallthrough */
360 case AB3100_LDO_H: /* Fallthrough */
361 case AB3100_LDO_K:
362 return 200;
363 case AB3100_LDO_F:
364 return 600;
365 case AB3100_LDO_G:
366 return 400;
367 case AB3100_BUCK:
368 return 1000;
369 default:
370 break;
371 }
372 return 0;
373}
374
375static int ab3100_get_fixed_voltage_regulator(struct regulator_dev *reg) 350static int ab3100_get_fixed_voltage_regulator(struct regulator_dev *reg)
376{ 351{
377 return reg->desc->min_uV; 352 return reg->desc->min_uV;
@@ -383,7 +358,6 @@ static struct regulator_ops regulator_ops_fixed = {
383 .disable = ab3100_disable_regulator, 358 .disable = ab3100_disable_regulator,
384 .is_enabled = ab3100_is_enabled_regulator, 359 .is_enabled = ab3100_is_enabled_regulator,
385 .get_voltage = ab3100_get_fixed_voltage_regulator, 360 .get_voltage = ab3100_get_fixed_voltage_regulator,
386 .enable_time = ab3100_enable_time_regulator,
387}; 361};
388 362
389static struct regulator_ops regulator_ops_variable = { 363static struct regulator_ops regulator_ops_variable = {
@@ -393,7 +367,6 @@ static struct regulator_ops regulator_ops_variable = {
393 .get_voltage = ab3100_get_voltage_regulator, 367 .get_voltage = ab3100_get_voltage_regulator,
394 .set_voltage_sel = ab3100_set_voltage_regulator_sel, 368 .set_voltage_sel = ab3100_set_voltage_regulator_sel,
395 .list_voltage = regulator_list_voltage_table, 369 .list_voltage = regulator_list_voltage_table,
396 .enable_time = ab3100_enable_time_regulator,
397}; 370};
398 371
399static struct regulator_ops regulator_ops_variable_sleepable = { 372static struct regulator_ops regulator_ops_variable_sleepable = {
@@ -404,7 +377,6 @@ static struct regulator_ops regulator_ops_variable_sleepable = {
404 .set_voltage_sel = ab3100_set_voltage_regulator_sel, 377 .set_voltage_sel = ab3100_set_voltage_regulator_sel,
405 .set_suspend_voltage = ab3100_set_suspend_voltage_regulator, 378 .set_suspend_voltage = ab3100_set_suspend_voltage_regulator,
406 .list_voltage = regulator_list_voltage_table, 379 .list_voltage = regulator_list_voltage_table,
407 .enable_time = ab3100_enable_time_regulator,
408}; 380};
409 381
410/* 382/*
@@ -430,6 +402,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
430 .type = REGULATOR_VOLTAGE, 402 .type = REGULATOR_VOLTAGE,
431 .owner = THIS_MODULE, 403 .owner = THIS_MODULE,
432 .min_uV = LDO_A_VOLTAGE, 404 .min_uV = LDO_A_VOLTAGE,
405 .enable_time = 200,
433 }, 406 },
434 { 407 {
435 .name = "LDO_C", 408 .name = "LDO_C",
@@ -439,6 +412,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
439 .type = REGULATOR_VOLTAGE, 412 .type = REGULATOR_VOLTAGE,
440 .owner = THIS_MODULE, 413 .owner = THIS_MODULE,
441 .min_uV = LDO_C_VOLTAGE, 414 .min_uV = LDO_C_VOLTAGE,
415 .enable_time = 200,
442 }, 416 },
443 { 417 {
444 .name = "LDO_D", 418 .name = "LDO_D",
@@ -448,6 +422,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
448 .type = REGULATOR_VOLTAGE, 422 .type = REGULATOR_VOLTAGE,
449 .owner = THIS_MODULE, 423 .owner = THIS_MODULE,
450 .min_uV = LDO_D_VOLTAGE, 424 .min_uV = LDO_D_VOLTAGE,
425 .enable_time = 200,
451 }, 426 },
452 { 427 {
453 .name = "LDO_E", 428 .name = "LDO_E",
@@ -457,6 +432,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
457 .volt_table = ldo_e_buck_typ_voltages, 432 .volt_table = ldo_e_buck_typ_voltages,
458 .type = REGULATOR_VOLTAGE, 433 .type = REGULATOR_VOLTAGE,
459 .owner = THIS_MODULE, 434 .owner = THIS_MODULE,
435 .enable_time = 200,
460 }, 436 },
461 { 437 {
462 .name = "LDO_F", 438 .name = "LDO_F",
@@ -466,6 +442,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
466 .volt_table = ldo_f_typ_voltages, 442 .volt_table = ldo_f_typ_voltages,
467 .type = REGULATOR_VOLTAGE, 443 .type = REGULATOR_VOLTAGE,
468 .owner = THIS_MODULE, 444 .owner = THIS_MODULE,
445 .enable_time = 600,
469 }, 446 },
470 { 447 {
471 .name = "LDO_G", 448 .name = "LDO_G",
@@ -475,6 +452,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
475 .volt_table = ldo_g_typ_voltages, 452 .volt_table = ldo_g_typ_voltages,
476 .type = REGULATOR_VOLTAGE, 453 .type = REGULATOR_VOLTAGE,
477 .owner = THIS_MODULE, 454 .owner = THIS_MODULE,
455 .enable_time = 400,
478 }, 456 },
479 { 457 {
480 .name = "LDO_H", 458 .name = "LDO_H",
@@ -484,6 +462,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
484 .volt_table = ldo_h_typ_voltages, 462 .volt_table = ldo_h_typ_voltages,
485 .type = REGULATOR_VOLTAGE, 463 .type = REGULATOR_VOLTAGE,
486 .owner = THIS_MODULE, 464 .owner = THIS_MODULE,
465 .enable_time = 200,
487 }, 466 },
488 { 467 {
489 .name = "LDO_K", 468 .name = "LDO_K",
@@ -493,6 +472,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
493 .volt_table = ldo_k_typ_voltages, 472 .volt_table = ldo_k_typ_voltages,
494 .type = REGULATOR_VOLTAGE, 473 .type = REGULATOR_VOLTAGE,
495 .owner = THIS_MODULE, 474 .owner = THIS_MODULE,
475 .enable_time = 200,
496 }, 476 },
497 { 477 {
498 .name = "LDO_EXT", 478 .name = "LDO_EXT",
@@ -508,6 +488,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
508 .n_voltages = ARRAY_SIZE(ldo_e_buck_typ_voltages), 488 .n_voltages = ARRAY_SIZE(ldo_e_buck_typ_voltages),
509 .type = REGULATOR_VOLTAGE, 489 .type = REGULATOR_VOLTAGE,
510 .owner = THIS_MODULE, 490 .owner = THIS_MODULE,
491 .enable_time = 1000,
511 }, 492 },
512}; 493};
513 494