aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2012-02-20 05:26:08 -0500
committerKevin Hilman <khilman@ti.com>2012-03-06 20:36:08 -0500
commit49c008ecce1f9a549c12e8957668d60008ab0d79 (patch)
treed819588852c3a610a29248588f5bf7dd4ea43ab6 /arch/arm
parent23e22a5ed4a5ad26ef89c30decd414024f871664 (diff)
arm: omap3: twl: add external controllers for core voltage regulators
VDD1 and VDD2 now use voltage processor for controlling the regulators. This is done by passing additional voltdm data during the regulator init. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/twl-common.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 913d6c3c4cb6..618fefb2b9b9 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -31,12 +31,25 @@
31 31
32#include "twl-common.h" 32#include "twl-common.h"
33#include "pm.h" 33#include "pm.h"
34#include "voltage.h"
34 35
35static struct i2c_board_info __initdata pmic_i2c_board_info = { 36static struct i2c_board_info __initdata pmic_i2c_board_info = {
36 .addr = 0x48, 37 .addr = 0x48,
37 .flags = I2C_CLIENT_WAKE, 38 .flags = I2C_CLIENT_WAKE,
38}; 39};
39 40
41static int twl_set_voltage(void *data, int target_uV)
42{
43 struct voltagedomain *voltdm = (struct voltagedomain *)data;
44 return voltdm_scale(voltdm, target_uV);
45}
46
47static int twl_get_voltage(void *data)
48{
49 struct voltagedomain *voltdm = (struct voltagedomain *)data;
50 return voltdm_get_voltage(voltdm);
51}
52
40void __init omap_pmic_init(int bus, u32 clkrate, 53void __init omap_pmic_init(int bus, u32 clkrate,
41 const char *pmic_type, int pmic_irq, 54 const char *pmic_type, int pmic_irq,
42 struct twl4030_platform_data *pmic_data) 55 struct twl4030_platform_data *pmic_data)
@@ -158,6 +171,16 @@ static struct regulator_init_data omap3_vdd2 = {
158 .consumer_supplies = omap3_vdd2_supply, 171 .consumer_supplies = omap3_vdd2_supply,
159}; 172};
160 173
174static struct twl_regulator_driver_data omap3_vdd1_drvdata = {
175 .get_voltage = twl_get_voltage,
176 .set_voltage = twl_set_voltage,
177};
178
179static struct twl_regulator_driver_data omap3_vdd2_drvdata = {
180 .get_voltage = twl_get_voltage,
181 .set_voltage = twl_set_voltage,
182};
183
161void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, 184void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
162 u32 pdata_flags, u32 regulators_flags) 185 u32 pdata_flags, u32 regulators_flags)
163{ 186{
@@ -165,10 +188,16 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
165 pmic_data->irq_base = TWL4030_IRQ_BASE; 188 pmic_data->irq_base = TWL4030_IRQ_BASE;
166 if (!pmic_data->irq_end) 189 if (!pmic_data->irq_end)
167 pmic_data->irq_end = TWL4030_IRQ_END; 190 pmic_data->irq_end = TWL4030_IRQ_END;
168 if (!pmic_data->vdd1) 191 if (!pmic_data->vdd1) {
192 omap3_vdd1.driver_data = &omap3_vdd1_drvdata;
193 omap3_vdd1_drvdata.data = voltdm_lookup("mpu_iva");
169 pmic_data->vdd1 = &omap3_vdd1; 194 pmic_data->vdd1 = &omap3_vdd1;
170 if (!pmic_data->vdd2) 195 }
196 if (!pmic_data->vdd2) {
197 omap3_vdd2.driver_data = &omap3_vdd2_drvdata;
198 omap3_vdd2_drvdata.data = voltdm_lookup("core");
171 pmic_data->vdd2 = &omap3_vdd2; 199 pmic_data->vdd2 = &omap3_vdd2;
200 }
172 201
173 /* Common platform data configurations */ 202 /* Common platform data configurations */
174 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb) 203 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)