Lines Matching refs:dtpm_cpu

29 struct dtpm_cpu {  struct
35 static DEFINE_PER_CPU(struct dtpm_cpu *, dtpm_per_cpu); argument
37 static struct dtpm_cpu *to_dtpm_cpu(struct dtpm *dtpm) in to_dtpm_cpu()
39 return container_of(dtpm, struct dtpm_cpu, dtpm); in to_dtpm_cpu()
44 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in set_pd_power_limit() local
45 struct em_perf_domain *pd = em_cpu_get(dtpm_cpu->cpu); in set_pd_power_limit()
64 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
96 pd = em_cpu_get(dtpm_cpu->cpu); in get_pd_power_uw()
100 freq = cpufreq_quick_get(dtpm_cpu->cpu); in get_pd_power_uw()
116 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in update_pd_power_uw() local
117 struct em_perf_domain *em = em_cpu_get(dtpm_cpu->cpu); in update_pd_power_uw()
137 struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm); in pd_release() local
140 if (freq_qos_request_active(&dtpm_cpu->qos_req)) in pd_release()
141 freq_qos_remove_request(&dtpm_cpu->qos_req); in pd_release()
143 policy = cpufreq_cpu_get(dtpm_cpu->cpu); in pd_release()
145 for_each_cpu(dtpm_cpu->cpu, policy->related_cpus) in pd_release()
146 per_cpu(dtpm_per_cpu, dtpm_cpu->cpu) = NULL; in pd_release()
149 kfree(dtpm_cpu); in pd_release()
161 struct dtpm_cpu *dtpm_cpu; in cpuhp_dtpm_cpu_offline() local
163 dtpm_cpu = per_cpu(dtpm_per_cpu, cpu); in cpuhp_dtpm_cpu_offline()
164 if (dtpm_cpu) in cpuhp_dtpm_cpu_offline()
165 dtpm_update_power(&dtpm_cpu->dtpm); in cpuhp_dtpm_cpu_offline()
172 struct dtpm_cpu *dtpm_cpu; in cpuhp_dtpm_cpu_online() local
174 dtpm_cpu = per_cpu(dtpm_per_cpu, cpu); in cpuhp_dtpm_cpu_online()
175 if (dtpm_cpu) in cpuhp_dtpm_cpu_online()
176 return dtpm_update_power(&dtpm_cpu->dtpm); in cpuhp_dtpm_cpu_online()
183 struct dtpm_cpu *dtpm_cpu; in __dtpm_cpu_setup() local
189 dtpm_cpu = per_cpu(dtpm_per_cpu, cpu); in __dtpm_cpu_setup()
190 if (dtpm_cpu) in __dtpm_cpu_setup()
201 dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); in __dtpm_cpu_setup()
202 if (!dtpm_cpu) in __dtpm_cpu_setup()
205 dtpm_init(&dtpm_cpu->dtpm, &dtpm_ops); in __dtpm_cpu_setup()
206 dtpm_cpu->cpu = cpu; in __dtpm_cpu_setup()
209 per_cpu(dtpm_per_cpu, cpu) = dtpm_cpu; in __dtpm_cpu_setup()
211 snprintf(name, sizeof(name), "cpu%d-cpufreq", dtpm_cpu->cpu); in __dtpm_cpu_setup()
213 ret = dtpm_register(name, &dtpm_cpu->dtpm, parent); in __dtpm_cpu_setup()
218 &dtpm_cpu->qos_req, FREQ_QOS_MAX, in __dtpm_cpu_setup()
226 dtpm_unregister(&dtpm_cpu->dtpm); in __dtpm_cpu_setup()
227 dtpm_cpu = NULL; in __dtpm_cpu_setup()
232 kfree(dtpm_cpu); in __dtpm_cpu_setup()