aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da9052-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-03-15 07:58:39 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-01 06:59:34 -0400
commit9210f05b4eb0e9d08b527417fa6ebc043a232bd6 (patch)
tree92dee1a792ed3056e712443a77b6f5adcdd23c56 /drivers/regulator/da9052-regulator.c
parent7061873f709bcecc8e079395567e2c314d21f7aa (diff)
regulator: Fix da9052 ldo regulator names
The regulator name for LDOs are LDO4 ... LDO13 in current implementation. The correct regulator name for LDOs should be LDO1 ... LDO10. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/da9052-regulator.c')
-rw-r--r--drivers/regulator/da9052-regulator.c92
1 files changed, 52 insertions, 40 deletions
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index 09915e89705d..ddcba361bad6 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -37,6 +37,22 @@
37#define DA9052_BUCK_ILIM_MASK_EVEN 0x0c 37#define DA9052_BUCK_ILIM_MASK_EVEN 0x0c
38#define DA9052_BUCK_ILIM_MASK_ODD 0xc0 38#define DA9052_BUCK_ILIM_MASK_ODD 0xc0
39 39
40/* DA9052 REGULATOR IDs */
41#define DA9052_ID_BUCK1 0
42#define DA9052_ID_BUCK2 1
43#define DA9052_ID_BUCK3 2
44#define DA9052_ID_BUCK4 3
45#define DA9052_ID_LDO1 4
46#define DA9052_ID_LDO2 5
47#define DA9052_ID_LDO3 6
48#define DA9052_ID_LDO4 7
49#define DA9052_ID_LDO5 8
50#define DA9052_ID_LDO6 9
51#define DA9052_ID_LDO7 10
52#define DA9052_ID_LDO8 11
53#define DA9052_ID_LDO9 12
54#define DA9052_ID_LDO10 13
55
40static const u32 da9052_current_limits[3][4] = { 56static const u32 da9052_current_limits[3][4] = {
41 {700000, 800000, 1000000, 1200000}, /* DA9052-BC BUCKs */ 57 {700000, 800000, 1000000, 1200000}, /* DA9052-BC BUCKs */
42 {1600000, 2000000, 2400000, 3000000}, /* DA9053-AA/Bx BUCK-CORE */ 58 {1600000, 2000000, 2400000, 3000000}, /* DA9053-AA/Bx BUCK-CORE */
@@ -396,10 +412,10 @@ static struct regulator_ops da9052_ldo_ops = {
396#define DA9052_LDO5_6(_id, step, min, max, sbits, ebits, abits) \ 412#define DA9052_LDO5_6(_id, step, min, max, sbits, ebits, abits) \
397{\ 413{\
398 .reg_desc = {\ 414 .reg_desc = {\
399 .name = "LDO" #_id,\ 415 .name = #_id,\
400 .ops = &da9052_ldo5_6_ops,\ 416 .ops = &da9052_ldo5_6_ops,\
401 .type = REGULATOR_VOLTAGE,\ 417 .type = REGULATOR_VOLTAGE,\
402 .id = _id,\ 418 .id = DA9052_ID_##_id,\
403 .n_voltages = (max - min) / step + 1, \ 419 .n_voltages = (max - min) / step + 1, \
404 .owner = THIS_MODULE,\ 420 .owner = THIS_MODULE,\
405 },\ 421 },\
@@ -414,10 +430,10 @@ static struct regulator_ops da9052_ldo_ops = {
414#define DA9052_LDO(_id, step, min, max, sbits, ebits, abits) \ 430#define DA9052_LDO(_id, step, min, max, sbits, ebits, abits) \
415{\ 431{\
416 .reg_desc = {\ 432 .reg_desc = {\
417 .name = "LDO" #_id,\ 433 .name = #_id,\
418 .ops = &da9052_ldo_ops,\ 434 .ops = &da9052_ldo_ops,\
419 .type = REGULATOR_VOLTAGE,\ 435 .type = REGULATOR_VOLTAGE,\
420 .id = _id,\ 436 .id = DA9052_ID_##_id,\
421 .n_voltages = (max - min) / step + 1, \ 437 .n_voltages = (max - min) / step + 1, \
422 .owner = THIS_MODULE,\ 438 .owner = THIS_MODULE,\
423 },\ 439 },\
@@ -432,10 +448,10 @@ static struct regulator_ops da9052_ldo_ops = {
432#define DA9052_DCDC(_id, step, min, max, sbits, ebits, abits) \ 448#define DA9052_DCDC(_id, step, min, max, sbits, ebits, abits) \
433{\ 449{\
434 .reg_desc = {\ 450 .reg_desc = {\
435 .name = "BUCK" #_id,\ 451 .name = #_id,\
436 .ops = &da9052_dcdc_ops,\ 452 .ops = &da9052_dcdc_ops,\
437 .type = REGULATOR_VOLTAGE,\ 453 .type = REGULATOR_VOLTAGE,\
438 .id = _id,\ 454 .id = DA9052_ID_##_id,\
439 .n_voltages = (max - min) / step + 1, \ 455 .n_voltages = (max - min) / step + 1, \
440 .owner = THIS_MODULE,\ 456 .owner = THIS_MODULE,\
441 },\ 457 },\
@@ -450,10 +466,10 @@ static struct regulator_ops da9052_ldo_ops = {
450#define DA9052_BUCKPERI(_id, step, min, max, sbits, ebits, abits) \ 466#define DA9052_BUCKPERI(_id, step, min, max, sbits, ebits, abits) \
451{\ 467{\
452 .reg_desc = {\ 468 .reg_desc = {\
453 .name = "BUCK" #_id,\ 469 .name = #_id,\
454 .ops = &da9052_buckperi_ops,\ 470 .ops = &da9052_buckperi_ops,\
455 .type = REGULATOR_VOLTAGE,\ 471 .type = REGULATOR_VOLTAGE,\
456 .id = _id,\ 472 .id = DA9052_ID_##_id,\
457 .n_voltages = (max - min) / step + 1, \ 473 .n_voltages = (max - min) / step + 1, \
458 .owner = THIS_MODULE,\ 474 .owner = THIS_MODULE,\
459 },\ 475 },\
@@ -466,41 +482,37 @@ static struct regulator_ops da9052_ldo_ops = {
466} 482}
467 483
468static struct da9052_regulator_info da9052_regulator_info[] = { 484static struct da9052_regulator_info da9052_regulator_info[] = {
469 /* Buck1 - 4 */ 485 DA9052_DCDC(BUCK1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO),
470 DA9052_DCDC(0, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO), 486 DA9052_DCDC(BUCK2, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO),
471 DA9052_DCDC(1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO), 487 DA9052_DCDC(BUCK3, 25, 925, 2500, 6, 6, DA9052_SUPPLY_VBMEMGO),
472 DA9052_DCDC(2, 25, 925, 2500, 6, 6, DA9052_SUPPLY_VBMEMGO), 488 DA9052_BUCKPERI(BUCK4, 50, 1800, 3600, 5, 6, 0),
473 DA9052_BUCKPERI(3, 50, 1800, 3600, 5, 6, 0), 489 DA9052_LDO(LDO1, 50, 600, 1800, 5, 6, 0),
474 /* LD01 - LDO10 */ 490 DA9052_LDO5_6(LDO2, 25, 600, 1800, 6, 6, DA9052_SUPPLY_VLDO2GO),
475 DA9052_LDO(4, 50, 600, 1800, 5, 6, 0), 491 DA9052_LDO5_6(LDO3, 25, 1725, 3300, 6, 6, DA9052_SUPPLY_VLDO3GO),
476 DA9052_LDO5_6(5, 25, 600, 1800, 6, 6, DA9052_SUPPLY_VLDO2GO), 492 DA9052_LDO(LDO4, 25, 1725, 3300, 6, 6, 0),
477 DA9052_LDO5_6(6, 25, 1725, 3300, 6, 6, DA9052_SUPPLY_VLDO3GO), 493 DA9052_LDO(LDO5, 50, 1200, 3600, 6, 6, 0),
478 DA9052_LDO(7, 25, 1725, 3300, 6, 6, 0), 494 DA9052_LDO(LDO6, 50, 1200, 3600, 6, 6, 0),
479 DA9052_LDO(8, 50, 1200, 3600, 6, 6, 0), 495 DA9052_LDO(LDO7, 50, 1200, 3600, 6, 6, 0),
480 DA9052_LDO(9, 50, 1200, 3600, 6, 6, 0), 496 DA9052_LDO(LDO8, 50, 1200, 3600, 6, 6, 0),
481 DA9052_LDO(10, 50, 1200, 3600, 6, 6, 0), 497 DA9052_LDO(LDO9, 50, 1250, 3650, 6, 6, 0),
482 DA9052_LDO(11, 50, 1200, 3600, 6, 6, 0), 498 DA9052_LDO(LDO10, 50, 1200, 3600, 6, 6, 0),
483 DA9052_LDO(12, 50, 1250, 3650, 6, 6, 0),
484 DA9052_LDO(13, 50, 1200, 3600, 6, 6, 0),
485}; 499};
486 500
487static struct da9052_regulator_info da9053_regulator_info[] = { 501static struct da9052_regulator_info da9053_regulator_info[] = {
488 /* Buck1 - 4 */ 502 DA9052_DCDC(BUCK1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO),
489 DA9052_DCDC(0, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO), 503 DA9052_DCDC(BUCK2, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO),
490 DA9052_DCDC(1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO), 504 DA9052_DCDC(BUCK3, 25, 925, 2500, 6, 6, DA9052_SUPPLY_VBMEMGO),
491 DA9052_DCDC(2, 25, 925, 2500, 6, 6, DA9052_SUPPLY_VBMEMGO), 505 DA9052_BUCKPERI(BUCK4, 25, 925, 2500, 6, 6, 0),
492 DA9052_BUCKPERI(3, 25, 925, 2500, 6, 6, 0), 506 DA9052_LDO(LDO1, 50, 600, 1800, 5, 6, 0),
493 /* LD01 - LDO10 */ 507 DA9052_LDO5_6(LDO2, 25, 600, 1800, 6, 6, DA9052_SUPPLY_VLDO2GO),
494 DA9052_LDO(4, 50, 600, 1800, 5, 6, 0), 508 DA9052_LDO5_6(LDO3, 25, 1725, 3300, 6, 6, DA9052_SUPPLY_VLDO3GO),
495 DA9052_LDO5_6(5, 25, 600, 1800, 6, 6, DA9052_SUPPLY_VLDO2GO), 509 DA9052_LDO(LDO4, 25, 1725, 3300, 6, 6, 0),
496 DA9052_LDO5_6(6, 25, 1725, 3300, 6, 6, DA9052_SUPPLY_VLDO3GO), 510 DA9052_LDO(LDO5, 50, 1200, 3600, 6, 6, 0),
497 DA9052_LDO(7, 25, 1725, 3300, 6, 6, 0), 511 DA9052_LDO(LDO6, 50, 1200, 3600, 6, 6, 0),
498 DA9052_LDO(8, 50, 1200, 3600, 6, 6, 0), 512 DA9052_LDO(LDO7, 50, 1200, 3600, 6, 6, 0),
499 DA9052_LDO(9, 50, 1200, 3600, 6, 6, 0), 513 DA9052_LDO(LDO8, 50, 1200, 3600, 6, 6, 0),
500 DA9052_LDO(10, 50, 1200, 3600, 6, 6, 0), 514 DA9052_LDO(LDO9, 50, 1250, 3650, 6, 6, 0),
501 DA9052_LDO(11, 50, 1200, 3600, 6, 6, 0), 515 DA9052_LDO(LDO10, 50, 1200, 3600, 6, 6, 0),
502 DA9052_LDO(12, 50, 1250, 3650, 6, 6, 0),
503 DA9052_LDO(13, 50, 1200, 3600, 6, 6, 0),
504}; 516};
505 517
506static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id, 518static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id,