diff options
-rw-r--r-- | Documentation/laptops/thinkpad-acpi.txt | 4 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 22 |
2 files changed, 22 insertions, 4 deletions
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 33d6e5afcca6..0ae5708ea0ad 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -491,6 +491,8 @@ generate input device EV_KEY events. | |||
491 | Non hot-key ACPI HKEY event map: | 491 | Non hot-key ACPI HKEY event map: |
492 | 0x5001 Lid closed | 492 | 0x5001 Lid closed |
493 | 0x5002 Lid opened | 493 | 0x5002 Lid opened |
494 | 0x5009 Tablet swivel: switched to tablet mode | ||
495 | 0x500A Tablet swivel: switched to normal mode | ||
494 | 0x7000 Radio Switch may have changed state | 496 | 0x7000 Radio Switch may have changed state |
495 | 497 | ||
496 | The above events are not propagated by the driver, except for legacy | 498 | The above events are not propagated by the driver, except for legacy |
@@ -505,8 +507,6 @@ The above events are never propagated by the driver. | |||
505 | 507 | ||
506 | 0x3003 Bay ejection (see 0x2x05) complete, can sleep again | 508 | 0x3003 Bay ejection (see 0x2x05) complete, can sleep again |
507 | 0x4003 Undocked (see 0x2x04), can sleep again | 509 | 0x4003 Undocked (see 0x2x04), can sleep again |
508 | 0x5009 Tablet swivel: switched to tablet mode | ||
509 | 0x500A Tablet swivel: switched to normal mode | ||
510 | 0x500B Tablet pen insterted into its storage bay | 510 | 0x500B Tablet pen insterted into its storage bay |
511 | 0x500C Tablet pen removed from its storage bay | 511 | 0x500C Tablet pen removed from its storage bay |
512 | 0x5010 Brightness level changed (newer Lenovo BIOSes) | 512 | 0x5010 Brightness level changed (newer Lenovo BIOSes) |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 4ea3866ddf90..35483502a117 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -1172,6 +1172,17 @@ static void tpacpi_input_send_radiosw(void) | |||
1172 | mutex_unlock(&tpacpi_inputdev_send_mutex); | 1172 | mutex_unlock(&tpacpi_inputdev_send_mutex); |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | static void tpacpi_input_send_tabletsw(unsigned int state) | ||
1176 | { | ||
1177 | mutex_lock(&tpacpi_inputdev_send_mutex); | ||
1178 | |||
1179 | input_report_switch(tpacpi_inputdev, | ||
1180 | SW_TABLET_MODE, !!state); | ||
1181 | input_sync(tpacpi_inputdev); | ||
1182 | |||
1183 | mutex_unlock(&tpacpi_inputdev_send_mutex); | ||
1184 | } | ||
1185 | |||
1175 | static void tpacpi_input_send_key(unsigned int scancode) | 1186 | static void tpacpi_input_send_key(unsigned int scancode) |
1176 | { | 1187 | { |
1177 | unsigned int keycode; | 1188 | unsigned int keycode; |
@@ -2020,6 +2031,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
2020 | set_bit(EV_SW, tpacpi_inputdev->evbit); | 2031 | set_bit(EV_SW, tpacpi_inputdev->evbit); |
2021 | set_bit(SW_RADIO, tpacpi_inputdev->swbit); | 2032 | set_bit(SW_RADIO, tpacpi_inputdev->swbit); |
2022 | } | 2033 | } |
2034 | if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) { | ||
2035 | set_bit(EV_SW, tpacpi_inputdev->evbit); | ||
2036 | set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit); | ||
2037 | } | ||
2023 | 2038 | ||
2024 | dbg_printk(TPACPI_DBG_INIT, | 2039 | dbg_printk(TPACPI_DBG_INIT, |
2025 | "enabling hot key handling\n"); | 2040 | "enabling hot key handling\n"); |
@@ -2169,11 +2184,14 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
2169 | /* 0x5000-0x5FFF: human interface helpers */ | 2184 | /* 0x5000-0x5FFF: human interface helpers */ |
2170 | switch (hkey) { | 2185 | switch (hkey) { |
2171 | case 0x5010: /* Lenovo new BIOS: brightness changed */ | 2186 | case 0x5010: /* Lenovo new BIOS: brightness changed */ |
2172 | case 0x5009: /* X61t: swivel up (tablet mode) */ | ||
2173 | case 0x500a: /* X61t: swivel down (normal mode) */ | ||
2174 | case 0x500b: /* X61t: tablet pen inserted into bay */ | 2187 | case 0x500b: /* X61t: tablet pen inserted into bay */ |
2175 | case 0x500c: /* X61t: tablet pen removed from bay */ | 2188 | case 0x500c: /* X61t: tablet pen removed from bay */ |
2176 | break; | 2189 | break; |
2190 | case 0x5009: /* X61t: swivel up (tablet mode) */ | ||
2191 | case 0x500a: /* X61t: swivel down (normal mode) */ | ||
2192 | tpacpi_input_send_tabletsw((hkey == 0x5009)); | ||
2193 | send_acpi_ev = 0; | ||
2194 | break; | ||
2177 | case 0x5001: | 2195 | case 0x5001: |
2178 | case 0x5002: | 2196 | case 0x5002: |
2179 | /* LID switch events. Do not propagate */ | 2197 | /* LID switch events. Do not propagate */ |