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 | |
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')
-rwxr-xr-x | arch/arm/plat-mxc/cpu.c | 1 | ||||
-rwxr-xr-x | arch/arm/plat-mxc/cpufreq.c | 8 | ||||
-rwxr-xr-x | arch/arm/plat-mxc/dvfs_core.c | 21 |
3 files changed, 18 insertions, 12 deletions
diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/plat-mxc/cpu.c index 157e01a644da..143a9b7b0aaa 100755 --- a/arch/arm/plat-mxc/cpu.c +++ b/arch/arm/plat-mxc/cpu.c @@ -22,7 +22,6 @@ unsigned int __mxc_cpu_type; EXPORT_SYMBOL(__mxc_cpu_type); extern int mxc_early_serial_console_init(unsigned long base, struct clk *clk); -int (*set_cpu_voltage)(u32 volt); void (*set_num_cpu_op)(int num); void mxc_set_cpu_type(unsigned int type) diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index 906ecca7cf78..f194f1cb92a0 100755 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c @@ -42,9 +42,9 @@ static int cpu_op_nr; static struct cpu_op *cpu_op_tbl; static u32 pre_suspend_rate; +extern struct regulator *cpu_regulator; extern int dvfs_core_is_active; extern struct cpu_op *(*get_cpu_op)(int *op); -extern int (*set_cpu_voltage)(u32 cpu_volt); int set_cpu_freq(int freq) { @@ -66,7 +66,8 @@ int set_cpu_freq(int freq) /*Set the voltage for the GP domain. */ if (freq > 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; @@ -81,7 +82,8 @@ int set_cpu_freq(int freq) } if (freq < 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; 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; |