From: chenxing Date: Fri, 22 Feb 2013 03:46:58 +0000 (+0800) Subject: rk3168: dvfs support voltage diff = 0 X-Git-Tag: firefly_0821_release~7578 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=135c26aa3ee0c7ce09bbdba0fd81c0f153b7f178;p=firefly-linux-kernel-4.4.55.git rk3168: dvfs support voltage diff = 0 --- diff --git a/arch/arm/mach-rk30/dvfs.c b/arch/arm/mach-rk30/dvfs.c index caa54218c385..deb38384d365 100755 --- a/arch/arm/mach-rk30/dvfs.c +++ b/arch/arm/mach-rk30/dvfs.c @@ -87,14 +87,14 @@ static int g_logic_high_arm = 100 * 1000; #ifdef CONFIG_SOC_RK3168 static struct cpufreq_frequency_table arm_high_logic_table[] = { - {.frequency = 1416 * DVFS_KHZ, .index = 25 * DVFS_MV}, - {.frequency = 1608 * DVFS_KHZ, .index = 25 * DVFS_MV}, + {.frequency = 1416 * DVFS_KHZ, .index = 0 * DVFS_MV}, + {.frequency = 1608 * DVFS_KHZ, .index = 0 * DVFS_MV}, {.frequency = CPUFREQ_TABLE_END}, }; static struct cpufreq_frequency_table logic_high_arm_table[] = { - {.frequency = 1008 * DVFS_KHZ, .index = 150 * DVFS_MV}, - {.frequency = 1608 * DVFS_KHZ, .index = 75 * DVFS_MV}, + {.frequency = 1008 * DVFS_KHZ, .index = 50 * DVFS_MV}, + {.frequency = 1608 * DVFS_KHZ, .index = 50 * DVFS_MV}, {.frequency = CPUFREQ_TABLE_END}, }; #else diff --git a/arch/arm/plat-rk/dvfs.c b/arch/arm/plat-rk/dvfs.c index f645f6a09b94..d93b69d45be5 100755 --- a/arch/arm/plat-rk/dvfs.c +++ b/arch/arm/plat-rk/dvfs.c @@ -777,12 +777,17 @@ int dvfs_scale_volt(struct vd_node *vd_clk, struct vd_node *vd_dep, } else { volt_dep = volt + dep_biger_than_clk; } - } else { + } else if (volt < volt_dep){ if (volt == volt_new) { volt_dep = volt + dep_biger_than_clk; } else { volt = volt_dep + clk_biger_than_dep; } + } else { + if (volt != volt_new) + volt = volt_dep + clk_biger_than_dep; + if (volt_dep != volt_dep_new) + volt_dep = volt + dep_biger_than_clk; } volt = volt > volt_new ? volt_new : volt; volt_dep = volt_dep > volt_dep_new ? volt_dep_new : volt_dep; @@ -796,12 +801,17 @@ int dvfs_scale_volt(struct vd_node *vd_clk, struct vd_node *vd_dep, } else { volt = volt_dep - dep_biger_than_clk; } - } else { + } else if (volt < volt_dep){ if (volt_dep == volt_dep_new) { volt = volt_dep - dep_biger_than_clk; } else { volt_dep = volt - clk_biger_than_dep; } + } else { + if (volt != volt_new) + volt = volt_dep - dep_biger_than_clk; + if (volt_dep != volt_dep_new) + volt_dep = volt - clk_biger_than_dep; } volt = volt < volt_new ? volt_new : volt; volt_dep = volt_dep < volt_dep_new ? volt_dep_new : volt_dep;