diff options
author | Durgadoss R <dugardoss.r@intel.com> | 2012-07-24 22:10:58 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-07-24 23:17:20 -0400 |
commit | c56f5c0342dfee11a1a13d2f5bb7618de5b17590 (patch) | |
tree | 4f5bae9424271e41d10d0c9d9fc17be6f63fba63 /include/linux/thermal.h | |
parent | 28a33cbc24e4256c143dce96c7d93bf423229f92 (diff) |
Thermal: Make Thermal trip points writeable
Some of the thermal drivers using the Generic Thermal Framework
require (all/some) trip points to be writeable. This patch makes
the trip point temperatures writeable on a per-trip point basis,
and modifies the required function call in thermal.c. This patch
also updates the Documentation to reflect the new change.
Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 796f1ff0388c..6eaf9146c847 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -58,6 +58,8 @@ struct thermal_zone_device_ops { | |||
58 | enum thermal_trip_type *); | 58 | enum thermal_trip_type *); |
59 | int (*get_trip_temp) (struct thermal_zone_device *, int, | 59 | int (*get_trip_temp) (struct thermal_zone_device *, int, |
60 | unsigned long *); | 60 | unsigned long *); |
61 | int (*set_trip_temp) (struct thermal_zone_device *, int, | ||
62 | unsigned long); | ||
61 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); | 63 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); |
62 | int (*notify) (struct thermal_zone_device *, int, | 64 | int (*notify) (struct thermal_zone_device *, int, |
63 | enum thermal_trip_type); | 65 | enum thermal_trip_type); |
@@ -85,10 +87,17 @@ struct thermal_cooling_device { | |||
85 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) | 87 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) |
86 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) | 88 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) |
87 | 89 | ||
90 | struct thermal_attr { | ||
91 | struct device_attribute attr; | ||
92 | char name[THERMAL_NAME_LENGTH]; | ||
93 | }; | ||
94 | |||
88 | struct thermal_zone_device { | 95 | struct thermal_zone_device { |
89 | int id; | 96 | int id; |
90 | char type[THERMAL_NAME_LENGTH]; | 97 | char type[THERMAL_NAME_LENGTH]; |
91 | struct device device; | 98 | struct device device; |
99 | struct thermal_attr *trip_temp_attrs; | ||
100 | struct thermal_attr *trip_type_attrs; | ||
92 | void *devdata; | 101 | void *devdata; |
93 | int trips; | 102 | int trips; |
94 | int tc1; | 103 | int tc1; |
@@ -137,9 +146,9 @@ enum { | |||
137 | }; | 146 | }; |
138 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | 147 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) |
139 | 148 | ||
140 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, | 149 | struct thermal_zone_device *thermal_zone_device_register(char *, int, int, |
141 | const struct thermal_zone_device_ops *, int tc1, int tc2, | 150 | void *, const struct thermal_zone_device_ops *, int tc1, |
142 | int passive_freq, int polling_freq); | 151 | int tc2, int passive_freq, int polling_freq); |
143 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 152 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
144 | 153 | ||
145 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 154 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |