public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thinkpad_acpi: unhandled hkey event
@ 2015-01-31 18:52 Xavier Naveira
  2015-02-07  4:22 ` Darren Hart
  0 siblings, 1 reply; 4+ messages in thread
From: Xavier Naveira @ 2015-01-31 18:52 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh, Darren Hart
  Cc: ibm-acpi-devel, platform-driver-x86, linux-kernel, Xavier Naveira

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

Signed-off-by: Xavier Naveira <xnaveira@gmail.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index c3d11fa..e61c43b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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");
-- 
2.1.0


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

* Re: [PATCH] thinkpad_acpi: unhandled hkey event
  2015-01-31 18:52 [PATCH] thinkpad_acpi: unhandled hkey event Xavier Naveira
@ 2015-02-07  4:22 ` Darren Hart
  2015-02-09 19:44   ` Xavier Naveira
  0 siblings, 1 reply; 4+ messages in thread
From: Darren Hart @ 2015-02-07  4:22 UTC (permalink / raw)
  To: Xavier Naveira
  Cc: Henrique de Moraes Holschuh, ibm-acpi-devel, platform-driver-x86,
	linux-kernel

On Sat, Jan 31, 2015 at 07:52:03PM +0100, Xavier Naveira wrote:
> Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
> an unhandled hkey event
> 
> Signed-off-by: Xavier Naveira <xnaveira@gmail.com>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index c3d11fa..e61c43b 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -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;

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

-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH] thinkpad_acpi: unhandled hkey event
  2015-02-07  4:22 ` Darren Hart
@ 2015-02-09 19:44   ` Xavier Naveira
  2015-02-10  3:48     ` Darren Hart
  0 siblings, 1 reply; 4+ messages in thread
From: Xavier Naveira @ 2015-02-09 19:44 UTC (permalink / raw)
  To: Darren Hart
  Cc: Henrique de Moraes Holschuh, ibm-acpi-devel, platform-driver-x86,
	linux-kernel

On 2015-02-07 05:22, Darren Hart wrote:
> On Sat, Jan 31, 2015 at 07:52:03PM +0100, Xavier Naveira wrote:
>> Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
>> an unhandled hkey event
>>
>> Signed-off-by: Xavier Naveira <xnaveira@gmail.com>
>> ---
>>   drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
>> index c3d11fa..e61c43b 100644
>> --- a/drivers/platform/x86/thinkpad_acpi.c
>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>> @@ -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;
>
> 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?

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

* Re: [PATCH] thinkpad_acpi: unhandled hkey event
  2015-02-09 19:44   ` Xavier Naveira
@ 2015-02-10  3:48     ` Darren Hart
  0 siblings, 0 replies; 4+ messages in thread
From: Darren Hart @ 2015-02-10  3:48 UTC (permalink / raw)
  To: Xavier Naveira
  Cc: Henrique de Moraes Holschuh, ibm-acpi-devel, platform-driver-x86,
	linux-kernel

On Mon, Feb 09, 2015 at 08:44:26PM +0100, Xavier Naveira wrote:
> On 2015-02-07 05:22, Darren Hart wrote:
> >On Sat, Jan 31, 2015 at 07:52:03PM +0100, Xavier Naveira wrote:
> >>Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
> >>an unhandled hkey event
> >>
> >>Signed-off-by: Xavier Naveira <xnaveira@gmail.com>
> >>---
> >>  drivers/platform/x86/thinkpad_acpi.c | 7 +++++++
> >>  1 file changed, 7 insertions(+)
> >>
> >>diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> >>index c3d11fa..e61c43b 100644
> >>--- a/drivers/platform/x86/thinkpad_acpi.c
> >>+++ b/drivers/platform/x86/thinkpad_acpi.c
> >>@@ -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;
> >
> >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?

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.

-- 
Darren Hart
Intel Open Source Technology Center

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

end of thread, other threads:[~2015-02-10  3:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-31 18:52 [PATCH] thinkpad_acpi: unhandled hkey event Xavier Naveira
2015-02-07  4:22 ` Darren Hart
2015-02-09 19:44   ` Xavier Naveira
2015-02-10  3:48     ` Darren Hart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox