linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Darren Hart <dvhart@infradead.org>,
	Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
	ibm-acpi-devel@lists.sourceforge.net
Subject: [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12
Date: Sat, 10 Oct 2015 11:41:47 -0700	[thread overview]
Message-ID: <c6aa1c8ded9833fe62619d00f459ae438b1e2f9c.1444502507.git.dvhart@linux.intel.com> (raw)

From: Darren Hart <dvhart@infradead.org>

thinkpad_acpi reports "unhandled HKEY event 0x60c0" when switching
between laptop and tent/tablet mode on the ThinkPad Yoga 12. This key is
reported by atkbd serio0 as e058 and e059.

Add TP_HKEY_EV_SCREEN_FLIP to the list of ignored events and silence the
warning.

Cleanup whitespace on preceeding line for TP_HKEY_EV_KEY_FN_ESC.

Signed-off-by: Darren Hart <dvhart@infradead.org>
Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
Cc: ibm-acpi-devel@lists.sourceforge.net
---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 131dd74..d68143e 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -197,7 +197,8 @@ 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 */
+	TP_HKEY_EV_KEY_FN_ESC		= 0x6060, /* Fn+Esc key pressed X240 */
+	TP_HKEY_EV_SCREEN_FLIP		= 0x60c0, /* Screen flipped Yoga 12 */
 
 	/* Thermal events */
 	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
@@ -3849,7 +3850,9 @@ static bool hotkey_notify_6xxx(const u32 hkey,
 		 * unplugging AC adapter, docking or undocking. */
 
 		/* fallthrough */
-
+	case TP_HKEY_EV_SCREEN_FLIP:
+		/* Yoga 12: Screen toggled between laptop and tablet mode. */
+		/* fallthrough */
 	case TP_HKEY_EV_KEY_NUMLOCK:
 	case TP_HKEY_EV_KEY_FN:
 	case TP_HKEY_EV_KEY_FN_ESC:
-- 
2.1.4


             reply	other threads:[~2015-10-10 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10 18:41 Darren Hart [this message]
2015-10-10 18:45 ` [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12 Darren Hart
2015-10-10 21:40   ` Henrique de Moraes Holschuh
2015-10-10 21:46     ` Darren Hart
2015-10-11 11:57       ` Henrique de Moraes Holschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6aa1c8ded9833fe62619d00f459ae438b1e2f9c.1444502507.git.dvhart@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=dvhart@infradead.org \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ibm-acpi@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).