diff options
author | Bai Ping <b51503@freescale.com> | 2015-02-28 19:19:56 +0800 |
---|---|---|
committer | Bai Ping <b51503@freescale.com> | 2015-03-04 18:50:39 +0800 |
commit | e65df60e1b7777d48ccf4161944436a1d3d6a661 (patch) | |
tree | a6a45bfb215f346e977c30dce450f5b22bc3d166 | |
parent | d24a5df30aed6e85e19e9bfe92f184b933debbdb (diff) |
MLK-10271 cpufreq: imx6: improve busfreq operation when wehn setpoint lower than 396MHz
for i.MX6SX, according to the latest datasheet, added a 198MHz setpoint in cpufreq driver.
The 198MHz setpoint is NOT enough to support playing mp3,the system will stay at a higher
setpoint and high_bus_mode. So when having a setpoint lower than 396MHz, make sure when
the cpufreq is at 396MHz or lower, the busfreq is always in low_bus_mode to save more power.
Signed-off-by: Bai Ping <b51503@freescale.com>
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 601326ca6408..e62ef8a6108b 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -22,6 +22,7 @@ #define PU_SOC_VOLTAGE_NORMAL 1250000 #define PU_SOC_VOLTAGE_HIGH 1275000 #define FREQ_1P2_GHZ 1200000000 +#define FREQ_396_MHZ 396000 static struct regulator *arm_reg; static struct regulator *pu_reg; @@ -76,7 +77,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) * CPU freq is increasing, so need to ensure * that bus frequency is increased too. */ - if (old_freq == freq_table[0].frequency) + if (old_freq <= FREQ_396_MHZ && new_freq > FREQ_396_MHZ) request_bus_freq(BUS_FREQ_HIGH); /* scaling up? scale voltage before frequency */ @@ -169,7 +170,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) * If CPU is dropped to the lowest level, release the need * for a high bus frequency. */ - if (new_freq == freq_table[0].frequency) + if (old_freq > FREQ_396_MHZ && new_freq <= FREQ_396_MHZ) release_bus_freq(BUS_FREQ_HIGH); mutex_unlock(&set_cpufreq_lock); @@ -188,9 +189,8 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) dev_err(cpu_dev, "imx6 cpufreq init failed!\n"); return ret; } - if (policy->cur > freq_table[0].frequency) + if (policy->cur > FREQ_396_MHZ) request_bus_freq(BUS_FREQ_HIGH); - return 0; } |