linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12
@ 2015-10-10 18:41 Darren Hart
  2015-10-10 18:45 ` Darren Hart
  0 siblings, 1 reply; 5+ messages in thread
From: Darren Hart @ 2015-10-10 18:41 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Darren Hart, Henrique de Moraes Holschuh, ibm-acpi-devel

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


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

* Re: [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12
  2015-10-10 18:41 [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12 Darren Hart
@ 2015-10-10 18:45 ` Darren Hart
  2015-10-10 21:40   ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 5+ messages in thread
From: Darren Hart @ 2015-10-10 18:45 UTC (permalink / raw)
  To: Darren Hart
  Cc: Linux Kernel Mailing List, Henrique de Moraes Holschuh,
	ibm-acpi-devel, platform-driver-x86

On Sat, Oct 10, 2015 at 11:41:47AM -0700, Darren Hart wrote:
> 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

And Cc pdx86... oi. That's embarassing.

> ---
>  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
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12
  2015-10-10 18:45 ` Darren Hart
@ 2015-10-10 21:40   ` Henrique de Moraes Holschuh
  2015-10-10 21:46     ` Darren Hart
  0 siblings, 1 reply; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2015-10-10 21:40 UTC (permalink / raw)
  To: Darren Hart
  Cc: Linux Kernel Mailing List, Henrique de Moraes Holschuh,
	ibm-acpi-devel, platform-driver-x86

On Sat, 10 Oct 2015, Darren Hart wrote:
> On Sat, Oct 10, 2015 at 11:41:47AM -0700, Darren Hart wrote:
> > 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

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Darren Hart @ 2015-10-10 21:46 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Linux Kernel Mailing List, Henrique de Moraes Holschuh,
	ibm-acpi-devel, platform-driver-x86

On Sat, Oct 10, 2015 at 06:40:34PM -0300, Henrique de Moraes Holschuh wrote:
> On Sat, 10 Oct 2015, Darren Hart wrote:
> > On Sat, Oct 10, 2015 at 11:41:47AM -0700, Darren Hart wrote:
> > > 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
> 
> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

Thanks Henrique,

Now, as I'm digging into this I'm finding maybe there is more to this. Should I
be attempting to tie this in to the tablet switch mechanism for the older x61t?

Or is this something we now want to strictly hand off to a userspace helper via
the atkbd event?

-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12
  2015-10-10 21:46     ` Darren Hart
@ 2015-10-11 11:57       ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2015-10-11 11:57 UTC (permalink / raw)
  To: Darren Hart
  Cc: Linux Kernel Mailing List, Henrique de Moraes Holschuh,
	ibm-acpi-devel, platform-driver-x86

On Sat, 10 Oct 2015, Darren Hart wrote:
> On Sat, Oct 10, 2015 at 06:40:34PM -0300, Henrique de Moraes Holschuh wrote:
> > On Sat, 10 Oct 2015, Darren Hart wrote:
> > > On Sat, Oct 10, 2015 at 11:41:47AM -0700, Darren Hart wrote:
> > > > 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
> > 
> > Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> 
> Thanks Henrique,
> 
> Now, as I'm digging into this I'm finding maybe there is more to this. Should I
> be attempting to tie this in to the tablet switch mechanism for the older x61t?

I think so, provided that you can read the current mode from somewhere.  And
it is likelt to be exported by the EC somehow, since atkbd gets two separate
keycodes...

> Or is this something we now want to strictly hand off to a userspace helper via
> the atkbd event?

It depends on the existence of said userspace helper, I suppose.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

end of thread, other threads:[~2015-10-11 11:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-10 18:41 [PATCH] thinkpad_acpi: Add TP_HKEY_EV_SCREEN_FLIP (0x60c0) for Lenovo ThinkPad Yoga 12 Darren Hart
2015-10-10 18:45 ` 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

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).