Update SVS voltage automatically when sysfs interface is used

file:2258cf923b2db16e068fd4d36181c15c4c528934 -> file:da51162d5ad0246de7a488ffefec9e192a73472e
--- a/arch/arm/mach-msm/acpuclock-scorpion.c
+++ b/arch/arm/mach-msm/acpuclock-scorpion.c
@@ -601,16 +601,23 @@ ssize_t acpuclk_get_vdd_levels_str(char
void acpuclk_set_vdd(unsigned acpu_khz, int max_vdd)
{
int i;
+ struct clkctl_acpu_speed *cur;
+ cur = drv_state.current_speed;
max_vdd = max_vdd / 25 * 25; //! regulator only accepts multiples of 25 (mV)
mutex_lock(&drv_state.lock);
for (i = 0; acpu_freq_tbl[i].acpu_khz; i++)
{
if (freq_table[i].frequency != CPUFREQ_ENTRY_INVALID)
{
- if (acpu_khz == 0)
+ if (acpu_khz == 0) {
acpu_freq_tbl[i].vdd = min(max((acpu_freq_tbl[i].vdd + max_vdd), CONFIG_CPU_FREQ_VDD_LEVELS_MIN), CONFIG_CPU_FREQ_VDD_LEVELS_MAX);
- else if (acpu_freq_tbl[i].acpu_khz == acpu_khz)
+ if(cur->acpu_khz == acpu_freq_tbl[i].acpu_khz)
+ acpuclk_set_vdd_level(acpu_freq_tbl[i].vdd);
+ } else if (acpu_freq_tbl[i].acpu_khz == acpu_khz) {
acpu_freq_tbl[i].vdd = min(max(max_vdd, CONFIG_CPU_FREQ_VDD_LEVELS_MIN), CONFIG_CPU_FREQ_VDD_LEVELS_MAX);
+ if(cur->acpu_khz == acpu_freq_tbl[i].acpu_khz)
+ acpuclk_set_vdd_level(acpu_freq_tbl[i].vdd);
+ }
}
}
mutex_unlock(&drv_state.lock);