Lines Matching full:policy
57 struct cpufreq_policy *policy; member
71 static int qcom_cpufreq_set_bw(struct cpufreq_policy *policy, in qcom_cpufreq_set_bw() argument
79 dev = get_cpu_device(policy->cpu); in qcom_cpufreq_set_bw()
112 static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, in qcom_cpufreq_hw_target_index() argument
115 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_target_index()
117 unsigned long freq = policy->freq_table[index].frequency; in qcom_cpufreq_hw_target_index()
123 for (i = 1; i < cpumask_weight(policy->related_cpus); i++) in qcom_cpufreq_hw_target_index()
127 qcom_cpufreq_set_bw(policy, freq); in qcom_cpufreq_hw_target_index()
145 static unsigned int qcom_cpufreq_get_freq(struct cpufreq_policy *policy) in qcom_cpufreq_get_freq() argument
151 if (!policy) in qcom_cpufreq_get_freq()
154 data = policy->driver_data; in qcom_cpufreq_get_freq()
160 return policy->freq_table[index].frequency; in qcom_cpufreq_get_freq()
163 static unsigned int __qcom_cpufreq_hw_get(struct cpufreq_policy *policy) in __qcom_cpufreq_hw_get() argument
167 if (!policy) in __qcom_cpufreq_hw_get()
170 data = policy->driver_data; in __qcom_cpufreq_hw_get()
175 return qcom_cpufreq_get_freq(policy); in __qcom_cpufreq_hw_get()
183 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, in qcom_cpufreq_hw_fast_switch() argument
186 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_fast_switch()
191 index = policy->cached_resolved_idx; in qcom_cpufreq_hw_fast_switch()
195 for (i = 1; i < cpumask_weight(policy->related_cpus); i++) in qcom_cpufreq_hw_fast_switch()
198 return policy->freq_table[index].frequency; in qcom_cpufreq_hw_fast_switch()
202 struct cpufreq_policy *policy) in qcom_cpufreq_hw_read_lut() argument
210 struct qcom_cpufreq_data *drv_data = policy->driver_data; in qcom_cpufreq_hw_read_lut()
234 policy->fast_switch_possible = true; in qcom_cpufreq_hw_read_lut()
296 policy->freq_table = table; in qcom_cpufreq_hw_read_lut()
297 dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus); in qcom_cpufreq_hw_read_lut()
327 struct cpufreq_policy *policy = data->policy; in qcom_lmh_dcvs_notify() local
328 int cpu = cpumask_first(policy->related_cpus); in qcom_lmh_dcvs_notify()
352 arch_update_thermal_pressure(policy->related_cpus, throttled_freq); in qcom_lmh_dcvs_notify()
355 * In the unlikely case policy is unregistered do not enable in qcom_lmh_dcvs_notify()
427 static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index) in qcom_cpufreq_hw_lmh_init() argument
429 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_lmh_init()
448 snprintf(data->irq_name, sizeof(data->irq_name), "dcvsh-irq-%u", policy->cpu); in qcom_cpufreq_hw_lmh_init()
456 ret = irq_set_affinity_and_hint(data->throttle_irq, policy->cpus); in qcom_cpufreq_hw_lmh_init()
464 static int qcom_cpufreq_hw_cpu_online(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_online() argument
466 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_online()
477 ret = irq_set_affinity_and_hint(data->throttle_irq, policy->cpus); in qcom_cpufreq_hw_cpu_online()
485 static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_offline() argument
487 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_offline()
511 static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_init() argument
521 cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_init()
524 policy->cpu); in qcom_cpufreq_hw_cpu_init()
528 cpu_np = of_cpu_device_node_get(policy->cpu); in qcom_cpufreq_hw_cpu_init()
550 qcom_get_related_cpus(index, policy->cpus); in qcom_cpufreq_hw_cpu_init()
552 policy->driver_data = data; in qcom_cpufreq_hw_cpu_init()
553 policy->dvfs_possible_from_any_cpu = true; in qcom_cpufreq_hw_cpu_init()
554 data->policy = policy; in qcom_cpufreq_hw_cpu_init()
556 ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy); in qcom_cpufreq_hw_cpu_init()
568 if (policy_has_boost_freq(policy)) { in qcom_cpufreq_hw_cpu_init()
574 return qcom_cpufreq_hw_lmh_init(policy, index); in qcom_cpufreq_hw_cpu_init()
577 static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) in qcom_cpufreq_hw_cpu_exit() argument
579 struct device *cpu_dev = get_cpu_device(policy->cpu); in qcom_cpufreq_hw_cpu_exit()
580 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_hw_cpu_exit()
583 dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); in qcom_cpufreq_hw_cpu_exit()
585 kfree(policy->freq_table); in qcom_cpufreq_hw_cpu_exit()
591 static void qcom_cpufreq_ready(struct cpufreq_policy *policy) in qcom_cpufreq_ready() argument
593 struct qcom_cpufreq_data *data = policy->driver_data; in qcom_cpufreq_ready()
627 return __qcom_cpufreq_hw_get(data->policy) * HZ_PER_KHZ; in qcom_cpufreq_hw_recalc_rate()