cpufreq: Register notifiers with the PM QoS framework
[linux-2.6-block.git] / include / linux / cpufreq.h
index d01a74fbc4db624187f2c42b0dc304162081fc12..95425941f46d8e32eaf31a3f8d559a4587f1fc1a 100644 (file)
@@ -147,6 +147,9 @@ struct cpufreq_policy {
 
        /* Pointer to the cooling device if used for thermal mitigation */
        struct thermal_cooling_device *cdev;
+
+       struct notifier_block nb_min;
+       struct notifier_block nb_max;
 };
 
 struct cpufreq_freqs {
@@ -409,6 +412,12 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
 const char *cpufreq_get_current_driver(void);
 void *cpufreq_get_driver_data(void);
 
+static inline int cpufreq_thermal_control_enabled(struct cpufreq_driver *drv)
+{
+       return IS_ENABLED(CONFIG_CPU_THERMAL) &&
+               (drv->flags & CPUFREQ_IS_COOLING_DEV);
+}
+
 static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
                unsigned int min, unsigned int max)
 {