diff mbox series

[v2,3/9] drivers: cpufreq: Add thermal_cooling_device pointer to struct cpufreq_policy

Message ID bbc4cccbe2931de5f7e07b70a4873624424ac930.1547458732.git.amit.kucheria@linaro.org
State Superseded
Headers show
Series [v2,1/9,ALREADY,QUEUED] cpufreq: qcom-hw: Move to device_initcall | expand

Commit Message

Amit Kucheria Jan. 14, 2019, 10:21 a.m. UTC
Several cpufreq drivers register themselves as thermal cooling devices.
Adding a pointer to struct cpufreq_policy removes the need for them to
store this pointer in a private data structure.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>

---
 include/linux/cpufreq.h | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.17.1

Comments

Stephen Boyd Jan. 14, 2019, 11:54 p.m. UTC | #1
Quoting Amit Kucheria (2019-01-14 02:21:05)
> Several cpufreq drivers register themselves as thermal cooling devices.

> Adding a pointer to struct cpufreq_policy removes the need for them to

> store this pointer in a private data structure.

> 

> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---


Reviewed-by: Stephen Boyd <swboyd@chromium.org>
diff mbox series

Patch

diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c86d6d8bdfed..9fbc1d996967 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -95,6 +95,9 @@  struct cpufreq_policy {
 	struct cpufreq_frequency_table	*freq_table;
 	enum cpufreq_table_sorting freq_table_sorted;
 
+	/* Pointer to the cooling device if used for thermal mitigation */
+	struct thermal_cooling_device *cooldev;
+
 	struct list_head        policy_list;
 	struct kobject		kobj;
 	struct completion	kobj_unregister;