diff options
author | Nancy Chen <Nancy.Chen@freescale.com> | 2011-12-12 11:17:11 -0600 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 21:10:26 +0800 |
commit | 23ae020295f81875fb9d044f671103fd2fcf9ad8 (patch) | |
tree | 98f831c10a0696c89d5ddd4a5c1861a867a6d57b /arch/arm/plat-mxc/dvfs_core.c | |
parent | 0e1a3882977bdfe562e14a13a7f7a0d8ee5b679a (diff) |
ENGR00161124 [dvfs, cpufreq] Use regulator API to set cpu voltage
Change dvfs driver and cpufreq driver to use regulator API to set cpu voltage.
Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc/dvfs_core.c')
-rwxr-xr-x | arch/arm/plat-mxc/dvfs_core.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/arm/plat-mxc/dvfs_core.c b/arch/arm/plat-mxc/dvfs_core.c index 7721832ebb11..6616831aea50 100755 --- a/arch/arm/plat-mxc/dvfs_core.c +++ b/arch/arm/plat-mxc/dvfs_core.c @@ -99,7 +99,7 @@ static int maxf; static int minf; extern void setup_pll(void); -extern int (*set_cpu_voltage)(u32 cpu_volt); +extern struct regulator *cpu_regulator; struct timeval core_prev_intr; @@ -118,7 +118,6 @@ static struct clk *dvfs_clk; static int cpu_op_nr; extern struct cpu_op *(*get_cpu_op)(int *op); -extern int (*set_cpu_voltage)(u32 cpu_volt); static inline unsigned long dvfs_cpu_jiffies(unsigned long old, u_int div, u_int mult) { @@ -211,7 +210,8 @@ static int mx5_set_cpu_freq(int op) /*Set the voltage for the GP domain. */ if (rate > org_cpu_rate) { - ret = set_cpu_voltage(gp_volt); + ret = regulator_set_voltage(cpu_regulator, gp_volt, + gp_volt); if (ret < 0) { printk(KERN_DEBUG "COULD NOT SET GP VOLTAGE\n"); return ret; @@ -258,7 +258,8 @@ static int mx5_set_cpu_freq(int op) spin_unlock_irqrestore(&mxc_dvfs_core_lock, flags); if (rate < org_cpu_rate) { - ret = set_cpu_voltage(gp_volt); + ret = regulator_set_voltage(cpu_regulator, gp_volt, + gp_volt); if (ret < 0) { printk(KERN_DEBUG "COULD NOT SET GP VOLTAGE!!!!\n"); @@ -299,7 +300,8 @@ static int mx5_set_cpu_freq(int op) } /* Check if FSVAI indicate freq up */ if (podf < arm_podf) { - ret = set_cpu_voltage(gp_volt); + ret = regulator_set_voltage(cpu_regulator, gp_volt, + gp_volt); if (ret < 0) { printk(KERN_DEBUG "COULD NOT SET GP VOLTAGE!!!!\n"); @@ -359,7 +361,8 @@ static int mx5_set_cpu_freq(int op) spin_unlock_irqrestore(&mxc_dvfs_core_lock, flags); if (vinc == 0) { - ret = set_cpu_voltage(gp_volt); + ret = regulator_set_voltage(cpu_regulator, gp_volt, + gp_volt); if (ret < 0) { printk(KERN_DEBUG "COULD NOT SET GP VOLTAGE\n!!!"); @@ -393,7 +396,8 @@ static int mx6_set_cpu_freq(int op) if (rate > org_cpu_rate) { /* Increase voltage first. */ - ret = set_cpu_voltage(gp_volt); + ret = regulator_set_voltage(cpu_regulator, gp_volt, + gp_volt); if (ret < 0) { printk(KERN_DEBUG "COULD NOT INCREASE GP VOLTAGE!!!!\n"); return ret; @@ -408,7 +412,8 @@ static int mx6_set_cpu_freq(int op) if (rate < org_cpu_rate) { /* Increase voltage first. */ - ret = set_cpu_voltage(gp_volt); + ret = regulator_set_voltage(cpu_regulator, gp_volt, + gp_volt); if (ret < 0) { printk(KERN_DEBUG "COULD NOT INCREASE GP VOLTAGE!!!!\n"); return ret; |