diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index ca0ae8ddfad1..77894a12f064 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -54,6 +54,7 @@ static struct mutex set_cpufreq_lock; static u32 *imx6_soc_volt; static u32 soc_opp_count; static bool ignore_dc_reg; +static bool low_power_run_support; static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) { @@ -99,8 +100,12 @@ 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_396_MHZ && new_freq > FREQ_396_MHZ) + if (low_power_run_support) { + if (old_freq == freq_table[0].frequency) + request_bus_freq(BUS_FREQ_HIGH); + } else if (old_freq <= FREQ_396_MHZ && new_freq > FREQ_396_MHZ) { request_bus_freq(BUS_FREQ_HIGH); + } /* scaling up? scale voltage before frequency */ if (new_freq > old_freq) { @@ -210,8 +215,12 @@ 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 (old_freq > FREQ_396_MHZ && new_freq <= FREQ_396_MHZ) + if (low_power_run_support) { + if (new_freq == freq_table[0].frequency) + release_bus_freq(BUS_FREQ_HIGH); + } else if (old_freq > FREQ_396_MHZ && new_freq <= FREQ_396_MHZ) { release_bus_freq(BUS_FREQ_HIGH); + } mutex_unlock(&set_cpufreq_lock); return 0; @@ -229,8 +238,12 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) dev_err(cpu_dev, "imx6 cpufreq init failed!\n"); return ret; } - if (policy->cur > FREQ_396_MHZ) + if (low_power_run_support && policy->cur > freq_table[0].frequency) { request_bus_freq(BUS_FREQ_HIGH); + } else if (policy->cur > FREQ_396_MHZ) { + request_bus_freq(BUS_FREQ_HIGH); + } + return 0; } @@ -358,6 +371,10 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) of_property_read_u32(np, "fsl,arm-soc-shared", &i); if (i == 1) soc_reg = arm_reg; + + /* On i.MX6ULL, check the 24MHz low power run mode support */ + low_power_run_support = of_property_read_bool(np, "fsl,low-power-run"); + /* * We expect an OPP table supplied by platform. * Just, incase the platform did not supply the OPP |