diff options
author | Nishanth Menon <nm@ti.com> | 2011-08-24 13:02:54 -0500 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-08-26 20:17:11 -0500 |
commit | 11425145143860fad783841492de2f08dfa4ab79 (patch) | |
tree | afc831f65616d3fedb8498cae38aec26f61e1981 /arch/arm/mach-omap2/vc.c | |
parent | 0d049a61bc33427f976016972c67a6582cdd62ae (diff) | |
download | kernel_samsung_tuna-11425145143860fad783841492de2f08dfa4ab79.zip kernel_samsung_tuna-11425145143860fad783841492de2f08dfa4ab79.tar.gz kernel_samsung_tuna-11425145143860fad783841492de2f08dfa4ab79.tar.bz2 |
OMAP3+: PM: VC: setup ON voltages when setting a new operational voltage
ON voltage for LP and OFF states need to be programmed in for wakingup
at voltage we went down in instead of going up always with initial
configured for that rail. This is important as we may have varied
voltage setups when DVFS is functional. SR will be re-enabled as
part of power core code to re-adjust the resultant voltage to
optimal voltage levels.
Change-Id: Ic31700da1ca5fadc545bb342aabd2fefea2ce298
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vc.c')
-rw-r--r-- | arch/arm/mach-omap2/vc.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 337c2cc..6a9b8a9 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -199,7 +199,21 @@ void omap_vc_post_scale(struct voltagedomain *voltdm, unsigned long target_volt, u8 target_vsel, u8 current_vsel) { + struct omap_vc_channel *vc; u32 smps_steps = 0, smps_delay = 0; + u8 on_vsel, onlp_vsel; + u32 val; + + if (IS_ERR_OR_NULL(voltdm)) { + pr_err("%s bad voldm\n", __func__); + return; + } + + vc = voltdm->vc; + if (IS_ERR_OR_NULL(vc)) { + pr_err("%s voldm=%s bad vc\n", __func__, voltdm->name); + return; + } smps_steps = abs(target_vsel - current_vsel); /* SMPS slew rate / step size. 2us added as buffer. */ @@ -208,6 +222,14 @@ void omap_vc_post_scale(struct voltagedomain *voltdm, udelay(smps_delay); voltdm->curr_volt = target_volt; + + /* Set up the on voltage for wakeup from lp and OFF */ + on_vsel = voltdm->pmic->uv_to_vsel(target_volt); + onlp_vsel = voltdm->pmic->uv_to_vsel(target_volt); + val = (on_vsel << vc->common->cmd_on_shift) | + (onlp_vsel << vc->common->cmd_onlp_shift) | + vc->setup_voltage_common; + voltdm->write(val, vc->cmdval_reg); } static int omap_vc_bypass_send_value(struct voltagedomain *voltdm, @@ -576,10 +598,12 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) onlp_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->onlp_volt); ret_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->ret_volt); off_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->off_volt); - val = ((on_vsel << vc->common->cmd_on_shift) | - (onlp_vsel << vc->common->cmd_onlp_shift) | + vc->setup_voltage_common = (ret_vsel << vc->common->cmd_ret_shift) | - (off_vsel << vc->common->cmd_off_shift)); + (off_vsel << vc->common->cmd_off_shift); + val = (on_vsel << vc->common->cmd_on_shift) | + (onlp_vsel << vc->common->cmd_onlp_shift) | + vc->setup_voltage_common; voltdm->write(val, vc->cmdval_reg); vc->cfg_channel |= vc_cfg_bits->cmd; |