aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2012-02-28 04:39:10 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-11 16:09:00 -0400
commit34a38440689b06a515104d668494e0ff8a4e1537 (patch)
treeb6ea0840779978b209a11eeaedc0575080d57885 /drivers/regulator
parent63bfff4e20211b464cbea6e79e5fd36df227c154 (diff)
regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators
vdd1 and vdd2 are now common regulators for twl4030 and twl6030. Also added vdd3 as a new regulator for twl6030. twl6030 vdd1...vdd3 smps regulator voltages can only be controlled through the smartreflex voltage channel, thus the support for the voltage_get and set is minimal and requires external controller. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/twl-regulator.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 7ff8bb22d569..8611282f1d20 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -561,6 +561,32 @@ static struct regulator_ops twl4030smps_ops = {
561 .get_voltage = twl4030smps_get_voltage, 561 .get_voltage = twl4030smps_get_voltage,
562}; 562};
563 563
564static int twl6030coresmps_set_voltage(struct regulator_dev *rdev, int min_uV,
565 int max_uV, unsigned *selector)
566{
567 struct twlreg_info *info = rdev_get_drvdata(rdev);
568
569 if (info->set_voltage)
570 return info->set_voltage(info->data, min_uV);
571
572 return -ENODEV;
573}
574
575static int twl6030coresmps_get_voltage(struct regulator_dev *rdev)
576{
577 struct twlreg_info *info = rdev_get_drvdata(rdev);
578
579 if (info->get_voltage)
580 return info->get_voltage(info->data);
581
582 return -ENODEV;
583}
584
585static struct regulator_ops twl6030coresmps_ops = {
586 .set_voltage = twl6030coresmps_set_voltage,
587 .get_voltage = twl6030coresmps_get_voltage,
588};
589
564static int twl6030ldo_list_voltage(struct regulator_dev *rdev, unsigned index) 590static int twl6030ldo_list_voltage(struct regulator_dev *rdev, unsigned index)
565{ 591{
566 struct twlreg_info *info = rdev_get_drvdata(rdev); 592 struct twlreg_info *info = rdev_get_drvdata(rdev);
@@ -926,6 +952,16 @@ static struct regulator_ops twlsmps_ops = {
926 }, \ 952 }, \
927 } 953 }
928 954
955#define TWL6030_ADJUSTABLE_SMPS(label) { \
956 .desc = { \
957 .name = #label, \
958 .id = TWL6030_REG_##label, \
959 .ops = &twl6030coresmps_ops, \
960 .type = REGULATOR_VOLTAGE, \
961 .owner = THIS_MODULE, \
962 }, \
963 }
964
929#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) { \ 965#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) { \
930 .base = offset, \ 966 .base = offset, \
931 .min_mV = min_mVolts, \ 967 .min_mV = min_mVolts, \
@@ -1027,6 +1063,9 @@ static struct twlreg_info twl_regs[] = {
1027 /* 6030 REG with base as PMC Slave Misc : 0x0030 */ 1063 /* 6030 REG with base as PMC Slave Misc : 0x0030 */
1028 /* Turnon-delay and remap configuration values for 6030 are not 1064 /* Turnon-delay and remap configuration values for 6030 are not
1029 verified since the specification is not public */ 1065 verified since the specification is not public */
1066 TWL6030_ADJUSTABLE_SMPS(VDD1),
1067 TWL6030_ADJUSTABLE_SMPS(VDD2),
1068 TWL6030_ADJUSTABLE_SMPS(VDD3),
1030 TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1000, 3300), 1069 TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1000, 3300),
1031 TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 1000, 3300), 1070 TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 1000, 3300),
1032 TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 1000, 3300), 1071 TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 1000, 3300),