cpufreq: Register notifiers with the PM QoS framework
[linux-2.6-block.git] / include / linux / cpufreq.h
index 684caf067003b0b3c45424f914e821f6797531ca..95425941f46d8e32eaf31a3f8d559a4587f1fc1a 100644 (file)
@@ -42,13 +42,6 @@ enum cpufreq_table_sorting {
        CPUFREQ_TABLE_SORTED_DESCENDING
 };
 
-struct cpufreq_freqs {
-       unsigned int cpu;       /* cpu nr */
-       unsigned int old;
-       unsigned int new;
-       u8 flags;               /* flags of cpufreq_driver, see below. */
-};
-
 struct cpufreq_cpuinfo {
        unsigned int            max_freq;
        unsigned int            min_freq;
@@ -154,6 +147,16 @@ 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 {
+       struct cpufreq_policy *policy;
+       unsigned int old;
+       unsigned int new;
+       u8 flags;               /* flags of cpufreq_driver, see below. */
 };
 
 /* Only for ACPI */
@@ -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)
 {