Skip to content

Commit c145649

Browse files
committed
ARM: OMAP2+: Configure voltage controller for cpcap to low-speed
Looks like the i2c timings in high-speed mode do not work properly to allow us to clear I2C_DISABLE bits for PRM_VOLTCTRL register and the device reboots if I2C_DISABLE bits are cleared. Let's configure the voltage controller i2c for low-speed mode as done in the Motorola Mapphone Android Linux kernel. This saves us about 7mW of power during retention compared to the high-speed values. Let's also change the low-speed warning to pr_info about relying on the bootloader configured low-speed values like we currently do. Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 71065d3 commit c145649

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

arch/arm/mach-omap2/pmic-cpcap.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static struct omap_voltdm_pmic omap_cpcap_core = {
6161
.i2c_slave_addr = 0x02,
6262
.volt_reg_addr = 0x00,
6363
.cmd_reg_addr = 0x01,
64-
.i2c_high_speed = true,
64+
.i2c_high_speed = false,
6565
.vsel_to_uv = omap_cpcap_vsel_to_uv,
6666
.uv_to_vsel = omap_cpcap_uv_to_vsel,
6767
};
@@ -78,7 +78,7 @@ static struct omap_voltdm_pmic omap_cpcap_iva = {
7878
.i2c_slave_addr = 0x44,
7979
.volt_reg_addr = 0x0,
8080
.cmd_reg_addr = 0x01,
81-
.i2c_high_speed = true,
81+
.i2c_high_speed = false,
8282
.vsel_to_uv = omap_cpcap_vsel_to_uv,
8383
.uv_to_vsel = omap_cpcap_uv_to_vsel,
8484
};
@@ -125,7 +125,7 @@ static struct omap_voltdm_pmic omap443x_max8952_mpu = {
125125
.i2c_slave_addr = 0x60,
126126
.volt_reg_addr = 0x03,
127127
.cmd_reg_addr = 0x03,
128-
.i2c_high_speed = true,
128+
.i2c_high_speed = false,
129129
.vsel_to_uv = omap_max8952_vsel_to_uv,
130130
.uv_to_vsel = omap_max8952_uv_to_vsel,
131131
};
@@ -212,7 +212,7 @@ static struct omap_voltdm_pmic omap4_fan_core = {
212212
.vddmax = 1375000,
213213
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
214214
.i2c_slave_addr = 0x4A,
215-
.i2c_high_speed = true,
215+
.i2c_high_speed = false,
216216
.volt_reg_addr = 0x01,
217217
.cmd_reg_addr = 0x01,
218218
.vsel_to_uv = omap_fan535508_vsel_to_uv,
@@ -232,7 +232,7 @@ static struct omap_voltdm_pmic omap4_fan_iva = {
232232
.i2c_slave_addr = 0x48,
233233
.volt_reg_addr = 0x01,
234234
.cmd_reg_addr = 0x01,
235-
.i2c_high_speed = true,
235+
.i2c_high_speed = false,
236236
.vsel_to_uv = omap_fan535503_vsel_to_uv,
237237
.uv_to_vsel = omap_fan535503_uv_to_vsel,
238238
};
@@ -263,3 +263,11 @@ int __init omap4_cpcap_init(void)
263263

264264
return 0;
265265
}
266+
267+
static int __init cpcap_late_init(void)
268+
{
269+
omap4_vc_set_pmic_signaling(PWRDM_POWER_RET);
270+
271+
return 0;
272+
}
273+
omap_late_initcall(cpcap_late_init);

arch/arm/mach-omap2/vc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static void __init omap4_vc_i2c_timing_init(struct voltagedomain *voltdm)
670670
const struct i2c_init_data *i2c_data;
671671

672672
if (!voltdm->pmic->i2c_high_speed) {
673-
pr_warn("%s: only high speed supported!\n", __func__);
673+
pr_info("%s: using bootloader low-speed timings\n", __func__);
674674
return;
675675
}
676676

0 commit comments

Comments
 (0)