summaryrefslogtreecommitdiff
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorDurgadoss R <durgadoss.r@intel.com>2012-09-18 09:34:57 +0400
committerZhang Rui <rui.zhang@intel.com>2012-11-05 10:00:05 +0400
commita4a15485fbba44d162d626141b9a7404e790f570 (patch)
tree1fdff11c9a771b879238f03eafec080fa193edf7 /include/linux/thermal.h
parent50125a9b27dd09e9afdc1b8712ba0b3859886c68 (diff)
downloadlinux-a4a15485fbba44d162d626141b9a7404e790f570.tar.xz
Thermal: Add thermal governor registration APIs
This patch creates a structure to hold platform thermal governor information, and provides APIs for individual thermal governors to register/unregister with the Thermal framework. Signed-off-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 58cb1c036a0e..6182bd5f7504 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -46,6 +46,9 @@
#define THERMAL_GENL_VERSION 0x01
#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group"
+/* Default Thermal Governor: Does Linear Throttling */
+#define DEFAULT_THERMAL_GOVERNOR "step_wise"
+
struct thermal_zone_device;
struct thermal_cooling_device;
@@ -158,6 +161,7 @@ struct thermal_zone_device {
unsigned int forced_passive;
const struct thermal_zone_device_ops *ops;
const struct thermal_zone_params *tzp;
+ struct thermal_governor *governor;
struct list_head thermal_instances;
struct idr idr;
struct mutex lock; /* protect thermal_instances list */
@@ -165,6 +169,14 @@ struct thermal_zone_device {
struct delayed_work poll_queue;
};
+/* Structure that holds thermal governor information */
+struct thermal_governor {
+ char name[THERMAL_NAME_LENGTH];
+ int (*throttle)(struct thermal_zone_device *tz, int trip);
+ struct list_head governor_list;
+ struct module *owner;
+};
+
/* Structure that holds binding parameters for a zone */
struct thermal_bind_params {
struct thermal_cooling_device *cdev;
@@ -189,6 +201,7 @@ struct thermal_bind_params {
/* Structure to define Thermal Zone parameters */
struct thermal_zone_params {
+ char governor_name[THERMAL_NAME_LENGTH];
int num_tbps; /* Number of tbp entries */
struct thermal_bind_params *tbp;
};
@@ -219,6 +232,9 @@ int get_tz_trend(struct thermal_zone_device *, int);
struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
struct thermal_cooling_device *, int);
+int thermal_register_governor(struct thermal_governor *);
+void thermal_unregister_governor(struct thermal_governor *);
+
#ifdef CONFIG_NET
extern int thermal_generate_netlink_event(u32 orig, enum events event);
#else