All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] support thinkpad HKEY interface version 0x200
@ 2014-03-11 12:24 Shuduo Sang
  2014-04-03 15:44 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
  0 siblings, 1 reply; 10+ messages in thread
From: Shuduo Sang @ 2014-03-11 12:24 UTC (permalink / raw)
  To: ibm-acpi, matthew.garrett, ibm-acpi-devel, paltform-driver-x86,
	linux-kernel
  Cc: bruce.ma

Hi,

Please kindly review following patch. It support new BIOS which shiped
with Thinkpad X1 Carbon 2nd generation. Without it, hotkey mask be
routed to wrong branch and some hot key will not work.

Thanks,
Shuduo

>From 3c67b2731a61539363a62284a43b98fa3e2ba784 Mon Sep 17 00:00:00 2001
From: Shuduo Sang <shuduo.sang@canonical.com>
Date: Tue, 11 Mar 2014 20:13:15 +0800
Subject: [PATCH] support HKEY interface version 0x200

Thinkpad X1 Carbon 2nd generation ships with new BIOS will return HKEY
interface version 0x200. It need thinkpad-acpi support otherwise it
will be routed to wrong branch and hotkey mask is wrong.

Signed-off-by: Bruce Ma <bruce.ma@canonical.com>
Signed-off-by: Shuduo Sang <shuduo.sang@canonical.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 39
+++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c
b/drivers/platform/x86/thinkpad_acpi.c
index defb6af..939fc81 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3244,11 +3244,8 @@ static int __init hotkey_init(struct
ibm_init_struct *iibm)
 	   A30, R30, R31, T20-22, X20-21, X22-24.  Detected by checking
 	   for HKEY interface version 0x100 */
 	if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
-		if ((hkeyv >> 8) != 1) {
-			pr_err("unknown version of the HKEY interface: 0x%x\n",
-			       hkeyv);
-			pr_err("please report this to %s\n", TPACPI_MAIL);
-		} else {
+		switch (hkeyv >> 8) {
+		case 1:
 			/*
 			 * MHKV 0x100 in A31, R40, R40e,
 			 * T4x, X31, and later
@@ -3261,13 +3258,41 @@ static int __init hotkey_init(struct
ibm_init_struct *iibm)
 			if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
 					"MHKA", "qd")) {
 				pr_err("missing MHKA handler, "
-				       "please report this to %s\n",
-				       TPACPI_MAIL);
+					"please report this to %s\n",
+					TPACPI_MAIL);
 				/* Fallback: pre-init for FN+F3,F4,F12 */
 				hotkey_all_mask = 0x080cU;
 			} else {
 				tp_features.hotkey_mask = 1;
 			}
+			break;
+
+		case 2:
+			/*
+			 * MHKV 0x200 in X1
+			 */
+			vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
+				"firmware HKEY interface version: 0x%x\n",
+				hkeyv);
+
+			/* Paranoia check AND init hotkey_all_mask */
+			if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
+					"MHKA", "dd", 1)) {
+				pr_err("missing MHKA handler, "
+					"please report this to %s\n",
+					TPACPI_MAIL);
+				/* Fallback: pre-init for FN+F3,F4,F12 */
+				hotkey_all_mask = 0x080cU;
+			} else {
+				tp_features.hotkey_mask = 1;
+			}
+			break;
+
+		default:
+			pr_err("unknown version of the HKEY interface: 0x%x\n",
+			       hkeyv);
+			pr_err("please report this to %s\n", TPACPI_MAIL);
+			break;
 		}
 	}

-- 
1.9.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-26 11:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 12:24 [PATCH] support thinkpad HKEY interface version 0x200 Shuduo Sang
2014-04-03 15:44 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
     [not found]   ` <20140403154427.GB32027-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2014-04-03 16:21     ` Shuduo Sang
2014-04-03 17:03       ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2014-04-11 13:10   ` Shuduo Sang
2014-04-11 13:43     ` Matthew Garrett
2014-04-11 13:55       ` Shuduo Sang
     [not found]         ` <CA+BAWBTb6Z1g-kNsyeAKAGjoUR1vXu3ZC33R+BO3+WH=64USoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-06 12:32           ` Shuduo Sang
     [not found]             ` <CA+BAWBQdGn54LO50Z0iB=X2D0r40Xp8+ryu1=GP7Kzv6PTU9bQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-26 11:10               ` Shuduo Sang
     [not found]         ` <CA+BAWBRa8H_9ANHjMC0sa6GLvuMMY2jcgXxO8Ovp94tD9Pv0vg@mail.gmail.com>
2014-05-26 11:17           ` [ibm-acpi-devel] " Shuduo Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.