From 1fd1714388583944e30d83c78116a5649056360b Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Thu, 28 May 2009 18:13:05 +0530 Subject: [PATCH] OMAP3: PM: Put optimal SMPS stabilization delay This patch removes the worst case T2 SMPS stabilization delay of 360 us (needed for a 0v to 1.35 switch) and adds calculated delay based on the actual volatge switch. The delay is based on the T2 SMPS slew rate of 4mV/uS. Each step based on VSEL difference corresponds to 12.5 mv Hence the formula used: delay = (steps * 12.5)/4 + (2 us of buffer). This also adds a SMPS stabilization delay in the sr_reset_voltage() function which seems to be needed. Signed-off-by: Rajendra Nayak --- arch/arm/mach-omap2/resource34xx.c | 9 ++++++--- arch/arm/mach-omap2/resource34xx.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c index 2f9d49ef7bf..59f4c13858a 100644 --- a/arch/arm/mach-omap2/resource34xx.c +++ b/arch/arm/mach-omap2/resource34xx.c @@ -261,6 +261,7 @@ static int program_opp_freq(int res, int target_level, int current_level) #ifdef CONFIG_PM omap3_save_scratchpad_contents(); #endif + *curr_opp = target_level; return target_level; } @@ -270,9 +271,10 @@ static int program_opp(int res, struct omap_opp *opp, int target_level, { int i, ret = 0, raise; #ifdef CONFIG_OMAP_SMARTREFLEX - unsigned long t_opp; + unsigned long t_opp, c_opp; t_opp = ID_VDD(res) | ID_OPP_NO(opp[target_level].opp_id); + c_opp = ID_VDD(res) | ID_OPP_NO(opp[current_level].opp_id); #endif if (target_level > current_level) raise = 1; @@ -285,8 +287,9 @@ static int program_opp(int res, struct omap_opp *opp, int target_level, current_level); #ifdef CONFIG_OMAP_SMARTREFLEX else - sr_voltagescale_vcbypass(t_opp, - opp[target_level].vsel); + sr_voltagescale_vcbypass(t_opp, c_opp, + opp[target_level].vsel, + opp[current_level].vsel); #endif } diff --git a/arch/arm/mach-omap2/resource34xx.h b/arch/arm/mach-omap2/resource34xx.h index 9ed0331f657..c15c06c3419 100644 --- a/arch/arm/mach-omap2/resource34xx.h +++ b/arch/arm/mach-omap2/resource34xx.h @@ -30,7 +30,7 @@ #include #include -extern int sr_voltagescale_vcbypass(u32 target_opp, u8 vsel); +extern int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel); /* * mpu_latency/core_latency are used to control the cpuidle C state. -- 2.11.4.GIT