Lines Matching refs:policy

57 	struct cpufreq_policy *policy;  member
67 static int qcom_cpufreq_set_bw(struct cpufreq_policy *policy, in qcom_cpufreq_set_bw() argument
75 dev = get_cpu_device(policy->cpu); in qcom_cpufreq_set_bw()
108 static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, in qcom_cpufreq_hw_target_index() argument
111 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_target_index()
113 unsigned long freq = policy->freq_table[index].frequency; in qcom_cpufreq_hw_target_index()
119 for (i = 1; i < cpumask_weight(policy->related_cpus); i++) in qcom_cpufreq_hw_target_index()
123 qcom_cpufreq_set_bw(policy, freq); in qcom_cpufreq_hw_target_index()
132 struct cpufreq_policy *policy; in qcom_cpufreq_hw_get() local
135 policy = cpufreq_cpu_get_raw(cpu); in qcom_cpufreq_hw_get()
136 if (!policy) in qcom_cpufreq_hw_get()
139 data = policy->driver_data; in qcom_cpufreq_hw_get()
145 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_get()
148 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, in qcom_cpufreq_hw_fast_switch() argument
151 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_fast_switch()
156 index = policy->cached_resolved_idx; in qcom_cpufreq_hw_fast_switch()
160 for (i = 1; i < cpumask_weight(policy->related_cpus); i++) in qcom_cpufreq_hw_fast_switch()
163 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_fast_switch()
167 struct cpufreq_policy *policy) in qcom_cpufreq_hw_read_lut() argument
175 struct qcom_cpufreq_data *drv_data = policy->driver_data; in qcom_cpufreq_hw_read_lut()
198 policy->fast_switch_possible = true; in qcom_cpufreq_hw_read_lut()
260 policy->freq_table = table; in qcom_cpufreq_hw_read_lut()
261 dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus); in qcom_cpufreq_hw_read_lut()
303 struct cpufreq_policy *policy = data->policy; in qcom_lmh_dcvs_notify() local
304 int cpu = cpumask_first(policy->related_cpus); in qcom_lmh_dcvs_notify()
330 arch_update_thermal_pressure(policy->related_cpus, throttled_freq); in qcom_lmh_dcvs_notify()
405 static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index) in qcom_cpufreq_hw_lmh_init() argument
407 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_lmh_init()
421 ret = freq_qos_add_request(&policy->constraints, in qcom_cpufreq_hw_lmh_init()
430 data->policy = policy; in qcom_cpufreq_hw_lmh_init()
435 snprintf(data->irq_name, sizeof(data->irq_name), "dcvsh-irq-%u", policy->cpu); in qcom_cpufreq_hw_lmh_init()
443 ret = irq_set_affinity_and_hint(data->throttle_irq, policy->cpus); in qcom_cpufreq_hw_lmh_init()
451 static int qcom_cpufreq_hw_cpu_online(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_online() argument
453 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_online()
464 ret = irq_set_affinity_and_hint(data->throttle_irq, policy->cpus); in qcom_cpufreq_hw_cpu_online()
472 static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_offline() argument
474 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_offline()
499 static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_init() argument
511 cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_init()
514 policy->cpu); in qcom_cpufreq_hw_cpu_init()
518 cpu_np = of_cpu_device_node_get(policy->cpu); in qcom_cpufreq_hw_cpu_init()
568 qcom_get_related_cpus(index, policy->cpus); in qcom_cpufreq_hw_cpu_init()
569 if (cpumask_empty(policy->cpus)) { in qcom_cpufreq_hw_cpu_init()
575 policy->driver_data = data; in qcom_cpufreq_hw_cpu_init()
576 policy->dvfs_possible_from_any_cpu = true; in qcom_cpufreq_hw_cpu_init()
578 ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy); in qcom_cpufreq_hw_cpu_init()
591 if (policy_has_boost_freq(policy)) { in qcom_cpufreq_hw_cpu_init()
597 ret = qcom_cpufreq_hw_lmh_init(policy, index); in qcom_cpufreq_hw_cpu_init()
611 static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_exit() argument
613 struct device *cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_exit()
614 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_exit()
619 dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); in qcom_cpufreq_hw_cpu_exit()
621 kfree(policy->freq_table); in qcom_cpufreq_hw_cpu_exit()
629 static void qcom_cpufreq_ready(struct cpufreq_policy *policy) in qcom_cpufreq_ready() argument
631 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_ready()