aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/twl-regulator.c
diff options
context:
space:
mode:
authorSaquib Herman <saquib@ti.com>2011-04-01 00:52:43 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-05-27 05:34:36 -0400
commit776dc923f5c9cd0eea61475ed61350e377ad98b5 (patch)
tree3331185ef92a5850ae1c523b8de1fc5cf02ac96e /drivers/regulator/twl-regulator.c
parent21657ebf868b9c7c6c0cab15a6797c3f1af64295 (diff)
regulator: twl: remap has no meaning for 6030
TWL6030 does not have remap register. The current implementation causes value of remap to be written to state register, accidentally causing the regulators which are probed to be switched on as well. This is wrong as regulators should be controllable based on calls to enable/disable for TWL regulator framework. Further, the values initialized make no sense as well. We hence remove this from the initalizers and also write to remap register only if the TWL is 4030. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Saquib Herman <saquib@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
Diffstat (limited to 'drivers/regulator/twl-regulator.c')
-rw-r--r--drivers/regulator/twl-regulator.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 2c666058376..821fd4206ad 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -517,10 +517,9 @@ static struct regulator_ops twl6030_fixed_resource = {
517 remap_conf) \ 517 remap_conf) \
518 TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 518 TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
519 remap_conf, TWL4030) 519 remap_conf, TWL4030)
520#define TWL6030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 520#define TWL6030_FIXED_LDO(label, offset, mVolts, num, turnon_delay) \
521 remap_conf) \
522 TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ 521 TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
523 remap_conf, TWL6030) 522 0x0, TWL6030)
524 523
525#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) { \ 524#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) { \
526 .base = offset, \ 525 .base = offset, \
@@ -539,13 +538,11 @@ static struct regulator_ops twl6030_fixed_resource = {
539 }, \ 538 }, \
540 } 539 }
541 540
542#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts, num, \ 541#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts, num) { \
543 remap_conf) { \
544 .base = offset, \ 542 .base = offset, \
545 .id = num, \ 543 .id = num, \
546 .min_mV = min_mVolts, \ 544 .min_mV = min_mVolts, \
547 .max_mV = max_mVolts, \ 545 .max_mV = max_mVolts, \
548 .remap = remap_conf, \
549 .desc = { \ 546 .desc = { \
550 .name = #label, \ 547 .name = #label, \
551 .id = TWL6030_REG_##label, \ 548 .id = TWL6030_REG_##label, \
@@ -574,11 +571,10 @@ static struct regulator_ops twl6030_fixed_resource = {
574 }, \ 571 }, \
575 } 572 }
576 573
577#define TWL6030_FIXED_RESOURCE(label, offset, num, turnon_delay, remap_conf) { \ 574#define TWL6030_FIXED_RESOURCE(label, offset, num, turnon_delay) { \
578 .base = offset, \ 575 .base = offset, \
579 .id = num, \ 576 .id = num, \
580 .delay = turnon_delay, \ 577 .delay = turnon_delay, \
581 .remap = remap_conf, \
582 .desc = { \ 578 .desc = { \
583 .name = #label, \ 579 .name = #label, \
584 .id = TWL6030_REG_##label, \ 580 .id = TWL6030_REG_##label, \
@@ -618,17 +614,17 @@ static struct twlreg_info twl_regs[] = {
618 /* 6030 REG with base as PMC Slave Misc : 0x0030 */ 614 /* 6030 REG with base as PMC Slave Misc : 0x0030 */
619 /* Turnon-delay and remap configuration values for 6030 are not 615 /* Turnon-delay and remap configuration values for 6030 are not
620 verified since the specification is not public */ 616 verified since the specification is not public */
621 TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1000, 3300, 1, 0x21), 617 TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1000, 3300, 1),
622 TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 1000, 3300, 2, 0x21), 618 TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 1000, 3300, 2),
623 TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 1000, 3300, 3, 0x21), 619 TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 1000, 3300, 3),
624 TWL6030_ADJUSTABLE_LDO(VMMC, 0x68, 1000, 3300, 4, 0x21), 620 TWL6030_ADJUSTABLE_LDO(VMMC, 0x68, 1000, 3300, 4),
625 TWL6030_ADJUSTABLE_LDO(VPP, 0x6c, 1000, 3300, 5, 0x21), 621 TWL6030_ADJUSTABLE_LDO(VPP, 0x6c, 1000, 3300, 5),
626 TWL6030_ADJUSTABLE_LDO(VUSIM, 0x74, 1000, 3300, 7, 0x21), 622 TWL6030_ADJUSTABLE_LDO(VUSIM, 0x74, 1000, 3300, 7),
627 TWL6030_FIXED_LDO(VANA, 0x50, 2100, 15, 0, 0x21), 623 TWL6030_FIXED_LDO(VANA, 0x50, 2100, 15, 0),
628 TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 16, 0, 0x21), 624 TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 16, 0),
629 TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 17, 0, 0x21), 625 TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 17, 0),
630 TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 18, 0, 0x21), 626 TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 18, 0),
631 TWL6030_FIXED_RESOURCE(CLK32KG, 0x8C, 48, 0, 0x21), 627 TWL6030_FIXED_RESOURCE(CLK32KG, 0x8C, 48, 0),
632}; 628};
633 629
634static int __devinit twlreg_probe(struct platform_device *pdev) 630static int __devinit twlreg_probe(struct platform_device *pdev)
@@ -682,7 +678,8 @@ static int __devinit twlreg_probe(struct platform_device *pdev)
682 } 678 }
683 platform_set_drvdata(pdev, rdev); 679 platform_set_drvdata(pdev, rdev);
684 680
685 twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_REMAP, 681 if (twl_class_is_4030())
682 twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_REMAP,
686 info->remap); 683 info->remap);
687 684
688 /* NOTE: many regulators support short-circuit IRQs (presentable 685 /* NOTE: many regulators support short-circuit IRQs (presentable