Lines Matching defs:policy

58 	struct cpufreq_policy *policy;
72 static int qcom_cpufreq_set_bw(struct cpufreq_policy *policy,
80 dev = get_cpu_device(policy->cpu);
113 static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy,
116 struct qcom_cpufreq_data *data = policy->driver_data;
118 unsigned long freq = policy->freq_table[index].frequency;
124 for (i = 1; i < cpumask_weight(policy->related_cpus); i++)
128 qcom_cpufreq_set_bw(policy, freq);
146 static unsigned int qcom_cpufreq_get_freq(struct cpufreq_policy *policy)
152 if (!policy)
155 data = policy->driver_data;
161 return policy->freq_table[index].frequency;
164 static unsigned int __qcom_cpufreq_hw_get(struct cpufreq_policy *policy)
168 if (!policy)
171 data = policy->driver_data;
176 return qcom_cpufreq_get_freq(policy);
184 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
187 struct qcom_cpufreq_data *data = policy->driver_data;
192 index = policy->cached_resolved_idx;
196 for (i = 1; i < cpumask_weight(policy->related_cpus); i++)
199 return policy->freq_table[index].frequency;
203 struct cpufreq_policy *policy)
211 struct qcom_cpufreq_data *drv_data = policy->driver_data;
235 policy->fast_switch_possible = true;
297 policy->freq_table = table;
298 dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus);
328 struct cpufreq_policy *policy = data->policy;
329 int cpu = cpumask_first(policy->related_cpus);
353 arch_update_hw_pressure(policy->related_cpus, throttled_freq);
356 * In the unlikely case policy is unregistered do not enable
428 static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)
430 struct qcom_cpufreq_data *data = policy->driver_data;
449 snprintf(data->irq_name, sizeof(data->irq_name), "dcvsh-irq-%u", policy->cpu);
457 ret = irq_set_affinity_and_hint(data->throttle_irq, policy->cpus);
465 static int qcom_cpufreq_hw_cpu_online(struct cpufreq_policy *policy)
467 struct qcom_cpufreq_data *data = policy->driver_data;
478 ret = irq_set_affinity_and_hint(data->throttle_irq, policy->cpus);
486 static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy)
488 struct qcom_cpufreq_data *data = policy->driver_data;
512 static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
522 cpu_dev = get_cpu_device(policy->cpu);
525 policy->cpu);
529 cpu_np = of_cpu_device_node_get(policy->cpu);
551 qcom_get_related_cpus(index, policy->cpus);
553 policy->driver_data = data;
554 policy->dvfs_possible_from_any_cpu = true;
555 data->policy = policy;
557 ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
569 return qcom_cpufreq_hw_lmh_init(policy, index);
572 static void qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy)
574 struct device *cpu_dev = get_cpu_device(policy->cpu);
575 struct qcom_cpufreq_data *data = policy->driver_data;
578 dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
580 kfree(policy->freq_table);
584 static void qcom_cpufreq_ready(struct cpufreq_policy *policy)
586 struct qcom_cpufreq_data *data = policy->driver_data;
614 return __qcom_cpufreq_hw_get(data->policy) * HZ_PER_KHZ;