diff options
author | Jassi Brar <jaswinder.singh@linaro.org> | 2012-05-14 02:30:46 +0530 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2012-05-14 13:47:47 +0200 |
commit | 6c76339feb5cb357fdcb359d2511ca4c4fe69f8f (patch) | |
tree | ae6edd45d70f19c57513bf7f95bf761a3a01c226 | |
parent | b155b9469ed87e0f208c95c19daa67644bb2070e (diff) |
OMAP: PMIC: Register only the map relevant to chip
Since the omap_pmic_map no more has omap_chip, we need to register
only elements that are relevant to the current SoC.
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r-- | arch/arm/mach-omap2/omap_pmic.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_twl4030.c | 64 |
2 files changed, 10 insertions, 60 deletions
diff --git a/arch/arm/mach-omap2/omap_pmic.c b/arch/arm/mach-omap2/omap_pmic.c index d6635de08175..079f52104417 100644 --- a/arch/arm/mach-omap2/omap_pmic.c +++ b/arch/arm/mach-omap2/omap_pmic.c @@ -23,8 +23,10 @@ void __init omap_init_all_pmic(void) { if (cpu_is_omap44xx()) omap_twl4030_init(); - omap_palmas_init(); - omap_tps6236x_init(); + if (cpu_is_omap54xx()) + omap_palmas_init(); + if (cpu_is_omap446x()) + omap_tps6236x_init(); } /** diff --git a/arch/arm/mach-omap2/omap_twl4030.c b/arch/arm/mach-omap2/omap_twl4030.c index 305e020eb85f..a563f67cae4e 100644 --- a/arch/arm/mach-omap2/omap_twl4030.c +++ b/arch/arm/mach-omap2/omap_twl4030.c @@ -233,62 +233,9 @@ static struct omap_voltdm_pmic omap443x_core_pmic = { .uv_to_vsel = twl6030_uv_to_vsel, }; -/* Core uses the MPU rail of 4430 */ -static struct omap_voltdm_pmic omap446x_core_pmic = { - .slew_rate = 9000, - .step_size = 12660, - .startup_time = 500, - .shutdown_time = 500, - .volt_setup_time = 0, - .switch_on_time = 549, - .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, - .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, - .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_CORE_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, - .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, - .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, - .i2c_high_speed = true, - .i2c_scll_low = 0x28, - .i2c_scll_high = 0x2C, - .i2c_hscll_low = 0x0B, - .i2c_hscll_high = 0x00, - .volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG, - .cmd_reg_addr = OMAP4_VDD_MPU_SR_CMD_REG, - .vsel_to_uv = twl6030_vsel_to_uv, - .uv_to_vsel = twl6030_uv_to_vsel, -}; - -static int __init twl_set_sr(struct voltagedomain *voltdm) -{ - int r = 0; - - /* - * The smartreflex bit on twl4030 specifies if the setting of voltage - * is done over the I2C_SR path. Since this setting is independent of - * the actual usage of smartreflex AVS module, we enable TWL SR bit - * by default irrespective of whether smartreflex AVS module is enabled - * on the OMAP side or not. This is because without this bit enabled, - * the voltage scaling through vp forceupdate/bypass mechanism of - * voltage scaling will not function on TWL over I2C_SR. - */ - if (!twl_sr_enable_autoinit) - r = omap3_twl_set_sr_bit(true); - return r; -} - static __initdata struct omap_pmic_map omap_twl_map[] = { { .name = "mpu", - .pmic_data = &omap3_mpu_pmic, - .special_action = twl_set_sr, - }, - { - .name = "core", - .pmic_data = &omap3_core_pmic, - }, - { - .name = "mpu", .pmic_data = &omap4_mpu_pmic, }, { @@ -299,10 +246,6 @@ static __initdata struct omap_pmic_map omap_twl_map[] = { .name = "iva", .pmic_data = &omap4_iva_pmic, }, - { - .name = "core", - .pmic_data = &omap446x_core_pmic, - }, /* Terminator */ { .name = NULL, .pmic_data = NULL}, }; @@ -317,7 +260,12 @@ int __init omap_twl4030_init(void) omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; } - return omap_pmic_register_data(omap_twl_map); + if (cpu_is_omap443x()) + return omap_pmic_register_data(&omap_twl_map[0]); + else if (cpu_is_omap446x()) /* mpu from tps6236x */ + return omap_pmic_register_data(&omap_twl_map[1]); + else + return 0; } /** |