Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (applesmc) sensors set for MacBook2

On my mid-2007 MacBook2, reading Ts0P sensor always failed with this message:
applesmc: wait status failed: 5 != 50.

So I assume that there's no such Ts0p sensor in this model (please confirm,
anyone). If there's the case, then we need a new set of sensors defined for
MacBook2.

Signed-off-by: Riki Oktarianto <rkoktarianto@gmail.com>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Riki Oktarianto and committed by
Mark M. Hoffman
cd19ba13 5910a9b2

+19 -10
+19 -10
drivers/hwmon/applesmc.c
··· 84 84 /* Set 0: Macbook Pro */ 85 85 { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H", 86 86 "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL }, 87 - /* Set 1: Macbook set */ 87 + /* Set 1: Macbook2 set */ 88 + { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "TTF0", "Th0H", 89 + "Th0S", "Th1H", NULL }, 90 + /* Set 2: Macbook set */ 88 91 { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "Th0H", "Th0S", 89 92 "Th1H", "Ts0P", NULL }, 90 - /* Set 2: Macmini set */ 93 + /* Set 3: Macmini set */ 91 94 { "TC0D", "TC0P", NULL }, 92 - /* Set 3: Mac Pro (2 x Quad-Core) */ 95 + /* Set 4: Mac Pro (2 x Quad-Core) */ 93 96 { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P", 94 97 "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "THTG", "TH0P", 95 98 "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", ··· 1215 1212 static __initdata struct dmi_match_data applesmc_dmi_data[] = { 1216 1213 /* MacBook Pro: accelerometer, backlight and temperature set 0 */ 1217 1214 { .accelerometer = 1, .light = 1, .temperature_set = 0 }, 1218 - /* MacBook: accelerometer and temperature set 1 */ 1215 + /* MacBook2: accelerometer and temperature set 1 */ 1219 1216 { .accelerometer = 1, .light = 0, .temperature_set = 1 }, 1220 - /* MacMini: temperature set 2 */ 1221 - { .accelerometer = 0, .light = 0, .temperature_set = 2 }, 1222 - /* MacPro: temperature set 3 */ 1217 + /* MacBook: accelerometer and temperature set 2 */ 1218 + { .accelerometer = 1, .light = 0, .temperature_set = 2 }, 1219 + /* MacMini: temperature set 3 */ 1223 1220 { .accelerometer = 0, .light = 0, .temperature_set = 3 }, 1221 + /* MacPro: temperature set 4 */ 1222 + { .accelerometer = 0, .light = 0, .temperature_set = 4 }, 1224 1223 }; 1225 1224 1226 1225 /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". ··· 1234 1229 (void*)&applesmc_dmi_data[0]}, 1235 1230 { applesmc_dmi_match, "Apple MacBook", { 1236 1231 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), 1237 - DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") }, 1232 + DMI_MATCH(DMI_PRODUCT_NAME,"MacBook2") }, 1238 1233 (void*)&applesmc_dmi_data[1]}, 1234 + { applesmc_dmi_match, "Apple MacBook", { 1235 + DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), 1236 + DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") }, 1237 + (void*)&applesmc_dmi_data[2]}, 1239 1238 { applesmc_dmi_match, "Apple Macmini", { 1240 1239 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), 1241 1240 DMI_MATCH(DMI_PRODUCT_NAME,"Macmini") }, 1242 - (void*)&applesmc_dmi_data[2]}, 1241 + (void*)&applesmc_dmi_data[3]}, 1243 1242 { applesmc_dmi_match, "Apple MacPro2", { 1244 1243 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), 1245 1244 DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, 1246 - (void*)&applesmc_dmi_data[3]}, 1245 + (void*)&applesmc_dmi_data[4]}, 1247 1246 { .ident = NULL } 1248 1247 }; 1249 1248