diff options
| -rw-r--r-- | Documentation/thermal/sysfs-api.txt | 4 | ||||
| -rw-r--r-- | drivers/acpi/thermal.c | 4 | ||||
| -rw-r--r-- | drivers/platform/x86/acerhdf.c | 2 | ||||
| -rw-r--r-- | drivers/platform/x86/intel_mid_thermal.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/spear_thermal.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/thermal_sys.c | 145 | ||||
| -rw-r--r-- | include/linux/thermal.h | 15 |
7 files changed, 121 insertions, 53 deletions
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt index 1733ab947a95..4c105934c599 100644 --- a/Documentation/thermal/sysfs-api.txt +++ b/Documentation/thermal/sysfs-api.txt | |||
| @@ -32,7 +32,8 @@ temperature) and throttle appropriate devices. | |||
| 32 | 32 | ||
| 33 | 1.1 thermal zone device interface | 33 | 1.1 thermal zone device interface |
| 34 | 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, | 34 | 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, |
| 35 | int trips, void *devdata, struct thermal_zone_device_ops *ops) | 35 | int trips, int mask, void *devdata, |
| 36 | struct thermal_zone_device_ops *ops) | ||
| 36 | 37 | ||
| 37 | This interface function adds a new thermal zone device (sensor) to | 38 | This interface function adds a new thermal zone device (sensor) to |
| 38 | /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the | 39 | /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the |
| @@ -40,6 +41,7 @@ temperature) and throttle appropriate devices. | |||
| 40 | 41 | ||
| 41 | name: the thermal zone name. | 42 | name: the thermal zone name. |
| 42 | trips: the total number of trip points this thermal zone supports. | 43 | trips: the total number of trip points this thermal zone supports. |
| 44 | mask: Bit string: If 'n'th bit is set, then trip point 'n' is writeable. | ||
| 43 | devdata: device private data | 45 | devdata: device private data |
| 44 | ops: thermal zone device call-backs. | 46 | ops: thermal zone device call-backs. |
| 45 | .bind: bind the thermal zone device with a thermal cooling device. | 47 | .bind: bind the thermal zone device with a thermal cooling device. |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 7dbebea1ec31..2107d1bb84af 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
| @@ -845,7 +845,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
| 845 | 845 | ||
| 846 | if (tz->trips.passive.flags.valid) | 846 | if (tz->trips.passive.flags.valid) |
| 847 | tz->thermal_zone = | 847 | tz->thermal_zone = |
| 848 | thermal_zone_device_register("acpitz", trips, tz, | 848 | thermal_zone_device_register("acpitz", trips, 0, tz, |
| 849 | &acpi_thermal_zone_ops, | 849 | &acpi_thermal_zone_ops, |
| 850 | tz->trips.passive.tc1, | 850 | tz->trips.passive.tc1, |
| 851 | tz->trips.passive.tc2, | 851 | tz->trips.passive.tc2, |
| @@ -853,7 +853,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
| 853 | tz->polling_frequency*100); | 853 | tz->polling_frequency*100); |
| 854 | else | 854 | else |
| 855 | tz->thermal_zone = | 855 | tz->thermal_zone = |
| 856 | thermal_zone_device_register("acpitz", trips, tz, | 856 | thermal_zone_device_register("acpitz", trips, 0, tz, |
| 857 | &acpi_thermal_zone_ops, | 857 | &acpi_thermal_zone_ops, |
| 858 | 0, 0, 0, | 858 | 0, 0, 0, |
| 859 | tz->polling_frequency*100); | 859 | tz->polling_frequency*100); |
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 2fd9d36acd15..39abb150bdd4 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c | |||
| @@ -660,7 +660,7 @@ static int acerhdf_register_thermal(void) | |||
| 660 | if (IS_ERR(cl_dev)) | 660 | if (IS_ERR(cl_dev)) |
| 661 | return -EINVAL; | 661 | return -EINVAL; |
| 662 | 662 | ||
| 663 | thz_dev = thermal_zone_device_register("acerhdf", 1, NULL, | 663 | thz_dev = thermal_zone_device_register("acerhdf", 1, 0, NULL, |
| 664 | &acerhdf_dev_ops, 0, 0, 0, | 664 | &acerhdf_dev_ops, 0, 0, 0, |
| 665 | (kernelmode) ? interval*1000 : 0); | 665 | (kernelmode) ? interval*1000 : 0); |
| 666 | if (IS_ERR(thz_dev)) | 666 | if (IS_ERR(thz_dev)) |
diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c index 5ae9cd9c7e6e..2b2c212ad37d 100644 --- a/drivers/platform/x86/intel_mid_thermal.c +++ b/drivers/platform/x86/intel_mid_thermal.c | |||
| @@ -499,7 +499,7 @@ static int mid_thermal_probe(struct platform_device *pdev) | |||
| 499 | goto err; | 499 | goto err; |
| 500 | } | 500 | } |
| 501 | pinfo->tzd[i] = thermal_zone_device_register(name[i], | 501 | pinfo->tzd[i] = thermal_zone_device_register(name[i], |
| 502 | 0, td_info, &tzd_ops, 0, 0, 0, 0); | 502 | 0, 0, td_info, &tzd_ops, 0, 0, 0, 0); |
| 503 | if (IS_ERR(pinfo->tzd[i])) { | 503 | if (IS_ERR(pinfo->tzd[i])) { |
| 504 | kfree(td_info); | 504 | kfree(td_info); |
| 505 | ret = PTR_ERR(pinfo->tzd[i]); | 505 | ret = PTR_ERR(pinfo->tzd[i]); |
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index c2e32df3b164..69a55d46aaa6 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c | |||
| @@ -147,7 +147,7 @@ static int spear_thermal_probe(struct platform_device *pdev) | |||
| 147 | stdev->flags = pdata->thermal_flags; | 147 | stdev->flags = pdata->thermal_flags; |
| 148 | writel_relaxed(stdev->flags, stdev->thermal_base); | 148 | writel_relaxed(stdev->flags, stdev->thermal_base); |
| 149 | 149 | ||
| 150 | spear_thermal = thermal_zone_device_register("spear_thermal", 0, | 150 | spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0, |
| 151 | stdev, &ops, 0, 0, 0, 0); | 151 | stdev, &ops, 0, 0, 0, 0); |
| 152 | if (IS_ERR(spear_thermal)) { | 152 | if (IS_ERR(spear_thermal)) { |
| 153 | dev_err(&pdev->dev, "thermal zone device is NULL\n"); | 153 | dev_err(&pdev->dev, "thermal zone device is NULL\n"); |
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 022bacb71a7e..5feb3353213f 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
| @@ -196,6 +196,28 @@ trip_point_type_show(struct device *dev, struct device_attribute *attr, | |||
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | static ssize_t | 198 | static ssize_t |
| 199 | trip_point_temp_store(struct device *dev, struct device_attribute *attr, | ||
| 200 | const char *buf, size_t count) | ||
| 201 | { | ||
| 202 | struct thermal_zone_device *tz = to_thermal_zone(dev); | ||
| 203 | int trip, ret; | ||
| 204 | unsigned long temperature; | ||
| 205 | |||
| 206 | if (!tz->ops->set_trip_temp) | ||
| 207 | return -EPERM; | ||
| 208 | |||
| 209 | if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip)) | ||
| 210 | return -EINVAL; | ||
| 211 | |||
| 212 | if (kstrtoul(buf, 10, &temperature)) | ||
| 213 | return -EINVAL; | ||
| 214 | |||
| 215 | ret = tz->ops->set_trip_temp(tz, trip, temperature); | ||
| 216 | |||
| 217 | return ret ? ret : count; | ||
| 218 | } | ||
| 219 | |||
| 220 | static ssize_t | ||
| 199 | trip_point_temp_show(struct device *dev, struct device_attribute *attr, | 221 | trip_point_temp_show(struct device *dev, struct device_attribute *attr, |
| 200 | char *buf) | 222 | char *buf) |
| 201 | { | 223 | { |
| @@ -283,33 +305,6 @@ static DEVICE_ATTR(temp, 0444, temp_show, NULL); | |||
| 283 | static DEVICE_ATTR(mode, 0644, mode_show, mode_store); | 305 | static DEVICE_ATTR(mode, 0644, mode_show, mode_store); |
| 284 | static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); | 306 | static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); |
| 285 | 307 | ||
| 286 | static struct device_attribute trip_point_attrs[] = { | ||
| 287 | __ATTR(trip_point_0_type, 0444, trip_point_type_show, NULL), | ||
| 288 | __ATTR(trip_point_0_temp, 0444, trip_point_temp_show, NULL), | ||
| 289 | __ATTR(trip_point_1_type, 0444, trip_point_type_show, NULL), | ||
| 290 | __ATTR(trip_point_1_temp, 0444, trip_point_temp_show, NULL), | ||
| 291 | __ATTR(trip_point_2_type, 0444, trip_point_type_show, NULL), | ||
| 292 | __ATTR(trip_point_2_temp, 0444, trip_point_temp_show, NULL), | ||
| 293 | __ATTR(trip_point_3_type, 0444, trip_point_type_show, NULL), | ||
| 294 | __ATTR(trip_point_3_temp, 0444, trip_point_temp_show, NULL), | ||
| 295 | __ATTR(trip_point_4_type, 0444, trip_point_type_show, NULL), | ||
| 296 | __ATTR(trip_point_4_temp, 0444, trip_point_temp_show, NULL), | ||
| 297 | __ATTR(trip_point_5_type, 0444, trip_point_type_show, NULL), | ||
| 298 | __ATTR(trip_point_5_temp, 0444, trip_point_temp_show, NULL), | ||
| 299 | __ATTR(trip_point_6_type, 0444, trip_point_type_show, NULL), | ||
| 300 | __ATTR(trip_point_6_temp, 0444, trip_point_temp_show, NULL), | ||
| 301 | __ATTR(trip_point_7_type, 0444, trip_point_type_show, NULL), | ||
| 302 | __ATTR(trip_point_7_temp, 0444, trip_point_temp_show, NULL), | ||
| 303 | __ATTR(trip_point_8_type, 0444, trip_point_type_show, NULL), | ||
| 304 | __ATTR(trip_point_8_temp, 0444, trip_point_temp_show, NULL), | ||
| 305 | __ATTR(trip_point_9_type, 0444, trip_point_type_show, NULL), | ||
| 306 | __ATTR(trip_point_9_temp, 0444, trip_point_temp_show, NULL), | ||
| 307 | __ATTR(trip_point_10_type, 0444, trip_point_type_show, NULL), | ||
| 308 | __ATTR(trip_point_10_temp, 0444, trip_point_temp_show, NULL), | ||
| 309 | __ATTR(trip_point_11_type, 0444, trip_point_type_show, NULL), | ||
| 310 | __ATTR(trip_point_11_temp, 0444, trip_point_temp_show, NULL), | ||
| 311 | }; | ||
| 312 | |||
| 313 | /* sys I/F for cooling device */ | 308 | /* sys I/F for cooling device */ |
| 314 | #define to_cooling_device(_dev) \ | 309 | #define to_cooling_device(_dev) \ |
| 315 | container_of(_dev, struct thermal_cooling_device, device) | 310 | container_of(_dev, struct thermal_cooling_device, device) |
| @@ -1089,9 +1084,81 @@ leave: | |||
| 1089 | EXPORT_SYMBOL(thermal_zone_device_update); | 1084 | EXPORT_SYMBOL(thermal_zone_device_update); |
| 1090 | 1085 | ||
| 1091 | /** | 1086 | /** |
| 1087 | * create_trip_attrs - create attributes for trip points | ||
| 1088 | * @tz: the thermal zone device | ||
| 1089 | * @mask: Writeable trip point bitmap. | ||
| 1090 | */ | ||
| 1091 | static int create_trip_attrs(struct thermal_zone_device *tz, int mask) | ||
| 1092 | { | ||
| 1093 | int indx; | ||
| 1094 | |||
| 1095 | tz->trip_type_attrs = | ||
| 1096 | kzalloc(sizeof(struct thermal_attr) * tz->trips, GFP_KERNEL); | ||
| 1097 | if (!tz->trip_type_attrs) | ||
| 1098 | return -ENOMEM; | ||
| 1099 | |||
| 1100 | tz->trip_temp_attrs = | ||
| 1101 | kzalloc(sizeof(struct thermal_attr) * tz->trips, GFP_KERNEL); | ||
| 1102 | if (!tz->trip_temp_attrs) { | ||
| 1103 | kfree(tz->trip_type_attrs); | ||
| 1104 | return -ENOMEM; | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | for (indx = 0; indx < tz->trips; indx++) { | ||
| 1108 | |||
| 1109 | /* create trip type attribute */ | ||
| 1110 | snprintf(tz->trip_type_attrs[indx].name, THERMAL_NAME_LENGTH, | ||
| 1111 | "trip_point_%d_type", indx); | ||
| 1112 | |||
| 1113 | sysfs_attr_init(&tz->trip_type_attrs[indx].attr.attr); | ||
| 1114 | tz->trip_type_attrs[indx].attr.attr.name = | ||
| 1115 | tz->trip_type_attrs[indx].name; | ||
| 1116 | tz->trip_type_attrs[indx].attr.attr.mode = S_IRUGO; | ||
| 1117 | tz->trip_type_attrs[indx].attr.show = trip_point_type_show; | ||
| 1118 | |||
| 1119 | device_create_file(&tz->device, | ||
| 1120 | &tz->trip_type_attrs[indx].attr); | ||
| 1121 | |||
| 1122 | /* create trip temp attribute */ | ||
| 1123 | snprintf(tz->trip_temp_attrs[indx].name, THERMAL_NAME_LENGTH, | ||
| 1124 | "trip_point_%d_temp", indx); | ||
| 1125 | |||
| 1126 | sysfs_attr_init(&tz->trip_temp_attrs[indx].attr.attr); | ||
| 1127 | tz->trip_temp_attrs[indx].attr.attr.name = | ||
| 1128 | tz->trip_temp_attrs[indx].name; | ||
| 1129 | tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO; | ||
| 1130 | tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show; | ||
| 1131 | if (mask & (1 << indx)) { | ||
| 1132 | tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR; | ||
| 1133 | tz->trip_temp_attrs[indx].attr.store = | ||
| 1134 | trip_point_temp_store; | ||
| 1135 | } | ||
| 1136 | |||
| 1137 | device_create_file(&tz->device, | ||
| 1138 | &tz->trip_temp_attrs[indx].attr); | ||
| 1139 | } | ||
| 1140 | return 0; | ||
| 1141 | } | ||
| 1142 | |||
| 1143 | static void remove_trip_attrs(struct thermal_zone_device *tz) | ||
| 1144 | { | ||
| 1145 | int indx; | ||
| 1146 | |||
| 1147 | for (indx = 0; indx < tz->trips; indx++) { | ||
| 1148 | device_remove_file(&tz->device, | ||
| 1149 | &tz->trip_type_attrs[indx].attr); | ||
| 1150 | device_remove_file(&tz->device, | ||
| 1151 | &tz->trip_temp_attrs[indx].attr); | ||
| 1152 | } | ||
| 1153 | kfree(tz->trip_type_attrs); | ||
| 1154 | kfree(tz->trip_temp_attrs); | ||
| 1155 | } | ||
| 1156 | |||
| 1157 | /** | ||
| 1092 | * thermal_zone_device_register - register a new thermal zone device | 1158 | * thermal_zone_device_register - register a new thermal zone device |
| 1093 | * @type: the thermal zone device type | 1159 | * @type: the thermal zone device type |
| 1094 | * @trips: the number of trip points the thermal zone support | 1160 | * @trips: the number of trip points the thermal zone support |
| 1161 | * @mask: a bit string indicating the writeablility of trip points | ||
| 1095 | * @devdata: private device data | 1162 | * @devdata: private device data |
| 1096 | * @ops: standard thermal zone device callbacks | 1163 | * @ops: standard thermal zone device callbacks |
| 1097 | * @tc1: thermal coefficient 1 for passive calculations | 1164 | * @tc1: thermal coefficient 1 for passive calculations |
| @@ -1107,7 +1174,7 @@ EXPORT_SYMBOL(thermal_zone_device_update); | |||
| 1107 | * section 11.1.5.1 of the ACPI specification 3.0. | 1174 | * section 11.1.5.1 of the ACPI specification 3.0. |
| 1108 | */ | 1175 | */ |
| 1109 | struct thermal_zone_device *thermal_zone_device_register(char *type, | 1176 | struct thermal_zone_device *thermal_zone_device_register(char *type, |
| 1110 | int trips, void *devdata, | 1177 | int trips, int mask, void *devdata, |
| 1111 | const struct thermal_zone_device_ops *ops, | 1178 | const struct thermal_zone_device_ops *ops, |
| 1112 | int tc1, int tc2, int passive_delay, int polling_delay) | 1179 | int tc1, int tc2, int passive_delay, int polling_delay) |
| 1113 | { | 1180 | { |
| @@ -1121,7 +1188,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, | |||
| 1121 | if (strlen(type) >= THERMAL_NAME_LENGTH) | 1188 | if (strlen(type) >= THERMAL_NAME_LENGTH) |
| 1122 | return ERR_PTR(-EINVAL); | 1189 | return ERR_PTR(-EINVAL); |
| 1123 | 1190 | ||
| 1124 | if (trips > THERMAL_MAX_TRIPS || trips < 0) | 1191 | if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips) |
| 1125 | return ERR_PTR(-EINVAL); | 1192 | return ERR_PTR(-EINVAL); |
| 1126 | 1193 | ||
| 1127 | if (!ops || !ops->get_temp) | 1194 | if (!ops || !ops->get_temp) |
| @@ -1175,15 +1242,11 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, | |||
| 1175 | goto unregister; | 1242 | goto unregister; |
| 1176 | } | 1243 | } |
| 1177 | 1244 | ||
| 1245 | result = create_trip_attrs(tz, mask); | ||
| 1246 | if (result) | ||
| 1247 | goto unregister; | ||
| 1248 | |||
| 1178 | for (count = 0; count < trips; count++) { | 1249 | for (count = 0; count < trips; count++) { |
| 1179 | result = device_create_file(&tz->device, | ||
| 1180 | &trip_point_attrs[count * 2]); | ||
| 1181 | if (result) | ||
| 1182 | break; | ||
| 1183 | result = device_create_file(&tz->device, | ||
| 1184 | &trip_point_attrs[count * 2 + 1]); | ||
| 1185 | if (result) | ||
| 1186 | goto unregister; | ||
| 1187 | tz->ops->get_trip_type(tz, count, &trip_type); | 1250 | tz->ops->get_trip_type(tz, count, &trip_type); |
| 1188 | if (trip_type == THERMAL_TRIP_PASSIVE) | 1251 | if (trip_type == THERMAL_TRIP_PASSIVE) |
| 1189 | passive = 1; | 1252 | passive = 1; |
| @@ -1232,7 +1295,6 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
| 1232 | { | 1295 | { |
| 1233 | struct thermal_cooling_device *cdev; | 1296 | struct thermal_cooling_device *cdev; |
| 1234 | struct thermal_zone_device *pos = NULL; | 1297 | struct thermal_zone_device *pos = NULL; |
| 1235 | int count; | ||
| 1236 | 1298 | ||
| 1237 | if (!tz) | 1299 | if (!tz) |
| 1238 | return; | 1300 | return; |
| @@ -1259,13 +1321,8 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
| 1259 | device_remove_file(&tz->device, &dev_attr_temp); | 1321 | device_remove_file(&tz->device, &dev_attr_temp); |
| 1260 | if (tz->ops->get_mode) | 1322 | if (tz->ops->get_mode) |
| 1261 | device_remove_file(&tz->device, &dev_attr_mode); | 1323 | device_remove_file(&tz->device, &dev_attr_mode); |
| 1324 | remove_trip_attrs(tz); | ||
| 1262 | 1325 | ||
| 1263 | for (count = 0; count < tz->trips; count++) { | ||
| 1264 | device_remove_file(&tz->device, | ||
| 1265 | &trip_point_attrs[count * 2]); | ||
| 1266 | device_remove_file(&tz->device, | ||
| 1267 | &trip_point_attrs[count * 2 + 1]); | ||
| 1268 | } | ||
| 1269 | thermal_remove_hwmon_sysfs(tz); | 1326 | thermal_remove_hwmon_sysfs(tz); |
| 1270 | release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); | 1327 | release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); |
| 1271 | idr_destroy(&tz->idr); | 1328 | idr_destroy(&tz->idr); |
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, |
