Lines Matching refs:policy

51 	struct cpufreq_policy *policy;  member
57 static int qcom_cpufreq_set_bw(struct cpufreq_policy *policy, in qcom_cpufreq_set_bw() argument
65 dev = get_cpu_device(policy->cpu); in qcom_cpufreq_set_bw()
98 static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, in qcom_cpufreq_hw_target_index() argument
101 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_target_index()
103 unsigned long freq = policy->freq_table[index].frequency; in qcom_cpufreq_hw_target_index()
108 qcom_cpufreq_set_bw(policy, freq); in qcom_cpufreq_hw_target_index()
117 struct cpufreq_policy *policy; in qcom_cpufreq_hw_get() local
120 policy = cpufreq_cpu_get_raw(cpu); in qcom_cpufreq_hw_get()
121 if (!policy) in qcom_cpufreq_hw_get()
124 data = policy->driver_data; in qcom_cpufreq_hw_get()
130 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_get()
133 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, in qcom_cpufreq_hw_fast_switch() argument
136 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_fast_switch()
140 index = policy->cached_resolved_idx; in qcom_cpufreq_hw_fast_switch()
143 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_fast_switch()
147 struct cpufreq_policy *policy) in qcom_cpufreq_hw_read_lut() argument
155 struct qcom_cpufreq_data *drv_data = policy->driver_data; in qcom_cpufreq_hw_read_lut()
178 policy->fast_switch_possible = true; in qcom_cpufreq_hw_read_lut()
240 policy->freq_table = table; in qcom_cpufreq_hw_read_lut()
241 dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus); in qcom_cpufreq_hw_read_lut()
279 struct cpufreq_policy *policy = data->policy; in qcom_lmh_dcvs_notify() local
280 int cpu = cpumask_first(policy->cpus); in qcom_lmh_dcvs_notify()
301 capacity = mult_frac(max_capacity, throttled_freq, policy->cpuinfo.max_freq); in qcom_lmh_dcvs_notify()
307 arch_set_thermal_pressure(policy->cpus, max_capacity - capacity); in qcom_lmh_dcvs_notify()
374 static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index) in qcom_cpufreq_hw_lmh_init() argument
376 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_lmh_init()
390 data->policy = policy; in qcom_cpufreq_hw_lmh_init()
395 snprintf(irq_name, sizeof(irq_name), "dcvsh-irq-%u", policy->cpu); in qcom_cpufreq_hw_lmh_init()
419 static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_init() argument
431 cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_init()
434 policy->cpu); in qcom_cpufreq_hw_cpu_init()
438 cpu_np = of_cpu_device_node_get(policy->cpu); in qcom_cpufreq_hw_cpu_init()
485 qcom_get_related_cpus(index, policy->cpus); in qcom_cpufreq_hw_cpu_init()
486 if (!cpumask_weight(policy->cpus)) { in qcom_cpufreq_hw_cpu_init()
492 policy->driver_data = data; in qcom_cpufreq_hw_cpu_init()
493 policy->dvfs_possible_from_any_cpu = true; in qcom_cpufreq_hw_cpu_init()
495 ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy); in qcom_cpufreq_hw_cpu_init()
508 if (policy_has_boost_freq(policy)) { in qcom_cpufreq_hw_cpu_init()
514 ret = qcom_cpufreq_hw_lmh_init(policy, index); in qcom_cpufreq_hw_cpu_init()
528 static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_exit() argument
530 struct device *cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_exit()
531 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_exit()
536 dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); in qcom_cpufreq_hw_cpu_exit()
538 kfree(policy->freq_table); in qcom_cpufreq_hw_cpu_exit()