mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 17:28:56 +00:00
thermal: cpu_cooling: store cpufreq policy
The cpufreq policy can be used by the cpu_cooling driver, lets store it in the cpufreq_cooling_device structure. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
55d8529313
commit
b12b651949
@ -67,6 +67,7 @@ struct power_table {
|
|||||||
* registered.
|
* registered.
|
||||||
* @cdev: thermal_cooling_device pointer to keep track of the
|
* @cdev: thermal_cooling_device pointer to keep track of the
|
||||||
* registered cooling device.
|
* registered cooling device.
|
||||||
|
* @policy: cpufreq policy.
|
||||||
* @cpufreq_state: integer value representing the current state of cpufreq
|
* @cpufreq_state: integer value representing the current state of cpufreq
|
||||||
* cooling devices.
|
* cooling devices.
|
||||||
* @clipped_freq: integer value representing the absolute value of the clipped
|
* @clipped_freq: integer value representing the absolute value of the clipped
|
||||||
@ -91,6 +92,7 @@ struct power_table {
|
|||||||
struct cpufreq_cooling_device {
|
struct cpufreq_cooling_device {
|
||||||
int id;
|
int id;
|
||||||
struct thermal_cooling_device *cdev;
|
struct thermal_cooling_device *cdev;
|
||||||
|
struct cpufreq_policy *policy;
|
||||||
unsigned int cpufreq_state;
|
unsigned int cpufreq_state;
|
||||||
unsigned int clipped_freq;
|
unsigned int clipped_freq;
|
||||||
unsigned int max_level;
|
unsigned int max_level;
|
||||||
@ -760,6 +762,7 @@ __cpufreq_cooling_register(struct device_node *np,
|
|||||||
if (!cpufreq_cdev)
|
if (!cpufreq_cdev)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
|
cpufreq_cdev->policy = policy;
|
||||||
num_cpus = cpumask_weight(policy->related_cpus);
|
num_cpus = cpumask_weight(policy->related_cpus);
|
||||||
cpufreq_cdev->time_in_idle = kcalloc(num_cpus,
|
cpufreq_cdev->time_in_idle = kcalloc(num_cpus,
|
||||||
sizeof(*cpufreq_cdev->time_in_idle),
|
sizeof(*cpufreq_cdev->time_in_idle),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user