diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 77f6e707a2a9..cdcd2388af2b 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -194,6 +194,10 @@ enum tpacpi_hkey_event_t { | |||
194 | TP_HKEY_EV_PEN_REMOVED = 0x500c, /* tablet pen removed */ | 194 | TP_HKEY_EV_PEN_REMOVED = 0x500c, /* tablet pen removed */ |
195 | TP_HKEY_EV_BRGHT_CHANGED = 0x5010, /* backlight control event */ | 195 | TP_HKEY_EV_BRGHT_CHANGED = 0x5010, /* backlight control event */ |
196 | 196 | ||
197 | /* Key-related user-interface events */ | ||
198 | TP_HKEY_EV_KEY_NUMLOCK = 0x6000, /* NumLock key pressed */ | ||
199 | TP_HKEY_EV_KEY_FN = 0x6005, /* Fn key pressed? E420 */ | ||
200 | |||
197 | /* Thermal events */ | 201 | /* Thermal events */ |
198 | TP_HKEY_EV_ALARM_BAT_HOT = 0x6011, /* battery too hot */ | 202 | TP_HKEY_EV_ALARM_BAT_HOT = 0x6011, /* battery too hot */ |
199 | TP_HKEY_EV_ALARM_BAT_XHOT = 0x6012, /* battery critically hot */ | 203 | TP_HKEY_EV_ALARM_BAT_XHOT = 0x6012, /* battery critically hot */ |
@@ -201,6 +205,10 @@ enum tpacpi_hkey_event_t { | |||
201 | TP_HKEY_EV_ALARM_SENSOR_XHOT = 0x6022, /* sensor critically hot */ | 205 | TP_HKEY_EV_ALARM_SENSOR_XHOT = 0x6022, /* sensor critically hot */ |
202 | TP_HKEY_EV_THM_TABLE_CHANGED = 0x6030, /* thermal table changed */ | 206 | TP_HKEY_EV_THM_TABLE_CHANGED = 0x6030, /* thermal table changed */ |
203 | 207 | ||
208 | TP_HKEY_EV_UNK_6040 = 0x6040, /* Related to AC change? | ||
209 | some sort of APM hint, | ||
210 | W520 */ | ||
211 | |||
204 | /* Misc */ | 212 | /* Misc */ |
205 | TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */ | 213 | TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */ |
206 | }; | 214 | }; |
@@ -3547,13 +3555,13 @@ static bool hotkey_notify_usrevent(const u32 hkey, | |||
3547 | 3555 | ||
3548 | static void thermal_dump_all_sensors(void); | 3556 | static void thermal_dump_all_sensors(void); |
3549 | 3557 | ||
3550 | static bool hotkey_notify_thermal(const u32 hkey, | 3558 | static bool hotkey_notify_6xxx(const u32 hkey, |
3551 | bool *send_acpi_ev, | 3559 | bool *send_acpi_ev, |
3552 | bool *ignore_acpi_ev) | 3560 | bool *ignore_acpi_ev) |
3553 | { | 3561 | { |
3554 | bool known = true; | 3562 | bool known = true; |
3555 | 3563 | ||
3556 | /* 0x6000-0x6FFF: thermal alarms */ | 3564 | /* 0x6000-0x6FFF: thermal alarms/notices and keyboard events */ |
3557 | *send_acpi_ev = true; | 3565 | *send_acpi_ev = true; |
3558 | *ignore_acpi_ev = false; | 3566 | *ignore_acpi_ev = false; |
3559 | 3567 | ||
@@ -3582,8 +3590,17 @@ static bool hotkey_notify_thermal(const u32 hkey, | |||
3582 | "a sensor reports something is extremely hot!\n"); | 3590 | "a sensor reports something is extremely hot!\n"); |
3583 | /* recommended action: immediate sleep/hibernate */ | 3591 | /* recommended action: immediate sleep/hibernate */ |
3584 | break; | 3592 | break; |
3593 | |||
3594 | case TP_HKEY_EV_KEY_NUMLOCK: | ||
3595 | case TP_HKEY_EV_KEY_FN: | ||
3596 | /* key press events, we just ignore them as long as the EC | ||
3597 | * is still reporting them in the normal keyboard stream */ | ||
3598 | *send_acpi_ev = false; | ||
3599 | *ignore_acpi_ev = true; | ||
3600 | return true; | ||
3601 | |||
3585 | default: | 3602 | default: |
3586 | pr_alert("THERMAL ALERT: unknown thermal alarm received\n"); | 3603 | pr_warn("unknown possible thermal alarm or keyboard event received\n"); |
3587 | known = false; | 3604 | known = false; |
3588 | } | 3605 | } |
3589 | 3606 | ||
@@ -3668,8 +3685,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
3668 | &ignore_acpi_ev); | 3685 | &ignore_acpi_ev); |
3669 | break; | 3686 | break; |
3670 | case 6: | 3687 | case 6: |
3671 | /* 0x6000-0x6FFF: thermal alarms */ | 3688 | /* 0x6000-0x6FFF: thermal alarms/notices and |
3672 | known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev, | 3689 | * keyboard events */ |
3690 | known_ev = hotkey_notify_6xxx(hkey, &send_acpi_ev, | ||
3673 | &ignore_acpi_ev); | 3691 | &ignore_acpi_ev); |
3674 | break; | 3692 | break; |
3675 | case 7: | 3693 | case 7: |