aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorDurgadoss R <durgadoss.r@intel.com>2012-09-18 01:34:57 -0400
committerZhang Rui <rui.zhang@intel.com>2012-11-05 01:00:05 -0500
commita4a15485fbba44d162d626141b9a7404e790f570 (patch)
tree1fdff11c9a771b879238f03eafec080fa193edf7 /include/linux/thermal.h
parent50125a9b27dd09e9afdc1b8712ba0b3859886c68 (diff)
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 @@
46#define THERMAL_GENL_VERSION 0x01 46#define THERMAL_GENL_VERSION 0x01
47#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" 47#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group"
48 48
49/* Default Thermal Governor: Does Linear Throttling */
50#define DEFAULT_THERMAL_GOVERNOR "step_wise"
51
49struct thermal_zone_device; 52struct thermal_zone_device;
50struct thermal_cooling_device; 53struct thermal_cooling_device;
51 54
@@ -158,6 +161,7 @@ struct thermal_zone_device {
158 unsigned int forced_passive; 161 unsigned int forced_passive;
159 const struct thermal_zone_device_ops *ops; 162 const struct thermal_zone_device_ops *ops;
160 const struct thermal_zone_params *tzp; 163 const struct thermal_zone_params *tzp;
164 struct thermal_governor *governor;
161 struct list_head thermal_instances; 165 struct list_head thermal_instances;
162 struct idr idr; 166 struct idr idr;
163 struct mutex lock; /* protect thermal_instances list */ 167 struct mutex lock; /* protect thermal_instances list */
@@ -165,6 +169,14 @@ struct thermal_zone_device {
165 struct delayed_work poll_queue; 169 struct delayed_work poll_queue;
166}; 170};
167 171
172/* Structure that holds thermal governor information */
173struct thermal_governor {
174 char name[THERMAL_NAME_LENGTH];
175 int (*throttle)(struct thermal_zone_device *tz, int trip);
176 struct list_head governor_list;
177 struct module *owner;
178};
179
168/* Structure that holds binding parameters for a zone */ 180/* Structure that holds binding parameters for a zone */
169struct thermal_bind_params { 181struct thermal_bind_params {
170 struct thermal_cooling_device *cdev; 182 struct thermal_cooling_device *cdev;
@@ -189,6 +201,7 @@ struct thermal_bind_params {
189 201
190/* Structure to define Thermal Zone parameters */ 202/* Structure to define Thermal Zone parameters */
191struct thermal_zone_params { 203struct thermal_zone_params {
204 char governor_name[THERMAL_NAME_LENGTH];
192 int num_tbps; /* Number of tbp entries */ 205 int num_tbps; /* Number of tbp entries */
193 struct thermal_bind_params *tbp; 206 struct thermal_bind_params *tbp;
194}; 207};
@@ -219,6 +232,9 @@ int get_tz_trend(struct thermal_zone_device *, int);
219struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, 232struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
220 struct thermal_cooling_device *, int); 233 struct thermal_cooling_device *, int);
221 234
235int thermal_register_governor(struct thermal_governor *);
236void thermal_unregister_governor(struct thermal_governor *);
237
222#ifdef CONFIG_NET 238#ifdef CONFIG_NET
223extern int thermal_generate_netlink_event(u32 orig, enum events event); 239extern int thermal_generate_netlink_event(u32 orig, enum events event);
224#else 240#else