Skip to contentSkip to conversation

thinkpad_acpi: unhandled hkey event

PATCH Superseded Xavier Naveira 2 participants 4 messages Jan 31, 2015 – Feb 10, 2015 x86 platform drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thinkpad_acpi: unhandled hkey event

Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates an unhandled hkey event

---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +7 -0
index c3d11fa..e61c43b 100644
@@ -196,6 +196,7 @@ enum tpacpi_hkey_event_t {
 	/* Key-related user-interface events */
 	TP_HKEY_EV_KEY_NUMLOCK		= 0x6000, /* NumLock key pressed */
 	TP_HKEY_EV_KEY_FN		= 0x6005, /* Fn key pressed? E420 */
+	TP_HKEY_EV_KEY_FN_ESC           = 0x6060, /* Fn+Esc key pressed X240 */
 
 	/* Thermal events */
 	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
@@ -3717,6 +3718,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
 		*send_acpi_ev = false;
 		*ignore_acpi_ev = true;
 		return true;
+	case TP_HKEY_EV_KEY_FN_ESC:
+		/* key press events, we just ignore them as long as the EC
+		 * is still reporting them in the normal keyboard stream */
+		*send_acpi_ev = false;
+		*ignore_acpi_ev = true;
+		return true;
 
 	default:
 		pr_warn("unknown possible thermal alarm or keyboard event received\n");
Signature · 1 line
2.1.0
#1 lore raw
Quoted 21 lines · Xavier Naveira

Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates an unhandled hkey event

---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +1 -0
index c3d11fa..e61c43b 100644
@@ -196,6 +196,7 @@ enum tpacpi_hkey_event_t {
 	/* Key-related user-interface events */
 	TP_HKEY_EV_KEY_NUMLOCK		= 0x6000, /* NumLock key pressed */
 	TP_HKEY_EV_KEY_FN		= 0x6005, /* Fn key pressed? E420 */
+	TP_HKEY_EV_KEY_FN_ESC           = 0x6060, /* Fn+Esc key pressed X240 */
 
 	/* Thermal events */
 	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */

drivers/platform/x86/thinkpad_acpi.c static bool hotkey_notify_6xxx(const u32 hkey, · line 3726

Quoted 9 lines
drivers/platform/x86/thinkpad_acpi.c +6 -0
@@ -3717,6 +3718,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
 		*send_acpi_ev = false;
 		*ignore_acpi_ev = true;
 		return true;
+	case TP_HKEY_EV_KEY_FN_ESC:
+		/* key press events, we just ignore them as long as the EC
+		 * is still reporting them in the normal keyboard stream */
+		*send_acpi_ev = false;
+		*ignore_acpi_ev = true;
+		return true;

No need to duplicate the logic here, just add TP_HKEY_EV_KEY_FN_ESC to the list of fallthrough keys (right after TP_HKEY_EV_KEY_FN).

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#2 lore raw
Quoted 19 lines · Darren Hart
Quoted 18 lines · Xavier Naveira

Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates an unhandled hkey event

---
  drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +1 -0
index c3d11fa..e61c43b 100644
@@ -196,6 +196,7 @@ enum tpacpi_hkey_event_t {
  	/* Key-related user-interface events */
  	TP_HKEY_EV_KEY_NUMLOCK		= 0x6000, /* NumLock key pressed */
  	TP_HKEY_EV_KEY_FN		= 0x6005, /* Fn key pressed? E420 */
+	TP_HKEY_EV_KEY_FN_ESC           = 0x6060, /* Fn+Esc key pressed X240 */
 
Quoted 16 lines

drivers/platform/x86/thinkpad_acpi.c static bool hotkey_notify_6xxx(const u32 hkey, · line 3726

Quoted 12 lines
drivers/platform/x86/thinkpad_acpi.c +6 -0
  	/* Thermal events */
  	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
@@ -3717,6 +3718,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
  		*send_acpi_ev = false;
  		*ignore_acpi_ev = true;
  		return true;
+	case TP_HKEY_EV_KEY_FN_ESC:
+		/* key press events, we just ignore them as long as the EC
+		 * is still reporting them in the normal keyboard stream */
+		*send_acpi_ev = false;
+		*ignore_acpi_ev = true;
+		return true;

No need to duplicate the logic here, just add TP_HKEY_EV_KEY_FN_ESC to the list of fallthrough keys (right after TP_HKEY_EV_KEY_FN).

I don't see the list that you are referring to?

#3 lore raw
Quoted 36 lines · Xavier Naveira
Quoted 19 lines · Darren Hart
Quoted 18 lines · Xavier Naveira

Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates an unhandled hkey event

---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +1 -0
index c3d11fa..e61c43b 100644
@@ -196,6 +196,7 @@ enum tpacpi_hkey_event_t {
 	/* Key-related user-interface events */
 	TP_HKEY_EV_KEY_NUMLOCK		= 0x6000, /* NumLock key pressed */
 	TP_HKEY_EV_KEY_FN		= 0x6005, /* Fn key pressed? E420 */
+	TP_HKEY_EV_KEY_FN_ESC           = 0x6060, /* Fn+Esc key pressed X240 */
 
Quoted 16 lines

drivers/platform/x86/thinkpad_acpi.c static bool hotkey_notify_6xxx(const u32 hkey, · line 3726

Quoted 12 lines
drivers/platform/x86/thinkpad_acpi.c +6 -0
 	/* Thermal events */
 	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
@@ -3717,6 +3718,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
 		*send_acpi_ev = false;
 		*ignore_acpi_ev = true;
 		return true;
+	case TP_HKEY_EV_KEY_FN_ESC:
+		/* key press events, we just ignore them as long as the EC
+		 * is still reporting them in the normal keyboard stream */
+		*send_acpi_ev = false;
+		*ignore_acpi_ev = true;
+		return true;

No need to duplicate the logic here, just add TP_HKEY_EV_KEY_FN_ESC to the list of fallthrough keys (right after TP_HKEY_EV_KEY_FN).

Quoted 1 line

I don't see the list that you are referring to?

Just before where you add the new case, there is:

		/* fallthrough */

	case TP_HKEY_EV_KEY_NUMLOCK:
	case TP_HKEY_EV_KEY_FN:
		/* key press events, we just ignore them as long as the EC
		 * is still reporting them in the normal keyboard stream */
		*send_acpi_ev = false;
		*ignore_acpi_ev = true;
		return true;

You should just be able to do:

case TP_HKEY_EV_KEY_FN:
+ case TP_HKEY_EV_KEY_FN_ESC:

Rather than duplicating the same logic below a new case block.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center