thinkpad_acpi: fix for adaptive keyboard state after suspend/resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, 

I have been experiencing an issue with the Lenovo Carbon X1 Gen 2 - 
after resuming from suspend-to-RAM, the adaptive keyboard bar was 
completely off and did not respond to any touch.

Thanks to Shuduo San's patches for supporting the Lenovo adaptive
keyboard, I was inspired to device a fix. Seems that simply calling 
the ACPI function to set the state of the adaptive keyboard after 
resume takes from it off state.

This fix is not perfect because it does not remember the last mode
used. But it makes it useful enough for me (one can't work without
the function keys...). I hope you integrate this anyway into your 
proposed changes.

Signed-off-by: Dan Aloni <dan@xxxxxxxxxxxx>
---
 drivers/platform/x86/thinkpad_acpi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 866b42a..13a10ba 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3880,6 +3880,12 @@ static void hotkey_resume(void)
 	hotkey_wakeup_reason_notify_change();
 	hotkey_wakeup_hotunplug_complete_notify_change();
 	hotkey_poll_setup_safe(false);
+
+	if (hkey_handle) {
+		/* Re-awake the the adaptive keyboard if it exists */
+		acpi_evalf(hkey_handle,
+			   NULL, "STRW", "vd", FUNCTION_MODE);
+	}
 }
 
 /* procfs -------------------------------------------------------------- */
-- 
1.8.5.3


-- 
Dan Aloni

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel




[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux