aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2012-02-22 05:40:40 -0500
committerKevin Hilman <khilman@ti.com>2012-03-06 20:36:53 -0500
commite160dda0f49f54deddd62e943e449a13430c2e8b (patch)
treec271cf59b0ad03858f21b7ed49242ab0960b4141 /arch/arm/mach-omap2
parent49c008ecce1f9a549c12e8957668d60008ab0d79 (diff)
arm: omap4: add common twl configurations for vdd1, vdd2 and vdd3
VDD1 is used for MPU voltage, VDD2 is for IVA and VDD3 is for CORE. These are needed by DVFS. This patch also adds external controller support for these regulators, the default I2C control channel can't be used to modify the voltages for these regulators on TWL6030. 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/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/twl-common.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 618fefb2b9b9..1ddad222361a 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -349,6 +349,70 @@ static struct regulator_init_data omap4_clk32kg_idata = {
349 }, 349 },
350}; 350};
351 351
352static struct regulator_consumer_supply omap4_vdd1_supply[] = {
353 REGULATOR_SUPPLY("vcc", "mpu.0"),
354};
355
356static struct regulator_consumer_supply omap4_vdd2_supply[] = {
357 REGULATOR_SUPPLY("vcc", "iva.0"),
358};
359
360static struct regulator_consumer_supply omap4_vdd3_supply[] = {
361 REGULATOR_SUPPLY("vcc", "l3_main.0"),
362};
363
364static struct regulator_init_data omap4_vdd1 = {
365 .constraints = {
366 .name = "vdd_mpu",
367 .min_uV = 500000,
368 .max_uV = 1500000,
369 .valid_modes_mask = REGULATOR_MODE_NORMAL,
370 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
371 },
372 .num_consumer_supplies = ARRAY_SIZE(omap4_vdd1_supply),
373 .consumer_supplies = omap4_vdd1_supply,
374};
375
376static struct regulator_init_data omap4_vdd2 = {
377 .constraints = {
378 .name = "vdd_iva",
379 .min_uV = 500000,
380 .max_uV = 1500000,
381 .valid_modes_mask = REGULATOR_MODE_NORMAL,
382 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
383 },
384 .num_consumer_supplies = ARRAY_SIZE(omap4_vdd2_supply),
385 .consumer_supplies = omap4_vdd2_supply,
386};
387
388static struct regulator_init_data omap4_vdd3 = {
389 .constraints = {
390 .name = "vdd_core",
391 .min_uV = 500000,
392 .max_uV = 1500000,
393 .valid_modes_mask = REGULATOR_MODE_NORMAL,
394 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
395 },
396 .num_consumer_supplies = ARRAY_SIZE(omap4_vdd3_supply),
397 .consumer_supplies = omap4_vdd3_supply,
398};
399
400
401static struct twl_regulator_driver_data omap4_vdd1_drvdata = {
402 .get_voltage = twl_get_voltage,
403 .set_voltage = twl_set_voltage,
404};
405
406static struct twl_regulator_driver_data omap4_vdd2_drvdata = {
407 .get_voltage = twl_get_voltage,
408 .set_voltage = twl_set_voltage,
409};
410
411static struct twl_regulator_driver_data omap4_vdd3_drvdata = {
412 .get_voltage = twl_get_voltage,
413 .set_voltage = twl_set_voltage,
414};
415
352void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, 416void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
353 u32 pdata_flags, u32 regulators_flags) 417 u32 pdata_flags, u32 regulators_flags)
354{ 418{
@@ -357,6 +421,24 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
357 if (!pmic_data->irq_end) 421 if (!pmic_data->irq_end)
358 pmic_data->irq_end = TWL6030_IRQ_END; 422 pmic_data->irq_end = TWL6030_IRQ_END;
359 423
424 if (!pmic_data->vdd1) {
425 omap4_vdd1.driver_data = &omap4_vdd1_drvdata;
426 omap4_vdd1_drvdata.data = voltdm_lookup("mpu");
427 pmic_data->vdd1 = &omap4_vdd1;
428 }
429
430 if (!pmic_data->vdd2) {
431 omap4_vdd2.driver_data = &omap4_vdd2_drvdata;
432 omap4_vdd2_drvdata.data = voltdm_lookup("iva");
433 pmic_data->vdd2 = &omap4_vdd2;
434 }
435
436 if (!pmic_data->vdd3) {
437 omap4_vdd3.driver_data = &omap4_vdd3_drvdata;
438 omap4_vdd3_drvdata.data = voltdm_lookup("core");
439 pmic_data->vdd3 = &omap4_vdd3;
440 }
441
360 /* Common platform data configurations */ 442 /* Common platform data configurations */
361 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb) 443 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
362 pmic_data->usb = &omap4_usb_pdata; 444 pmic_data->usb = &omap4_usb_pdata;