#include <linux/slab.h>
#include <linux/thermal.h>
+#define MAX_CLUSTERS 2
+
struct private_data {
struct device *cpu_dev;
struct thermal_cooling_device *cdev;
struct cpumask cpus;
#endif
unsigned int transition_latency;
+ unsigned long cur_freq;
bool opp_v1 = false;
const char *name;
int ret;
+ static int check_init;
cpu_dev = get_cpu_device(policy->cpu);
if (!cpu_dev) {
policy->cpuinfo.transition_latency = transition_latency;
+ if (check_init < MAX_CLUSTERS) {
+ ret = dev_pm_opp_check_initial_rate(cpu_dev, &cur_freq);
+ if (!ret)
+ policy->cur = cur_freq / 1000;
+ check_init++;
+ }
+
return 0;
out_free_cpufreq_table:
}
static struct cpufreq_driver dt_cpufreq_driver = {
-#ifdef CONFIG_ARCH_ROCKCHIP
- .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY,
-#else
- .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK,
-#endif
+ .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK |
+ CPUFREQ_HAVE_GOVERNOR_PER_POLICY,
.verify = cpufreq_generic_frequency_table_verify,
.target_index = set_target,
.get = cpufreq_generic_get,