diff options
author | Balaji T K <balajitk@ti.com> | 2011-02-10 08:14:50 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-23 05:41:48 -0400 |
commit | 8e6de4a30294809420ac9a974b4f28b38ebdb38f (patch) | |
tree | 959d2347144addb920e80ffbf0950d1bcd9a2437 | |
parent | dae2db30c114cd0dec59b4130c315c9cce351741 (diff) |
regulator: twl: add clk32kg to twl-regulator
In OMAP4 Blaze and Panda, 32KHz clock to WLAN is supplied from Phoenix
TWL6030. The 32KHz clock state (ON/OFF) is configured in
CLK32KG_CFG_[GRP, TRANS, STATE] register. This follows the same register
programming model as other regulators in TWL6030. So add CLK32KG as pseudo
regulator.
Signed-off-by: Balaji T K <balajitk@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/twl-core.c | 4 | ||||
-rw-r--r-- | drivers/regulator/twl-regulator.c | 24 | ||||
-rw-r--r-- | include/linux/i2c/twl.h | 2 |
3 files changed, 29 insertions, 1 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index a35fa7dcbf53..7d909cc8670d 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -864,6 +864,10 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
864 | child = add_regulator(TWL6030_REG_VAUX3_6030, pdata->vaux3); | 864 | child = add_regulator(TWL6030_REG_VAUX3_6030, pdata->vaux3); |
865 | if (IS_ERR(child)) | 865 | if (IS_ERR(child)) |
866 | return PTR_ERR(child); | 866 | return PTR_ERR(child); |
867 | |||
868 | child = add_regulator(TWL6030_REG_CLK32KG, pdata->clk32kg); | ||
869 | if (IS_ERR(child)) | ||
870 | return PTR_ERR(child); | ||
867 | } | 871 | } |
868 | 872 | ||
869 | if (twl_has_bci() && pdata->bci && | 873 | if (twl_has_bci() && pdata->bci && |
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index bd332cf1cc3f..6a292852a358 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c | |||
@@ -475,6 +475,13 @@ static struct regulator_ops twlfixed_ops = { | |||
475 | .get_status = twlreg_get_status, | 475 | .get_status = twlreg_get_status, |
476 | }; | 476 | }; |
477 | 477 | ||
478 | static struct regulator_ops twl6030_fixed_resource = { | ||
479 | .enable = twlreg_enable, | ||
480 | .disable = twlreg_disable, | ||
481 | .is_enabled = twlreg_is_enabled, | ||
482 | .get_status = twlreg_get_status, | ||
483 | }; | ||
484 | |||
478 | /*----------------------------------------------------------------------*/ | 485 | /*----------------------------------------------------------------------*/ |
479 | 486 | ||
480 | #define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ | 487 | #define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \ |
@@ -538,6 +545,20 @@ static struct regulator_ops twlfixed_ops = { | |||
538 | }, \ | 545 | }, \ |
539 | } | 546 | } |
540 | 547 | ||
548 | #define TWL6030_FIXED_RESOURCE(label, offset, num, turnon_delay, remap_conf) { \ | ||
549 | .base = offset, \ | ||
550 | .id = num, \ | ||
551 | .delay = turnon_delay, \ | ||
552 | .remap = remap_conf, \ | ||
553 | .desc = { \ | ||
554 | .name = #label, \ | ||
555 | .id = TWL6030_REG_##label, \ | ||
556 | .ops = &twl6030_fixed_resource, \ | ||
557 | .type = REGULATOR_VOLTAGE, \ | ||
558 | .owner = THIS_MODULE, \ | ||
559 | }, \ | ||
560 | } | ||
561 | |||
541 | /* | 562 | /* |
542 | * We list regulators here if systems need some level of | 563 | * We list regulators here if systems need some level of |
543 | * software control over them after boot. | 564 | * software control over them after boot. |
@@ -577,7 +598,8 @@ static struct twlreg_info twl_regs[] = { | |||
577 | TWL6030_FIXED_LDO(VANA, 0x50, 2100, 15, 0, 0x21), | 598 | TWL6030_FIXED_LDO(VANA, 0x50, 2100, 15, 0, 0x21), |
578 | TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 16, 0, 0x21), | 599 | TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 16, 0, 0x21), |
579 | TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 17, 0, 0x21), | 600 | TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 17, 0, 0x21), |
580 | TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 18, 0, 0x21) | 601 | TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 18, 0, 0x21), |
602 | TWL6030_FIXED_RESOURCE(CLK32KG, 0x8C, 48, 0, 0x21), | ||
581 | }; | 603 | }; |
582 | 604 | ||
583 | static int __devinit twlreg_probe(struct platform_device *pdev) | 605 | static int __devinit twlreg_probe(struct platform_device *pdev) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 58afd9d2c438..0c0d1ae79981 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -698,6 +698,7 @@ struct twl4030_platform_data { | |||
698 | struct regulator_init_data *vana; | 698 | struct regulator_init_data *vana; |
699 | struct regulator_init_data *vcxio; | 699 | struct regulator_init_data *vcxio; |
700 | struct regulator_init_data *vusb; | 700 | struct regulator_init_data *vusb; |
701 | struct regulator_init_data *clk32kg; | ||
701 | }; | 702 | }; |
702 | 703 | ||
703 | /*----------------------------------------------------------------------*/ | 704 | /*----------------------------------------------------------------------*/ |
@@ -777,5 +778,6 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
777 | 778 | ||
778 | /* INTERNAL LDOs */ | 779 | /* INTERNAL LDOs */ |
779 | #define TWL6030_REG_VRTC 47 | 780 | #define TWL6030_REG_VRTC 47 |
781 | #define TWL6030_REG_CLK32KG 48 | ||
780 | 782 | ||
781 | #endif /* End of __TWL4030_H */ | 783 | #endif /* End of __TWL4030_H */ |