diff options
author | Bharath Ramesh <bramesh@vt.edu> | 2009-01-29 17:25:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-29 21:04:45 -0500 |
commit | fb9f88e1dc76f9feb39d39c40a5d61aad6df4388 (patch) | |
tree | 997b366ef996bde434e7d838463219c9aedcec1c | |
parent | c189f4ec955e1fe4a2a2742d028aeecc52a5848a (diff) |
hwmon: applesmc: add support for MacPro 3 temperature sensors
MacPro 3 have more temperature sensors than the previous MacPro's also the
sensor THTG has been removed. This patch add supports for the newer
temperature sensors in the MacPro3.
Signed-off-by: Bharath Ramesh <bramesh@vt.edu>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/hwmon/applesmc.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index e30186236588..678e34b01e52 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -83,7 +83,7 @@ | |||
83 | /* | 83 | /* |
84 | * Temperature sensors keys (sp78 - 2 bytes). | 84 | * Temperature sensors keys (sp78 - 2 bytes). |
85 | */ | 85 | */ |
86 | static const char* temperature_sensors_sets[][36] = { | 86 | static const char *temperature_sensors_sets[][41] = { |
87 | /* Set 0: Macbook Pro */ | 87 | /* Set 0: Macbook Pro */ |
88 | { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H", | 88 | { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H", |
89 | "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL }, | 89 | "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL }, |
@@ -135,6 +135,13 @@ static const char* temperature_sensors_sets[][36] = { | |||
135 | { "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TC0D", "TN0D", "TTF0", | 135 | { "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TC0D", "TN0D", "TTF0", |
136 | "TV0P", "TVFP", "TW0P", "Th0P", "Tp0P", "Tp1P", "TpFP", "Ts0P", | 136 | "TV0P", "TVFP", "TW0P", "Th0P", "Tp0P", "Tp1P", "TpFP", "Ts0P", |
137 | "Ts0S", NULL }, | 137 | "Ts0S", NULL }, |
138 | /* Set 16: Mac Pro 3,1 (2 x Quad-Core) */ | ||
139 | { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P", | ||
140 | "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "TH0P", "TH1P", | ||
141 | "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", | ||
142 | "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S", | ||
143 | "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S", | ||
144 | NULL }, | ||
138 | }; | 145 | }; |
139 | 146 | ||
140 | /* List of keys used to read/write fan speeds */ | 147 | /* List of keys used to read/write fan speeds */ |
@@ -1153,6 +1160,16 @@ static SENSOR_DEVICE_ATTR(temp34_input, S_IRUGO, | |||
1153 | applesmc_show_temperature, NULL, 33); | 1160 | applesmc_show_temperature, NULL, 33); |
1154 | static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO, | 1161 | static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO, |
1155 | applesmc_show_temperature, NULL, 34); | 1162 | applesmc_show_temperature, NULL, 34); |
1163 | static SENSOR_DEVICE_ATTR(temp36_input, S_IRUGO, | ||
1164 | applesmc_show_temperature, NULL, 35); | ||
1165 | static SENSOR_DEVICE_ATTR(temp37_input, S_IRUGO, | ||
1166 | applesmc_show_temperature, NULL, 36); | ||
1167 | static SENSOR_DEVICE_ATTR(temp38_input, S_IRUGO, | ||
1168 | applesmc_show_temperature, NULL, 37); | ||
1169 | static SENSOR_DEVICE_ATTR(temp39_input, S_IRUGO, | ||
1170 | applesmc_show_temperature, NULL, 38); | ||
1171 | static SENSOR_DEVICE_ATTR(temp40_input, S_IRUGO, | ||
1172 | applesmc_show_temperature, NULL, 39); | ||
1156 | 1173 | ||
1157 | static struct attribute *temperature_attributes[] = { | 1174 | static struct attribute *temperature_attributes[] = { |
1158 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 1175 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
@@ -1190,6 +1207,11 @@ static struct attribute *temperature_attributes[] = { | |||
1190 | &sensor_dev_attr_temp33_input.dev_attr.attr, | 1207 | &sensor_dev_attr_temp33_input.dev_attr.attr, |
1191 | &sensor_dev_attr_temp34_input.dev_attr.attr, | 1208 | &sensor_dev_attr_temp34_input.dev_attr.attr, |
1192 | &sensor_dev_attr_temp35_input.dev_attr.attr, | 1209 | &sensor_dev_attr_temp35_input.dev_attr.attr, |
1210 | &sensor_dev_attr_temp36_input.dev_attr.attr, | ||
1211 | &sensor_dev_attr_temp37_input.dev_attr.attr, | ||
1212 | &sensor_dev_attr_temp38_input.dev_attr.attr, | ||
1213 | &sensor_dev_attr_temp39_input.dev_attr.attr, | ||
1214 | &sensor_dev_attr_temp40_input.dev_attr.attr, | ||
1193 | NULL | 1215 | NULL |
1194 | }; | 1216 | }; |
1195 | 1217 | ||
@@ -1312,6 +1334,8 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = { | |||
1312 | { .accelerometer = 0, .light = 0, .temperature_set = 14 }, | 1334 | { .accelerometer = 0, .light = 0, .temperature_set = 14 }, |
1313 | /* MacBook Air 2,1: accelerometer, backlight and temperature set 15 */ | 1335 | /* MacBook Air 2,1: accelerometer, backlight and temperature set 15 */ |
1314 | { .accelerometer = 1, .light = 1, .temperature_set = 15 }, | 1336 | { .accelerometer = 1, .light = 1, .temperature_set = 15 }, |
1337 | /* MacPro3,1: temperature set 16 */ | ||
1338 | { .accelerometer = 0, .light = 0, .temperature_set = 16 }, | ||
1315 | }; | 1339 | }; |
1316 | 1340 | ||
1317 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". | 1341 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". |
@@ -1369,6 +1393,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { | |||
1369 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), | 1393 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), |
1370 | DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, | 1394 | DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, |
1371 | &applesmc_dmi_data[4]}, | 1395 | &applesmc_dmi_data[4]}, |
1396 | { applesmc_dmi_match, "Apple MacPro3", { | ||
1397 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | ||
1398 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro3") }, | ||
1399 | &applesmc_dmi_data[16]}, | ||
1372 | { applesmc_dmi_match, "Apple MacPro", { | 1400 | { applesmc_dmi_match, "Apple MacPro", { |
1373 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1401 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1374 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, | 1402 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, |