diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 03:20:56 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 03:20:56 -0400 |
| commit | 53279f36dccffc26ff536003fd6bb97cc21c3b82 (patch) | |
| tree | 9d16e497c0e4158c7c054c479bd0e9ff0388d7bb /include/linux/thermal.h | |
| parent | a6e8c0a25377e27958b11b20e1927885ae7c9857 (diff) | |
| parent | 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff) | |
Merge tag 'v3.7-rc3' into next to sync up with recent USB and MFD changes
Diffstat (limited to 'include/linux/thermal.h')
| -rw-r--r-- | include/linux/thermal.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 4b94a61955df..91b34812cd84 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -44,6 +44,12 @@ enum thermal_trip_type { | |||
| 44 | THERMAL_TRIP_CRITICAL, | 44 | THERMAL_TRIP_CRITICAL, |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | enum thermal_trend { | ||
| 48 | THERMAL_TREND_STABLE, /* temperature is stable */ | ||
| 49 | THERMAL_TREND_RAISING, /* temperature is raising */ | ||
| 50 | THERMAL_TREND_DROPPING, /* temperature is dropping */ | ||
| 51 | }; | ||
| 52 | |||
| 47 | struct thermal_zone_device_ops { | 53 | struct thermal_zone_device_ops { |
| 48 | int (*bind) (struct thermal_zone_device *, | 54 | int (*bind) (struct thermal_zone_device *, |
| 49 | struct thermal_cooling_device *); | 55 | struct thermal_cooling_device *); |
| @@ -65,6 +71,8 @@ struct thermal_zone_device_ops { | |||
| 65 | int (*set_trip_hyst) (struct thermal_zone_device *, int, | 71 | int (*set_trip_hyst) (struct thermal_zone_device *, int, |
| 66 | unsigned long); | 72 | unsigned long); |
| 67 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); | 73 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); |
| 74 | int (*get_trend) (struct thermal_zone_device *, int, | ||
| 75 | enum thermal_trend *); | ||
| 68 | int (*notify) (struct thermal_zone_device *, int, | 76 | int (*notify) (struct thermal_zone_device *, int, |
| 69 | enum thermal_trip_type); | 77 | enum thermal_trip_type); |
| 70 | }; | 78 | }; |
| @@ -75,6 +83,8 @@ struct thermal_cooling_device_ops { | |||
| 75 | int (*set_cur_state) (struct thermal_cooling_device *, unsigned long); | 83 | int (*set_cur_state) (struct thermal_cooling_device *, unsigned long); |
| 76 | }; | 84 | }; |
| 77 | 85 | ||
| 86 | #define THERMAL_NO_LIMIT -1UL /* no upper/lower limit requirement */ | ||
| 87 | |||
| 78 | #define THERMAL_TRIPS_NONE -1 | 88 | #define THERMAL_TRIPS_NONE -1 |
| 79 | #define THERMAL_MAX_TRIPS 12 | 89 | #define THERMAL_MAX_TRIPS 12 |
| 80 | #define THERMAL_NAME_LENGTH 20 | 90 | #define THERMAL_NAME_LENGTH 20 |
| @@ -84,6 +94,9 @@ struct thermal_cooling_device { | |||
| 84 | struct device device; | 94 | struct device device; |
| 85 | void *devdata; | 95 | void *devdata; |
| 86 | const struct thermal_cooling_device_ops *ops; | 96 | const struct thermal_cooling_device_ops *ops; |
| 97 | bool updated; /* true if the cooling device does not need update */ | ||
| 98 | struct mutex lock; /* protect thermal_instances list */ | ||
| 99 | struct list_head thermal_instances; | ||
| 87 | struct list_head node; | 100 | struct list_head node; |
| 88 | }; | 101 | }; |
| 89 | 102 | ||
| @@ -105,17 +118,16 @@ struct thermal_zone_device { | |||
| 105 | struct thermal_attr *trip_hyst_attrs; | 118 | struct thermal_attr *trip_hyst_attrs; |
| 106 | void *devdata; | 119 | void *devdata; |
| 107 | int trips; | 120 | int trips; |
| 108 | int tc1; | ||
| 109 | int tc2; | ||
| 110 | int passive_delay; | 121 | int passive_delay; |
| 111 | int polling_delay; | 122 | int polling_delay; |
| 123 | int temperature; | ||
| 112 | int last_temperature; | 124 | int last_temperature; |
| 113 | bool passive; | 125 | int passive; |
| 114 | unsigned int forced_passive; | 126 | unsigned int forced_passive; |
| 115 | const struct thermal_zone_device_ops *ops; | 127 | const struct thermal_zone_device_ops *ops; |
| 116 | struct list_head cooling_devices; | 128 | struct list_head thermal_instances; |
| 117 | struct idr idr; | 129 | struct idr idr; |
| 118 | struct mutex lock; /* protect cooling devices list */ | 130 | struct mutex lock; /* protect thermal_instances list */ |
| 119 | struct list_head node; | 131 | struct list_head node; |
| 120 | struct delayed_work poll_queue; | 132 | struct delayed_work poll_queue; |
| 121 | }; | 133 | }; |
| @@ -152,12 +164,12 @@ enum { | |||
| 152 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | 164 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) |
| 153 | 165 | ||
| 154 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, | 166 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, |
| 155 | void *, const struct thermal_zone_device_ops *, int tc1, | 167 | void *, const struct thermal_zone_device_ops *, int, int); |
| 156 | int tc2, int passive_freq, int polling_freq); | ||
| 157 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 168 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
| 158 | 169 | ||
| 159 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 170 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |
| 160 | struct thermal_cooling_device *); | 171 | struct thermal_cooling_device *, |
| 172 | unsigned long, unsigned long); | ||
| 161 | int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | 173 | int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, |
| 162 | struct thermal_cooling_device *); | 174 | struct thermal_cooling_device *); |
| 163 | void thermal_zone_device_update(struct thermal_zone_device *); | 175 | void thermal_zone_device_update(struct thermal_zone_device *); |
