Lines Matching full:pr
99 struct acpi_processor *pr; in cpufreq_set_cur_state() local
118 pr = per_cpu(processors, i); in cpufreq_set_cur_state()
120 if (unlikely(!freq_qos_request_active(&pr->thermal_req))) in cpufreq_set_cur_state()
132 ret = freq_qos_update_request(&pr->thermal_req, max_freq); in cpufreq_set_cur_state()
135 pr->id, ret); in cpufreq_set_cur_state()
165 struct acpi_processor *pr = per_cpu(processors, cpu); in acpi_thermal_cpufreq_init() local
168 if (!pr) in acpi_thermal_cpufreq_init()
172 &pr->thermal_req, in acpi_thermal_cpufreq_init()
180 thermal_cooling_device_update(pr->cdev); in acpi_thermal_cpufreq_init()
189 struct acpi_processor *pr = per_cpu(processors, cpu); in acpi_thermal_cpufreq_exit() local
191 if (!pr) in acpi_thermal_cpufreq_exit()
194 freq_qos_remove_request(&pr->thermal_req); in acpi_thermal_cpufreq_exit()
196 thermal_cooling_device_update(pr->cdev); in acpi_thermal_cpufreq_exit()
218 static int acpi_processor_max_state(struct acpi_processor *pr) in acpi_processor_max_state() argument
226 max_state += cpufreq_get_max_state(pr->id); in acpi_processor_max_state()
227 if (pr->flags.throttling) in acpi_processor_max_state()
228 max_state += (pr->throttling.state_count -1); in acpi_processor_max_state()
237 struct acpi_processor *pr; in processor_get_max_state() local
242 pr = acpi_driver_data(device); in processor_get_max_state()
243 if (!pr) in processor_get_max_state()
246 *state = acpi_processor_max_state(pr); in processor_get_max_state()
255 struct acpi_processor *pr; in processor_get_cur_state() local
260 pr = acpi_driver_data(device); in processor_get_cur_state()
261 if (!pr) in processor_get_cur_state()
264 *cur_state = cpufreq_get_cur_state(pr->id); in processor_get_cur_state()
265 if (pr->flags.throttling) in processor_get_cur_state()
266 *cur_state += pr->throttling.state; in processor_get_cur_state()
275 struct acpi_processor *pr; in processor_set_cur_state() local
282 pr = acpi_driver_data(device); in processor_set_cur_state()
283 if (!pr) in processor_set_cur_state()
286 max_pstate = cpufreq_get_max_state(pr->id); in processor_set_cur_state()
288 if (state > acpi_processor_max_state(pr)) in processor_set_cur_state()
292 if (pr->flags.throttling && pr->throttling.state) in processor_set_cur_state()
293 result = acpi_processor_set_throttling(pr, 0, false); in processor_set_cur_state()
294 cpufreq_set_cur_state(pr->id, state); in processor_set_cur_state()
296 cpufreq_set_cur_state(pr->id, max_pstate); in processor_set_cur_state()
297 result = acpi_processor_set_throttling(pr, in processor_set_cur_state()
309 int acpi_processor_thermal_init(struct acpi_processor *pr, in acpi_processor_thermal_init() argument
314 pr->cdev = thermal_cooling_device_register("Processor", device, in acpi_processor_thermal_init()
316 if (IS_ERR(pr->cdev)) { in acpi_processor_thermal_init()
317 result = PTR_ERR(pr->cdev); in acpi_processor_thermal_init()
322 pr->cdev->id); in acpi_processor_thermal_init()
325 &pr->cdev->device.kobj, in acpi_processor_thermal_init()
333 result = sysfs_create_link(&pr->cdev->device.kobj, in acpi_processor_thermal_init()
337 dev_err(&pr->cdev->device, in acpi_processor_thermal_init()
347 thermal_cooling_device_unregister(pr->cdev); in acpi_processor_thermal_init()
352 void acpi_processor_thermal_exit(struct acpi_processor *pr, in acpi_processor_thermal_exit() argument
355 if (pr->cdev) { in acpi_processor_thermal_exit()
357 sysfs_remove_link(&pr->cdev->device.kobj, "device"); in acpi_processor_thermal_exit()
358 thermal_cooling_device_unregister(pr->cdev); in acpi_processor_thermal_exit()
359 pr->cdev = NULL; in acpi_processor_thermal_exit()