Lines Matching refs:dtpm
26 static struct dtpm *__parent;
28 static DEFINE_PER_CPU(struct dtpm *, dtpm_per_cpu);
39 static int power_add(struct dtpm *dtpm, struct em_perf_domain *em) in power_add() argument
45 power_min += dtpm->power_min; in power_add()
49 power_max += dtpm->power_max; in power_add()
51 return dtpm_update_power(dtpm, power_min, power_max); in power_add()
58 static int power_sub(struct dtpm *dtpm, struct em_perf_domain *em) in power_sub() argument
64 power_min = dtpm->power_min - power_min; in power_sub()
68 power_max = dtpm->power_max - power_max; in power_sub()
70 return dtpm_update_power(dtpm, power_min, power_max); in power_sub()
73 static u64 set_pd_power_limit(struct dtpm *dtpm, u64 power_limit) in set_pd_power_limit() argument
75 struct dtpm_cpu *dtpm_cpu = dtpm->private; in set_pd_power_limit()
106 static u64 get_pd_power_uw(struct dtpm *dtpm) in get_pd_power_uw() argument
108 struct dtpm_cpu *dtpm_cpu = dtpm->private; in get_pd_power_uw()
131 static void pd_release(struct dtpm *dtpm) in pd_release() argument
133 struct dtpm_cpu *dtpm_cpu = dtpm->private; in pd_release()
151 struct dtpm *dtpm; in cpuhp_dtpm_cpu_offline() local
162 dtpm = per_cpu(dtpm_per_cpu, cpu); in cpuhp_dtpm_cpu_offline()
164 power_sub(dtpm, pd); in cpuhp_dtpm_cpu_offline()
172 dtpm_unregister(dtpm); in cpuhp_dtpm_cpu_offline()
179 struct dtpm *dtpm; in cpuhp_dtpm_cpu_online() local
195 dtpm = per_cpu(dtpm_per_cpu, cpu); in cpuhp_dtpm_cpu_online()
196 if (dtpm) in cpuhp_dtpm_cpu_online()
197 return power_add(dtpm, pd); in cpuhp_dtpm_cpu_online()
199 dtpm = dtpm_alloc(&dtpm_ops); in cpuhp_dtpm_cpu_online()
200 if (!dtpm) in cpuhp_dtpm_cpu_online()
207 dtpm->private = dtpm_cpu; in cpuhp_dtpm_cpu_online()
211 per_cpu(dtpm_per_cpu, cpu) = dtpm; in cpuhp_dtpm_cpu_online()
215 ret = dtpm_register(name, dtpm, __parent); in cpuhp_dtpm_cpu_online()
219 ret = power_add(dtpm, pd); in cpuhp_dtpm_cpu_online()
232 power_sub(dtpm, pd); in cpuhp_dtpm_cpu_online()
235 dtpm_unregister(dtpm); in cpuhp_dtpm_cpu_online()
237 dtpm = NULL; in cpuhp_dtpm_cpu_online()
245 kfree(dtpm); in cpuhp_dtpm_cpu_online()
249 int dtpm_register_cpu(struct dtpm *parent) in dtpm_register_cpu()