rk3168: dvfs support voltage diff = 0

This commit is contained in:
chenxing
2013-02-22 11:46:58 +08:00
parent 7cb48b21e8
commit 135c26aa3e
2 changed files with 16 additions and 6 deletions

View File

@@ -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

View File

@@ -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;