Lines Matching refs:dtpm_cpu

28 struct dtpm_cpu {  struct
34 static DEFINE_PER_CPU(struct dtpm_cpu *, dtpm_per_cpu); argument
36 static struct dtpm_cpu *to_dtpm_cpu(struct dtpm *dtpm) in to_dtpm_cpu()
38 return container_of(dtpm, struct dtpm_cpu, dtpm); in to_dtpm_cpu()
43 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in set_pd_power_limit() local
44 struct em_perf_domain *pd = em_cpu_get(dtpm_cpu->cpu); in set_pd_power_limit()
66 freq_qos_update_request(&dtpm_cpu->qos_req, freq); in set_pd_power_limit()
90 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in get_pd_power_uw() local
98 pd = em_cpu_get(dtpm_cpu->cpu); in get_pd_power_uw()
102 freq = cpufreq_quick_get(dtpm_cpu->cpu); in get_pd_power_uw()
121 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in update_pd_power_uw() local
122 struct em_perf_domain *em = em_cpu_get(dtpm_cpu->cpu); in update_pd_power_uw()
144 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in pd_release() local
147 if (freq_qos_request_active(&dtpm_cpu->qos_req)) in pd_release()
148 freq_qos_remove_request(&dtpm_cpu->qos_req); in pd_release()
150 policy = cpufreq_cpu_get(dtpm_cpu->cpu); in pd_release()
152 for_each_cpu(dtpm_cpu->cpu, policy->related_cpus) in pd_release()
153 per_cpu(dtpm_per_cpu, dtpm_cpu->cpu) = NULL; in pd_release()
158 kfree(dtpm_cpu); in pd_release()
170 struct dtpm_cpu *dtpm_cpu; in cpuhp_dtpm_cpu_offline() local
172 dtpm_cpu = per_cpu(dtpm_per_cpu, cpu); in cpuhp_dtpm_cpu_offline()
173 if (dtpm_cpu) in cpuhp_dtpm_cpu_offline()
174 dtpm_update_power(&dtpm_cpu->dtpm); in cpuhp_dtpm_cpu_offline()
181 struct dtpm_cpu *dtpm_cpu; in cpuhp_dtpm_cpu_online() local
183 dtpm_cpu = per_cpu(dtpm_per_cpu, cpu); in cpuhp_dtpm_cpu_online()
184 if (dtpm_cpu) in cpuhp_dtpm_cpu_online()
185 return dtpm_update_power(&dtpm_cpu->dtpm); in cpuhp_dtpm_cpu_online()
192 struct dtpm_cpu *dtpm_cpu; in __dtpm_cpu_setup() local
199 dtpm_cpu = per_cpu(dtpm_per_cpu, cpu); in __dtpm_cpu_setup()
200 if (dtpm_cpu) in __dtpm_cpu_setup()
213 dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); in __dtpm_cpu_setup()
214 if (!dtpm_cpu) { in __dtpm_cpu_setup()
219 dtpm_init(&dtpm_cpu->dtpm, &dtpm_ops); in __dtpm_cpu_setup()
220 dtpm_cpu->cpu = cpu; in __dtpm_cpu_setup()
223 per_cpu(dtpm_per_cpu, cpu) = dtpm_cpu; in __dtpm_cpu_setup()
225 snprintf(name, sizeof(name), "cpu%d-cpufreq", dtpm_cpu->cpu); in __dtpm_cpu_setup()
227 ret = dtpm_register(name, &dtpm_cpu->dtpm, parent); in __dtpm_cpu_setup()
234 &dtpm_cpu->qos_req, FREQ_QOS_MAX, in __dtpm_cpu_setup()
244 dtpm_unregister(&dtpm_cpu->dtpm); in __dtpm_cpu_setup()
245 dtpm_cpu = NULL; in __dtpm_cpu_setup()
250 kfree(dtpm_cpu); in __dtpm_cpu_setup()