1 From: Thara Gopinath <thara@ti.com>
2 Date: Wed, 7 Oct 2009 00:59:43 +0000 (-0500)
3 Subject: OMAP3: PM: Voltage Scaling fixes
4 X-Git-Tag: android-2.6.29-1.6-13~23
5 X-Git-Url: http://git.omapzoom.org/?p=kernel%2Fomap.git;a=commitdiff_plain;h=4243e3ab5eb2ff8cccb022387e49a2bcd9c6175e
7 OMAP3: PM: Voltage Scaling fixes
9 This patch does the following:
11 * Update VC_CMD_VAL0 and VC_CMD_VAL1 registers during voltage
12 scaling using vp force update. Without this VDD1 and VDD2
13 voltages will not be restored back to the proper values once
15 * Enable VP force update method of voltage scaling by default.
17 Signed-off-by: Thara Gopinath <thara@ti.com>
18 Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
21 Index: kernel-2.6.28/arch/arm/mach-omap2/pm34xx.c
22 ===================================================================
23 --- kernel-2.6.28.orig/arch/arm/mach-omap2/pm34xx.c
24 +++ kernel-2.6.28/arch/arm/mach-omap2/pm34xx.c
25 @@ -1323,20 +1323,28 @@ static int voltagescale_vpforceupdate(u3
26 current_opp_no = get_opp_no(current_opp);
27 t2_smps_steps = abs(target_vsel - current_vsel);
29 - if (vdd == VDD1_OPP) {
30 + if (vdd == PRCM_VDD1) {
31 vp_config_offs = OMAP3_PRM_VP1_CONFIG_OFFSET;
32 vp_tranxdone_st = OMAP3430_VP1_TRANXDONE_ST;
33 vpconfig = target_vsel << OMAP3430_INITVOLTAGE_SHIFT |
34 ((target_opp_no < VDD1_OPP3)
35 - ? PRM_VP1_CONFIG_ERRORGAIN_OPPLOW
36 - : PRM_VP1_CONFIG_ERRORGAIN_OPPHIGH);
37 - } else if (vdd == VDD2_OPP) {
38 + ? PRM_VP1_CONFIG_ERRORGAIN_LOWOPP
39 + : PRM_VP1_CONFIG_ERRORGAIN_HIGHOPP);
40 + prm_rmw_mod_reg_bits(OMAP3430_VC_CMD_ON_MASK,
41 + (target_vsel << OMAP3430_VC_CMD_ON_SHIFT),
43 + OMAP3_PRM_VC_CMD_VAL_0_OFFSET);
44 + } else if (vdd == PRCM_VDD2) {
45 vp_config_offs = OMAP3_PRM_VP2_CONFIG_OFFSET;
46 vp_tranxdone_st = OMAP3430_VP2_TRANXDONE_ST;
47 vpconfig = target_vsel << OMAP3430_INITVOLTAGE_SHIFT |
48 ((target_opp_no < VDD2_OPP3)
49 - ? PRM_VP2_CONFIG_ERRORGAIN_OPPLOW
50 - : PRM_VP2_CONFIG_ERRORGAIN_OPPHIGH);
51 + ? PRM_VP2_CONFIG_ERRORGAIN_LOWOPP
52 + : PRM_VP2_CONFIG_ERRORGAIN_HIGHOPP);
53 + prm_rmw_mod_reg_bits(OMAP3430_VC_CMD_ON_MASK,
54 + (target_vsel << OMAP3430_VC_CMD_ON_SHIFT),
56 + OMAP3_PRM_VC_CMD_VAL_1_OFFSET);
58 /* Clear all pending TransactionDone interrupt/status */
59 while (timeout < VP_TRANXDONE_TIMEOUT) {