diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/Kconfig | 18 | ||||
-rw-r--r-- | drivers/misc/acer-wmi.c | 53 | ||||
-rw-r--r-- | drivers/misc/intel_menlow.c | 11 | ||||
-rw-r--r-- | drivers/misc/sony-laptop.c | 2 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 124 | ||||
-rw-r--r-- | drivers/misc/tifm_7xx1.c | 2 |
6 files changed, 173 insertions, 37 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 1abc95ca9dfa..962817e49fba 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -108,6 +108,7 @@ config ACER_WMI | |||
108 | depends on ACPI | 108 | depends on ACPI |
109 | depends on LEDS_CLASS | 109 | depends on LEDS_CLASS |
110 | depends on BACKLIGHT_CLASS_DEVICE | 110 | depends on BACKLIGHT_CLASS_DEVICE |
111 | depends on SERIO_I8042 | ||
111 | select ACPI_WMI | 112 | select ACPI_WMI |
112 | ---help--- | 113 | ---help--- |
113 | This is a driver for newer Acer (and Wistron) laptops. It adds | 114 | This is a driver for newer Acer (and Wistron) laptops. It adds |
@@ -258,6 +259,23 @@ config THINKPAD_ACPI_BAY | |||
258 | 259 | ||
259 | If you are not sure, say Y here. | 260 | If you are not sure, say Y here. |
260 | 261 | ||
262 | config THINKPAD_ACPI_VIDEO | ||
263 | bool "Video output control support" | ||
264 | depends on THINKPAD_ACPI | ||
265 | default y | ||
266 | ---help--- | ||
267 | Allows the thinkpad_acpi driver to provide an interface to control | ||
268 | the various video output ports. | ||
269 | |||
270 | This feature often won't work well, depending on ThinkPad model, | ||
271 | display state, video output devices in use, whether there is a X | ||
272 | server running, phase of the moon, and the current mood of | ||
273 | Schroedinger's cat. If you can use X.org's RandR to control | ||
274 | your ThinkPad's video output ports instead of this feature, | ||
275 | don't think twice: do it and say N here to save some memory. | ||
276 | |||
277 | If you are not sure, say Y here. | ||
278 | |||
261 | config THINKPAD_ACPI_HOTKEY_POLL | 279 | config THINKPAD_ACPI_HOTKEY_POLL |
262 | bool "Suport NVRAM polling for hot keys" | 280 | bool "Suport NVRAM polling for hot keys" |
263 | depends on THINKPAD_ACPI | 281 | depends on THINKPAD_ACPI |
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c index d7aea93081f2..dd13a3749927 100644 --- a/drivers/misc/acer-wmi.c +++ b/drivers/misc/acer-wmi.c | |||
@@ -219,6 +219,15 @@ static struct dmi_system_id acer_quirks[] = { | |||
219 | }, | 219 | }, |
220 | { | 220 | { |
221 | .callback = dmi_matched, | 221 | .callback = dmi_matched, |
222 | .ident = "Acer Aspire 3610", | ||
223 | .matches = { | ||
224 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
225 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3610"), | ||
226 | }, | ||
227 | .driver_data = &quirk_acer_travelmate_2490, | ||
228 | }, | ||
229 | { | ||
230 | .callback = dmi_matched, | ||
222 | .ident = "Acer Aspire 5100", | 231 | .ident = "Acer Aspire 5100", |
223 | .matches = { | 232 | .matches = { |
224 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 233 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
@@ -228,6 +237,15 @@ static struct dmi_system_id acer_quirks[] = { | |||
228 | }, | 237 | }, |
229 | { | 238 | { |
230 | .callback = dmi_matched, | 239 | .callback = dmi_matched, |
240 | .ident = "Acer Aspire 5610", | ||
241 | .matches = { | ||
242 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
243 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), | ||
244 | }, | ||
245 | .driver_data = &quirk_acer_travelmate_2490, | ||
246 | }, | ||
247 | { | ||
248 | .callback = dmi_matched, | ||
231 | .ident = "Acer Aspire 5630", | 249 | .ident = "Acer Aspire 5630", |
232 | .matches = { | 250 | .matches = { |
233 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 251 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
@@ -273,6 +291,15 @@ static struct dmi_system_id acer_quirks[] = { | |||
273 | }, | 291 | }, |
274 | { | 292 | { |
275 | .callback = dmi_matched, | 293 | .callback = dmi_matched, |
294 | .ident = "Acer TravelMate 4200", | ||
295 | .matches = { | ||
296 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
297 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4200"), | ||
298 | }, | ||
299 | .driver_data = &quirk_acer_travelmate_2490, | ||
300 | }, | ||
301 | { | ||
302 | .callback = dmi_matched, | ||
276 | .ident = "Medion MD 98300", | 303 | .ident = "Medion MD 98300", |
277 | .matches = { | 304 | .matches = { |
278 | DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), | 305 | DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), |
@@ -752,11 +779,11 @@ enum led_brightness value) | |||
752 | } | 779 | } |
753 | 780 | ||
754 | static struct led_classdev mail_led = { | 781 | static struct led_classdev mail_led = { |
755 | .name = "acer-mail:green", | 782 | .name = "acer-wmi::mail", |
756 | .brightness_set = mail_led_set, | 783 | .brightness_set = mail_led_set, |
757 | }; | 784 | }; |
758 | 785 | ||
759 | static int __init acer_led_init(struct device *dev) | 786 | static int __devinit acer_led_init(struct device *dev) |
760 | { | 787 | { |
761 | return led_classdev_register(dev, &mail_led); | 788 | return led_classdev_register(dev, &mail_led); |
762 | } | 789 | } |
@@ -789,7 +816,7 @@ static struct backlight_ops acer_bl_ops = { | |||
789 | .update_status = update_bl_status, | 816 | .update_status = update_bl_status, |
790 | }; | 817 | }; |
791 | 818 | ||
792 | static int __init acer_backlight_init(struct device *dev) | 819 | static int __devinit acer_backlight_init(struct device *dev) |
793 | { | 820 | { |
794 | struct backlight_device *bd; | 821 | struct backlight_device *bd; |
795 | 822 | ||
@@ -808,7 +835,7 @@ static int __init acer_backlight_init(struct device *dev) | |||
808 | return 0; | 835 | return 0; |
809 | } | 836 | } |
810 | 837 | ||
811 | static void __exit acer_backlight_exit(void) | 838 | static void acer_backlight_exit(void) |
812 | { | 839 | { |
813 | backlight_device_unregister(acer_backlight_device); | 840 | backlight_device_unregister(acer_backlight_device); |
814 | } | 841 | } |
@@ -1043,11 +1070,12 @@ static int __init acer_wmi_init(void) | |||
1043 | 1070 | ||
1044 | if (wmi_has_guid(WMID_GUID2) && interface) { | 1071 | if (wmi_has_guid(WMID_GUID2) && interface) { |
1045 | if (ACPI_FAILURE(WMID_set_capabilities())) { | 1072 | if (ACPI_FAILURE(WMID_set_capabilities())) { |
1046 | printk(ACER_ERR "Unable to detect available devices\n"); | 1073 | printk(ACER_ERR "Unable to detect available WMID " |
1074 | "devices\n"); | ||
1047 | return -ENODEV; | 1075 | return -ENODEV; |
1048 | } | 1076 | } |
1049 | } else if (!wmi_has_guid(WMID_GUID2) && interface) { | 1077 | } else if (!wmi_has_guid(WMID_GUID2) && interface) { |
1050 | printk(ACER_ERR "Unable to detect available devices\n"); | 1078 | printk(ACER_ERR "No WMID device detection method found\n"); |
1051 | return -ENODEV; | 1079 | return -ENODEV; |
1052 | } | 1080 | } |
1053 | 1081 | ||
@@ -1055,21 +1083,20 @@ static int __init acer_wmi_init(void) | |||
1055 | interface = &AMW0_interface; | 1083 | interface = &AMW0_interface; |
1056 | 1084 | ||
1057 | if (ACPI_FAILURE(AMW0_set_capabilities())) { | 1085 | if (ACPI_FAILURE(AMW0_set_capabilities())) { |
1058 | printk(ACER_ERR "Unable to detect available devices\n"); | 1086 | printk(ACER_ERR "Unable to detect available AMW0 " |
1087 | "devices\n"); | ||
1059 | return -ENODEV; | 1088 | return -ENODEV; |
1060 | } | 1089 | } |
1061 | } | 1090 | } |
1062 | 1091 | ||
1063 | if (wmi_has_guid(AMW0_GUID1)) { | 1092 | if (wmi_has_guid(AMW0_GUID1)) |
1064 | if (ACPI_FAILURE(AMW0_find_mailled())) | 1093 | AMW0_find_mailled(); |
1065 | printk(ACER_ERR "Unable to detect mail LED\n"); | ||
1066 | } | ||
1067 | 1094 | ||
1068 | find_quirks(); | 1095 | find_quirks(); |
1069 | 1096 | ||
1070 | if (!interface) { | 1097 | if (!interface) { |
1071 | printk(ACER_ERR "No or unsupported WMI interface, unable to "); | 1098 | printk(ACER_ERR "No or unsupported WMI interface, unable to " |
1072 | printk(KERN_CONT "load.\n"); | 1099 | "load\n"); |
1073 | return -ENODEV; | 1100 | return -ENODEV; |
1074 | } | 1101 | } |
1075 | 1102 | ||
diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c index f70984ab1e1b..de16e88eb8d3 100644 --- a/drivers/misc/intel_menlow.c +++ b/drivers/misc/intel_menlow.c | |||
@@ -170,10 +170,13 @@ static int intel_menlow_memory_add(struct acpi_device *device) | |||
170 | 170 | ||
171 | cdev = thermal_cooling_device_register("Memory controller", device, | 171 | cdev = thermal_cooling_device_register("Memory controller", device, |
172 | &memory_cooling_ops); | 172 | &memory_cooling_ops); |
173 | acpi_driver_data(device) = cdev; | 173 | if (IS_ERR(cdev)) { |
174 | if (!cdev) | 174 | result = PTR_ERR(cdev); |
175 | result = -ENODEV; | 175 | goto end; |
176 | else { | 176 | } |
177 | |||
178 | if (cdev) { | ||
179 | acpi_driver_data(device) = cdev; | ||
177 | result = sysfs_create_link(&device->dev.kobj, | 180 | result = sysfs_create_link(&device->dev.kobj, |
178 | &cdev->device.kobj, "thermal_cooling"); | 181 | &cdev->device.kobj, "thermal_cooling"); |
179 | if (result) | 182 | if (result) |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 899e3f75f288..02ff3d19b1cc 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -315,7 +315,7 @@ static void sony_laptop_report_input_event(u8 event) | |||
315 | break; | 315 | break; |
316 | 316 | ||
317 | default: | 317 | default: |
318 | if (event > ARRAY_SIZE(sony_laptop_input_index)) { | 318 | if (event >= ARRAY_SIZE(sony_laptop_input_index)) { |
319 | dprintk("sony_laptop_report_input_event, event not known: %d\n", event); | 319 | dprintk("sony_laptop_report_input_event, event not known: %d\n", event); |
320 | break; | 320 | break; |
321 | } | 321 | } |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index e2c7edd206a6..6cb781262f94 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -221,6 +221,7 @@ static struct { | |||
221 | u32 hotkey:1; | 221 | u32 hotkey:1; |
222 | u32 hotkey_mask:1; | 222 | u32 hotkey_mask:1; |
223 | u32 hotkey_wlsw:1; | 223 | u32 hotkey_wlsw:1; |
224 | u32 hotkey_tablet:1; | ||
224 | u32 light:1; | 225 | u32 light:1; |
225 | u32 light_status:1; | 226 | u32 light_status:1; |
226 | u32 bright_16levels:1; | 227 | u32 bright_16levels:1; |
@@ -301,6 +302,13 @@ TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */ | |||
301 | "HKEY", /* all others */ | 302 | "HKEY", /* all others */ |
302 | ); /* 570 */ | 303 | ); /* 570 */ |
303 | 304 | ||
305 | TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ | ||
306 | "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ | ||
307 | "\\_SB.PCI0.VID0", /* 770e */ | ||
308 | "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */ | ||
309 | "\\_SB.PCI0.AGP.VID", /* all others */ | ||
310 | ); /* R30, R31 */ | ||
311 | |||
304 | 312 | ||
305 | /************************************************************************* | 313 | /************************************************************************* |
306 | * ACPI helpers | 314 | * ACPI helpers |
@@ -1053,6 +1061,9 @@ static struct attribute_set *hotkey_dev_attributes; | |||
1053 | #define HOTKEY_CONFIG_CRITICAL_END | 1061 | #define HOTKEY_CONFIG_CRITICAL_END |
1054 | #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ | 1062 | #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ |
1055 | 1063 | ||
1064 | /* HKEY.MHKG() return bits */ | ||
1065 | #define TP_HOTKEY_TABLET_MASK (1 << 3) | ||
1066 | |||
1056 | static int hotkey_get_wlsw(int *status) | 1067 | static int hotkey_get_wlsw(int *status) |
1057 | { | 1068 | { |
1058 | if (!acpi_evalf(hkey_handle, status, "WLSW", "d")) | 1069 | if (!acpi_evalf(hkey_handle, status, "WLSW", "d")) |
@@ -1060,6 +1071,17 @@ static int hotkey_get_wlsw(int *status) | |||
1060 | return 0; | 1071 | return 0; |
1061 | } | 1072 | } |
1062 | 1073 | ||
1074 | static int hotkey_get_tablet_mode(int *status) | ||
1075 | { | ||
1076 | int s; | ||
1077 | |||
1078 | if (!acpi_evalf(hkey_handle, &s, "MHKG", "d")) | ||
1079 | return -EIO; | ||
1080 | |||
1081 | *status = ((s & TP_HOTKEY_TABLET_MASK) != 0); | ||
1082 | return 0; | ||
1083 | } | ||
1084 | |||
1063 | /* | 1085 | /* |
1064 | * Call with hotkey_mutex held | 1086 | * Call with hotkey_mutex held |
1065 | */ | 1087 | */ |
@@ -1154,15 +1176,31 @@ static void tpacpi_input_send_radiosw(void) | |||
1154 | { | 1176 | { |
1155 | int wlsw; | 1177 | int wlsw; |
1156 | 1178 | ||
1157 | mutex_lock(&tpacpi_inputdev_send_mutex); | ||
1158 | |||
1159 | if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { | 1179 | if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { |
1180 | mutex_lock(&tpacpi_inputdev_send_mutex); | ||
1181 | |||
1160 | input_report_switch(tpacpi_inputdev, | 1182 | input_report_switch(tpacpi_inputdev, |
1161 | SW_RADIO, !!wlsw); | 1183 | SW_RADIO, !!wlsw); |
1162 | input_sync(tpacpi_inputdev); | 1184 | input_sync(tpacpi_inputdev); |
1185 | |||
1186 | mutex_unlock(&tpacpi_inputdev_send_mutex); | ||
1163 | } | 1187 | } |
1188 | } | ||
1189 | |||
1190 | static void tpacpi_input_send_tabletsw(void) | ||
1191 | { | ||
1192 | int state; | ||
1193 | |||
1194 | if (tp_features.hotkey_tablet && | ||
1195 | !hotkey_get_tablet_mode(&state)) { | ||
1196 | mutex_lock(&tpacpi_inputdev_send_mutex); | ||
1164 | 1197 | ||
1165 | mutex_unlock(&tpacpi_inputdev_send_mutex); | 1198 | input_report_switch(tpacpi_inputdev, |
1199 | SW_TABLET_MODE, !!state); | ||
1200 | input_sync(tpacpi_inputdev); | ||
1201 | |||
1202 | mutex_unlock(&tpacpi_inputdev_send_mutex); | ||
1203 | } | ||
1166 | } | 1204 | } |
1167 | 1205 | ||
1168 | static void tpacpi_input_send_key(unsigned int scancode) | 1206 | static void tpacpi_input_send_key(unsigned int scancode) |
@@ -1417,6 +1455,14 @@ static void hotkey_poll_setup_safe(int may_warn) | |||
1417 | mutex_unlock(&hotkey_mutex); | 1455 | mutex_unlock(&hotkey_mutex); |
1418 | } | 1456 | } |
1419 | 1457 | ||
1458 | #else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ | ||
1459 | |||
1460 | static void hotkey_poll_setup_safe(int __unused) | ||
1461 | { | ||
1462 | } | ||
1463 | |||
1464 | #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ | ||
1465 | |||
1420 | static int hotkey_inputdev_open(struct input_dev *dev) | 1466 | static int hotkey_inputdev_open(struct input_dev *dev) |
1421 | { | 1467 | { |
1422 | switch (tpacpi_lifecycle) { | 1468 | switch (tpacpi_lifecycle) { |
@@ -1444,7 +1490,6 @@ static void hotkey_inputdev_close(struct input_dev *dev) | |||
1444 | if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING) | 1490 | if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING) |
1445 | hotkey_poll_setup_safe(0); | 1491 | hotkey_poll_setup_safe(0); |
1446 | } | 1492 | } |
1447 | #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ | ||
1448 | 1493 | ||
1449 | /* sysfs hotkey enable ------------------------------------------------- */ | 1494 | /* sysfs hotkey enable ------------------------------------------------- */ |
1450 | static ssize_t hotkey_enable_show(struct device *dev, | 1495 | static ssize_t hotkey_enable_show(struct device *dev, |
@@ -1666,6 +1711,29 @@ static void hotkey_radio_sw_notify_change(void) | |||
1666 | "hotkey_radio_sw"); | 1711 | "hotkey_radio_sw"); |
1667 | } | 1712 | } |
1668 | 1713 | ||
1714 | /* sysfs hotkey tablet mode (pollable) --------------------------------- */ | ||
1715 | static ssize_t hotkey_tablet_mode_show(struct device *dev, | ||
1716 | struct device_attribute *attr, | ||
1717 | char *buf) | ||
1718 | { | ||
1719 | int res, s; | ||
1720 | res = hotkey_get_tablet_mode(&s); | ||
1721 | if (res < 0) | ||
1722 | return res; | ||
1723 | |||
1724 | return snprintf(buf, PAGE_SIZE, "%d\n", !!s); | ||
1725 | } | ||
1726 | |||
1727 | static struct device_attribute dev_attr_hotkey_tablet_mode = | ||
1728 | __ATTR(hotkey_tablet_mode, S_IRUGO, hotkey_tablet_mode_show, NULL); | ||
1729 | |||
1730 | static void hotkey_tablet_mode_notify_change(void) | ||
1731 | { | ||
1732 | if (tp_features.hotkey_tablet) | ||
1733 | sysfs_notify(&tpacpi_pdev->dev.kobj, NULL, | ||
1734 | "hotkey_tablet_mode"); | ||
1735 | } | ||
1736 | |||
1669 | /* sysfs hotkey report_mode -------------------------------------------- */ | 1737 | /* sysfs hotkey report_mode -------------------------------------------- */ |
1670 | static ssize_t hotkey_report_mode_show(struct device *dev, | 1738 | static ssize_t hotkey_report_mode_show(struct device *dev, |
1671 | struct device_attribute *attr, | 1739 | struct device_attribute *attr, |
@@ -1878,7 +1946,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
1878 | str_supported(tp_features.hotkey)); | 1946 | str_supported(tp_features.hotkey)); |
1879 | 1947 | ||
1880 | if (tp_features.hotkey) { | 1948 | if (tp_features.hotkey) { |
1881 | hotkey_dev_attributes = create_attr_set(12, NULL); | 1949 | hotkey_dev_attributes = create_attr_set(13, NULL); |
1882 | if (!hotkey_dev_attributes) | 1950 | if (!hotkey_dev_attributes) |
1883 | return -ENOMEM; | 1951 | return -ENOMEM; |
1884 | res = add_many_to_attr_set(hotkey_dev_attributes, | 1952 | res = add_many_to_attr_set(hotkey_dev_attributes, |
@@ -1957,6 +2025,18 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
1957 | &dev_attr_hotkey_radio_sw.attr); | 2025 | &dev_attr_hotkey_radio_sw.attr); |
1958 | } | 2026 | } |
1959 | 2027 | ||
2028 | /* For X41t, X60t, X61t Tablets... */ | ||
2029 | if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) { | ||
2030 | tp_features.hotkey_tablet = 1; | ||
2031 | printk(TPACPI_INFO | ||
2032 | "possible tablet mode switch found; " | ||
2033 | "ThinkPad in %s mode\n", | ||
2034 | (status & TP_HOTKEY_TABLET_MASK)? | ||
2035 | "tablet" : "laptop"); | ||
2036 | res = add_to_attr_set(hotkey_dev_attributes, | ||
2037 | &dev_attr_hotkey_tablet_mode.attr); | ||
2038 | } | ||
2039 | |||
1960 | if (!res) | 2040 | if (!res) |
1961 | res = register_attr_set_with_sysfs( | 2041 | res = register_attr_set_with_sysfs( |
1962 | hotkey_dev_attributes, | 2042 | hotkey_dev_attributes, |
@@ -2006,6 +2086,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
2006 | set_bit(EV_SW, tpacpi_inputdev->evbit); | 2086 | set_bit(EV_SW, tpacpi_inputdev->evbit); |
2007 | set_bit(SW_RADIO, tpacpi_inputdev->swbit); | 2087 | set_bit(SW_RADIO, tpacpi_inputdev->swbit); |
2008 | } | 2088 | } |
2089 | if (tp_features.hotkey_tablet) { | ||
2090 | set_bit(EV_SW, tpacpi_inputdev->evbit); | ||
2091 | set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit); | ||
2092 | } | ||
2009 | 2093 | ||
2010 | dbg_printk(TPACPI_DBG_INIT, | 2094 | dbg_printk(TPACPI_DBG_INIT, |
2011 | "enabling hot key handling\n"); | 2095 | "enabling hot key handling\n"); |
@@ -2023,12 +2107,12 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
2023 | (hotkey_report_mode < 2) ? | 2107 | (hotkey_report_mode < 2) ? |
2024 | "enabled" : "disabled"); | 2108 | "enabled" : "disabled"); |
2025 | 2109 | ||
2026 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | ||
2027 | tpacpi_inputdev->open = &hotkey_inputdev_open; | 2110 | tpacpi_inputdev->open = &hotkey_inputdev_open; |
2028 | tpacpi_inputdev->close = &hotkey_inputdev_close; | 2111 | tpacpi_inputdev->close = &hotkey_inputdev_close; |
2029 | 2112 | ||
2030 | hotkey_poll_setup_safe(1); | 2113 | hotkey_poll_setup_safe(1); |
2031 | #endif | 2114 | tpacpi_input_send_radiosw(); |
2115 | tpacpi_input_send_tabletsw(); | ||
2032 | } | 2116 | } |
2033 | 2117 | ||
2034 | return (tp_features.hotkey)? 0 : 1; | 2118 | return (tp_features.hotkey)? 0 : 1; |
@@ -2156,11 +2240,15 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
2156 | /* 0x5000-0x5FFF: human interface helpers */ | 2240 | /* 0x5000-0x5FFF: human interface helpers */ |
2157 | switch (hkey) { | 2241 | switch (hkey) { |
2158 | case 0x5010: /* Lenovo new BIOS: brightness changed */ | 2242 | case 0x5010: /* Lenovo new BIOS: brightness changed */ |
2159 | case 0x5009: /* X61t: swivel up (tablet mode) */ | ||
2160 | case 0x500a: /* X61t: swivel down (normal mode) */ | ||
2161 | case 0x500b: /* X61t: tablet pen inserted into bay */ | 2243 | case 0x500b: /* X61t: tablet pen inserted into bay */ |
2162 | case 0x500c: /* X61t: tablet pen removed from bay */ | 2244 | case 0x500c: /* X61t: tablet pen removed from bay */ |
2163 | break; | 2245 | break; |
2246 | case 0x5009: /* X41t-X61t: swivel up (tablet mode) */ | ||
2247 | case 0x500a: /* X41t-X61t: swivel down (normal mode) */ | ||
2248 | tpacpi_input_send_tabletsw(); | ||
2249 | hotkey_tablet_mode_notify_change(); | ||
2250 | send_acpi_ev = 0; | ||
2251 | break; | ||
2164 | case 0x5001: | 2252 | case 0x5001: |
2165 | case 0x5002: | 2253 | case 0x5002: |
2166 | /* LID switch events. Do not propagate */ | 2254 | /* LID switch events. Do not propagate */ |
@@ -2219,11 +2307,10 @@ static void hotkey_resume(void) | |||
2219 | "from firmware\n"); | 2307 | "from firmware\n"); |
2220 | tpacpi_input_send_radiosw(); | 2308 | tpacpi_input_send_radiosw(); |
2221 | hotkey_radio_sw_notify_change(); | 2309 | hotkey_radio_sw_notify_change(); |
2310 | hotkey_tablet_mode_notify_change(); | ||
2222 | hotkey_wakeup_reason_notify_change(); | 2311 | hotkey_wakeup_reason_notify_change(); |
2223 | hotkey_wakeup_hotunplug_complete_notify_change(); | 2312 | hotkey_wakeup_hotunplug_complete_notify_change(); |
2224 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | ||
2225 | hotkey_poll_setup_safe(0); | 2313 | hotkey_poll_setup_safe(0); |
2226 | #endif | ||
2227 | } | 2314 | } |
2228 | 2315 | ||
2229 | /* procfs -------------------------------------------------------------- */ | 2316 | /* procfs -------------------------------------------------------------- */ |
@@ -2676,6 +2763,8 @@ static struct ibm_struct wan_driver_data = { | |||
2676 | * Video subdriver | 2763 | * Video subdriver |
2677 | */ | 2764 | */ |
2678 | 2765 | ||
2766 | #ifdef CONFIG_THINKPAD_ACPI_VIDEO | ||
2767 | |||
2679 | enum video_access_mode { | 2768 | enum video_access_mode { |
2680 | TPACPI_VIDEO_NONE = 0, | 2769 | TPACPI_VIDEO_NONE = 0, |
2681 | TPACPI_VIDEO_570, /* 570 */ | 2770 | TPACPI_VIDEO_570, /* 570 */ |
@@ -2703,13 +2792,6 @@ static int video_orig_autosw; | |||
2703 | static int video_autosw_get(void); | 2792 | static int video_autosw_get(void); |
2704 | static int video_autosw_set(int enable); | 2793 | static int video_autosw_set(int enable); |
2705 | 2794 | ||
2706 | TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ | ||
2707 | "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ | ||
2708 | "\\_SB.PCI0.VID0", /* 770e */ | ||
2709 | "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */ | ||
2710 | "\\_SB.PCI0.AGP.VID", /* all others */ | ||
2711 | ); /* R30, R31 */ | ||
2712 | |||
2713 | TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */ | 2795 | TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */ |
2714 | 2796 | ||
2715 | static int __init video_init(struct ibm_init_struct *iibm) | 2797 | static int __init video_init(struct ibm_init_struct *iibm) |
@@ -3019,6 +3101,8 @@ static struct ibm_struct video_driver_data = { | |||
3019 | .exit = video_exit, | 3101 | .exit = video_exit, |
3020 | }; | 3102 | }; |
3021 | 3103 | ||
3104 | #endif /* CONFIG_THINKPAD_ACPI_VIDEO */ | ||
3105 | |||
3022 | /************************************************************************* | 3106 | /************************************************************************* |
3023 | * Light (thinklight) subdriver | 3107 | * Light (thinklight) subdriver |
3024 | */ | 3108 | */ |
@@ -5803,10 +5887,12 @@ static struct ibm_init_struct ibms_init[] __initdata = { | |||
5803 | .init = wan_init, | 5887 | .init = wan_init, |
5804 | .data = &wan_driver_data, | 5888 | .data = &wan_driver_data, |
5805 | }, | 5889 | }, |
5890 | #ifdef CONFIG_THINKPAD_ACPI_VIDEO | ||
5806 | { | 5891 | { |
5807 | .init = video_init, | 5892 | .init = video_init, |
5808 | .data = &video_driver_data, | 5893 | .data = &video_driver_data, |
5809 | }, | 5894 | }, |
5895 | #endif | ||
5810 | { | 5896 | { |
5811 | .init = light_init, | 5897 | .init = light_init, |
5812 | .data = &light_driver_data, | 5898 | .data = &light_driver_data, |
@@ -5918,7 +6004,7 @@ MODULE_PARM_DESC(hotkey_report_mode, | |||
5918 | 6004 | ||
5919 | #define TPACPI_PARAM(feature) \ | 6005 | #define TPACPI_PARAM(feature) \ |
5920 | module_param_call(feature, set_ibm_param, NULL, NULL, 0); \ | 6006 | module_param_call(feature, set_ibm_param, NULL, NULL, 0); \ |
5921 | MODULE_PARM_DESC(feature, "Simulates thinkpad-aci procfs command " \ | 6007 | MODULE_PARM_DESC(feature, "Simulates thinkpad-acpi procfs command " \ |
5922 | "at module load, see documentation") | 6008 | "at module load, see documentation") |
5923 | 6009 | ||
5924 | TPACPI_PARAM(hotkey); | 6010 | TPACPI_PARAM(hotkey); |
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index 63a089b29545..67503ea71d21 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c | |||
@@ -368,6 +368,8 @@ static int tifm_7xx1_probe(struct pci_dev *dev, | |||
368 | goto err_out_irq; | 368 | goto err_out_irq; |
369 | 369 | ||
370 | writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SOCKMASK((1 << fm->num_sockets) - 1), | 370 | writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SOCKMASK((1 << fm->num_sockets) - 1), |
371 | fm->addr + FM_CLEAR_INTERRUPT_ENABLE); | ||
372 | writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SOCKMASK((1 << fm->num_sockets) - 1), | ||
371 | fm->addr + FM_SET_INTERRUPT_ENABLE); | 373 | fm->addr + FM_SET_INTERRUPT_ENABLE); |
372 | return 0; | 374 | return 0; |
373 | 375 | ||