Normally, the system is booting up with higher cpufreq. In the
cpufreq set_target_index we will release the high bus mode if
the target cpu frequency is the lowest. It will release the high
bus mode and dcrease the high_bus_count.This will lead to a wrong
release of high bus mode. So, in the cpufreq_init function, if the
original frequency is not the lowest, we need request high busfreq.
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit
7df8887a6ddac148d33cd583da31ec72d0ba07da)
static int imx6q_cpufreq_init(struct cpufreq_policy *policy)
{
+ int ret;
+
policy->clk = arm_clk;
- return cpufreq_generic_init(policy, freq_table, transition_latency);
+ policy->cur = clk_get_rate(arm_clk) / 1000;
+
+ ret = cpufreq_generic_init(policy, freq_table, transition_latency);
+ if (ret) {
+ dev_err(cpu_dev, "imx6 cpufreq init failed!\n");
+ return ret;
+ }
+ if (policy->cur > freq_table[0].frequency)
+ request_bus_freq(BUS_FREQ_HIGH);
+
+ return 0;
}
static struct cpufreq_driver imx6q_cpufreq_driver = {