diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-03-08 19:30:55 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-03-08 19:30:55 -0400 |
commit | d15c22e78674f9a5bc0de0932a43abe1aafae303 (patch) | |
tree | 3e4198c44bd2d9184e91647346c66aa95e28f843 /drivers/hwmon/applesmc.c | |
parent | 0f4954819fb6f840d46076f0dbd313ef5da48f5d (diff) | |
parent | fec6c6fec3e20637bee5d276fb61dd8b49a3f9cc (diff) |
Merge commit 'v2.6.29-rc7' into next
Diffstat (limited to 'drivers/hwmon/applesmc.c')
-rw-r--r-- | drivers/hwmon/applesmc.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index dca47a591baf..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 */ |
@@ -590,6 +597,11 @@ static ssize_t applesmc_light_show(struct device *dev, | |||
590 | } | 597 | } |
591 | 598 | ||
592 | ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length); | 599 | ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length); |
600 | /* newer macbooks report a single 10-bit bigendian value */ | ||
601 | if (data_length == 10) { | ||
602 | left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2; | ||
603 | goto out; | ||
604 | } | ||
593 | left = buffer[2]; | 605 | left = buffer[2]; |
594 | if (ret) | 606 | if (ret) |
595 | goto out; | 607 | goto out; |
@@ -1148,6 +1160,16 @@ static SENSOR_DEVICE_ATTR(temp34_input, S_IRUGO, | |||
1148 | applesmc_show_temperature, NULL, 33); | 1160 | applesmc_show_temperature, NULL, 33); |
1149 | static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO, | 1161 | static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO, |
1150 | 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); | ||
1151 | 1173 | ||
1152 | static struct attribute *temperature_attributes[] = { | 1174 | static struct attribute *temperature_attributes[] = { |
1153 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 1175 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
@@ -1185,6 +1207,11 @@ static struct attribute *temperature_attributes[] = { | |||
1185 | &sensor_dev_attr_temp33_input.dev_attr.attr, | 1207 | &sensor_dev_attr_temp33_input.dev_attr.attr, |
1186 | &sensor_dev_attr_temp34_input.dev_attr.attr, | 1208 | &sensor_dev_attr_temp34_input.dev_attr.attr, |
1187 | &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, | ||
1188 | NULL | 1215 | NULL |
1189 | }; | 1216 | }; |
1190 | 1217 | ||
@@ -1307,6 +1334,8 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = { | |||
1307 | { .accelerometer = 0, .light = 0, .temperature_set = 14 }, | 1334 | { .accelerometer = 0, .light = 0, .temperature_set = 14 }, |
1308 | /* MacBook Air 2,1: accelerometer, backlight and temperature set 15 */ | 1335 | /* MacBook Air 2,1: accelerometer, backlight and temperature set 15 */ |
1309 | { .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 }, | ||
1310 | }; | 1339 | }; |
1311 | 1340 | ||
1312 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". | 1341 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". |
@@ -1364,6 +1393,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { | |||
1364 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), | 1393 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), |
1365 | DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, | 1394 | DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, |
1366 | &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]}, | ||
1367 | { applesmc_dmi_match, "Apple MacPro", { | 1400 | { applesmc_dmi_match, "Apple MacPro", { |
1368 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1401 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1369 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, | 1402 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, |