aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index d0f2a5330096..18c9862dd932 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3830,13 +3830,28 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3830 3830
3831static void hotkey_suspend(void) 3831static void hotkey_suspend(void)
3832{ 3832{
3833 int hkeyv;
3834
3833 /* Do these on suspend, we get the events on early resume! */ 3835 /* Do these on suspend, we get the events on early resume! */
3834 hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE; 3836 hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE;
3835 hotkey_autosleep_ack = 0; 3837 hotkey_autosleep_ack = 0;
3838
3839 /* save previous mode of adaptive keyboard of X1 Carbon */
3840 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
3841 if ((hkeyv >> 8) == 2) {
3842 if (!acpi_evalf(hkey_handle,
3843 &adaptive_keyboard_prev_mode,
3844 "GTRW", "dd", 0)) {
3845 pr_err("Cannot read adaptive keyboard mode.\n");
3846 }
3847 }
3848 }
3836} 3849}
3837 3850
3838static void hotkey_resume(void) 3851static void hotkey_resume(void)
3839{ 3852{
3853 int hkeyv;
3854
3840 tpacpi_disable_brightness_delay(); 3855 tpacpi_disable_brightness_delay();
3841 3856
3842 if (hotkey_status_set(true) < 0 || 3857 if (hotkey_status_set(true) < 0 ||
@@ -3849,6 +3864,18 @@ static void hotkey_resume(void)
3849 hotkey_wakeup_reason_notify_change(); 3864 hotkey_wakeup_reason_notify_change();
3850 hotkey_wakeup_hotunplug_complete_notify_change(); 3865 hotkey_wakeup_hotunplug_complete_notify_change();
3851 hotkey_poll_setup_safe(false); 3866 hotkey_poll_setup_safe(false);
3867
3868 /* restore previous mode of adapive keyboard of X1 Carbon */
3869 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
3870 if ((hkeyv >> 8) == 2) {
3871 if (!acpi_evalf(hkey_handle,
3872 NULL,
3873 "STRW", "vd",
3874 adaptive_keyboard_prev_mode)) {
3875 pr_err("Cannot set adaptive keyboard mode.\n");
3876 }
3877 }
3878 }
3852} 3879}
3853 3880
3854/* procfs -------------------------------------------------------------- */ 3881/* procfs -------------------------------------------------------------- */