Lines Matching refs:policy
55 struct cpufreq_policy *policy; member
61 static int qcom_cpufreq_set_bw(struct cpufreq_policy *policy, in qcom_cpufreq_set_bw() argument
69 dev = get_cpu_device(policy->cpu); in qcom_cpufreq_set_bw()
102 static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, in qcom_cpufreq_hw_target_index() argument
105 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_target_index()
107 unsigned long freq = policy->freq_table[index].frequency; in qcom_cpufreq_hw_target_index()
112 qcom_cpufreq_set_bw(policy, freq); in qcom_cpufreq_hw_target_index()
121 struct cpufreq_policy *policy; in qcom_cpufreq_hw_get() local
124 policy = cpufreq_cpu_get_raw(cpu); in qcom_cpufreq_hw_get()
125 if (!policy) in qcom_cpufreq_hw_get()
128 data = policy->driver_data; in qcom_cpufreq_hw_get()
134 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_get()
137 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, in qcom_cpufreq_hw_fast_switch() argument
140 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_fast_switch()
144 index = policy->cached_resolved_idx; in qcom_cpufreq_hw_fast_switch()
147 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_fast_switch()
151 struct cpufreq_policy *policy) in qcom_cpufreq_hw_read_lut() argument
159 struct qcom_cpufreq_data *drv_data = policy->driver_data; in qcom_cpufreq_hw_read_lut()
183 policy->fast_switch_possible = true; in qcom_cpufreq_hw_read_lut()
245 policy->freq_table = table; in qcom_cpufreq_hw_read_lut()
246 dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus); in qcom_cpufreq_hw_read_lut()
289 struct cpufreq_policy *policy = data->policy; in qcom_lmh_dcvs_notify() local
290 int cpu = cpumask_first(policy->related_cpus); in qcom_lmh_dcvs_notify()
309 capacity = mult_frac(max_capacity, throttled_freq, policy->cpuinfo.max_freq); in qcom_lmh_dcvs_notify()
315 arch_set_thermal_pressure(policy->related_cpus, in qcom_lmh_dcvs_notify()
389 static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index) in qcom_cpufreq_hw_lmh_init() argument
391 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_lmh_init()
405 data->policy = policy; in qcom_cpufreq_hw_lmh_init()
410 snprintf(irq_name, sizeof(irq_name), "dcvsh-irq-%u", policy->cpu); in qcom_cpufreq_hw_lmh_init()
434 static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_init() argument
446 cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_init()
449 policy->cpu); in qcom_cpufreq_hw_cpu_init()
453 cpu_np = of_cpu_device_node_get(policy->cpu); in qcom_cpufreq_hw_cpu_init()
500 qcom_get_related_cpus(index, policy->cpus); in qcom_cpufreq_hw_cpu_init()
501 if (!cpumask_weight(policy->cpus)) { in qcom_cpufreq_hw_cpu_init()
507 policy->driver_data = data; in qcom_cpufreq_hw_cpu_init()
508 policy->dvfs_possible_from_any_cpu = true; in qcom_cpufreq_hw_cpu_init()
510 ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy); in qcom_cpufreq_hw_cpu_init()
523 if (policy_has_boost_freq(policy)) { in qcom_cpufreq_hw_cpu_init()
529 ret = qcom_cpufreq_hw_lmh_init(policy, index); in qcom_cpufreq_hw_cpu_init()
543 static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_exit() argument
545 struct device *cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_exit()
546 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_exit()
551 dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); in qcom_cpufreq_hw_cpu_exit()
553 kfree(policy->freq_table); in qcom_cpufreq_hw_cpu_exit()