linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell-wmi: Ignore new rfkill and fn-lock events
@ 2018-04-19  7:24 Kai-Heng Feng
  2018-04-19  7:46 ` Pali Rohár
  0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2018-04-19  7:24 UTC (permalink / raw)
  To: mjg59, pali.rohar, dvhart, andy, mario.limonciello
  Cc: platform-driver-x86, linux-kernel, Kai-Heng Feng

There are two new events generated by dell-wmi, rfkill and fn-lock, from
Dell Systems.

These events are for notification purpose, so we can ignore them.

Tested on XPS 9370.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
I ordered them functionally instead of alphabetically, I can re-order
them to alphabetically if that's more diserable.

 drivers/platform/x86/dell-wmi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 8d102195a392..51d2845d2ad9 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -266,6 +266,13 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {
 
 	/* Fn-lock */
 	{ KE_IGNORE, 0x151, { KEY_RESERVED } },
+	{ KE_IGNORE, 0xe035, { KEY_RESERVED } },
+
+	/* Fn-lock switched to function keys */
+	{ KE_IGNORE, 0x0000, { KEY_RESERVED } },
+
+	/* Fn-lock switched to multimedia keys */
+	{ KE_IGNORE, 0x0001, { KEY_RESERVED } },
 
 	/* Change keyboard illumination */
 	{ KE_IGNORE, 0x152, { KEY_KBDILLUMTOGGLE } },
@@ -275,6 +282,7 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {
 	 * WMI event is supposed to trigger an action).
 	 */
 	{ KE_IGNORE, 0x153, { KEY_RFKILL } },
+	{ KE_IGNORE, 0xe008, { KEY_RFKILL } },
 
 	/* RGB keyboard backlight control */
 	{ KE_IGNORE, 0x154, { KEY_RESERVED } },
-- 
2.17.0

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

* Re: [PATCH] platform/x86: dell-wmi: Ignore new rfkill and fn-lock events
  2018-04-19  7:24 [PATCH] platform/x86: dell-wmi: Ignore new rfkill and fn-lock events Kai-Heng Feng
@ 2018-04-19  7:46 ` Pali Rohár
  2018-04-19  8:09   ` Kai Heng Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Pali Rohár @ 2018-04-19  7:46 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: mjg59, dvhart, andy, mario.limonciello, platform-driver-x86,
	linux-kernel

On Thursday 19 April 2018 15:24:49 Kai-Heng Feng wrote:
> There are two new events generated by dell-wmi, rfkill and fn-lock, from
> Dell Systems.
> 
> These events are for notification purpose, so we can ignore them.
> 
> Tested on XPS 9370.
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> I ordered them functionally instead of alphabetically, I can re-order
> them to alphabetically if that's more diserable.

Please order them by event code like they were prior your change.

>  drivers/platform/x86/dell-wmi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 8d102195a392..51d2845d2ad9 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -266,6 +266,13 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {
>  
>  	/* Fn-lock */
>  	{ KE_IGNORE, 0x151, { KEY_RESERVED } },
> +	{ KE_IGNORE, 0xe035, { KEY_RESERVED } },
> +
> +	/* Fn-lock switched to function keys */
> +	{ KE_IGNORE, 0x0000, { KEY_RESERVED } },
> +
> +	/* Fn-lock switched to multimedia keys */
> +	{ KE_IGNORE, 0x0001, { KEY_RESERVED } },

Are you sure that all those codes are not defined in 0xB2 DMI hotkey
table? Also is Fn-lock key reported by PS/2 AT Keyboard controller so it
is needed to ignored it by WMI?

>  	/* Change keyboard illumination */
>  	{ KE_IGNORE, 0x152, { KEY_KBDILLUMTOGGLE } },
> @@ -275,6 +282,7 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {
>  	 * WMI event is supposed to trigger an action).
>  	 */
>  	{ KE_IGNORE, 0x153, { KEY_RFKILL } },
> +	{ KE_IGNORE, 0xe008, { KEY_RFKILL } },
>  
>  	/* RGB keyboard backlight control */
>  	{ KE_IGNORE, 0x154, { KEY_RESERVED } },

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH] platform/x86: dell-wmi: Ignore new rfkill and fn-lock events
  2018-04-19  7:46 ` Pali Rohár
@ 2018-04-19  8:09   ` Kai Heng Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Heng Feng @ 2018-04-19  8:09 UTC (permalink / raw)
  To: Pali Rohár
  Cc: mjg59, dvhart, andy, Mario Limonciello, platform-driver-x86,
	linux-kernel


> On Apr 19, 2018, at 3:46 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
>
> On Thursday 19 April 2018 15:24:49 Kai-Heng Feng wrote:
>> There are two new events generated by dell-wmi, rfkill and fn-lock, from
>> Dell Systems.
>>
>> These events are for notification purpose, so we can ignore them.
>>
>> Tested on XPS 9370.
>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>> I ordered them functionally instead of alphabetically, I can re-order
>> them to alphabetically if that's more diserable.
>
> Please order them by event code like they were prior your change.

Sure. Will do.

>
>> drivers/platform/x86/dell-wmi.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/platform/x86/dell-wmi.c  
>> b/drivers/platform/x86/dell-wmi.c
>> index 8d102195a392..51d2845d2ad9 100644
>> --- a/drivers/platform/x86/dell-wmi.c
>> +++ b/drivers/platform/x86/dell-wmi.c
>> @@ -266,6 +266,13 @@ static const struct key_entry  
>> dell_wmi_keymap_type_0010[] = {
>>
>>  	/* Fn-lock */
>>  	{ KE_IGNORE, 0x151, { KEY_RESERVED } },
>> +	{ KE_IGNORE, 0xe035, { KEY_RESERVED } },
>> +
>> +	/* Fn-lock switched to function keys */
>> +	{ KE_IGNORE, 0x0000, { KEY_RESERVED } },
>> +
>> +	/* Fn-lock switched to multimedia keys */
>> +	{ KE_IGNORE, 0x0001, { KEY_RESERVED } },
>
> Are you sure that all those codes are not defined in 0xB2 DMI hotkey
> table? Also is Fn-lock key reported by PS/2 AT Keyboard controller so it
> is needed to ignored it by WMI?

I don't think so, because I can see these messages:
[ 4307.325389] dell_wmi: Unknown key with type 0x0010 and code 0xe035 pressed
[ 4307.325393] dell_wmi: Unknown key with type 0x0010 and code 0x0000 pressed
[ 4310.007794] dell_wmi: Unknown key with type 0x0010 and code 0xe035 pressed
[ 4310.007796] dell_wmi: Unknown key with type 0x0010 and code 0x0001 pressed

 From what I can observe in Fn-lock case, it's controlled by keyboard  
controller.
Ignoring these event doesn't affect its function.

>
>> /* Change keyboard illumination */
>>  	{ KE_IGNORE, 0x152, { KEY_KBDILLUMTOGGLE } },
>> @@ -275,6 +282,7 @@ static const struct key_entry  
>> dell_wmi_keymap_type_0010[] = {
>>  	 * WMI event is supposed to trigger an action).
>>  	 */
>>  	{ KE_IGNORE, 0x153, { KEY_RFKILL } },
>> +	{ KE_IGNORE, 0xe008, { KEY_RFKILL } },
>>
>>  	/* RGB keyboard backlight control */
>>  	{ KE_IGNORE, 0x154, { KEY_RESERVED } },
>
> -- 
> Pali Rohár
> pali.rohar@gmail.com

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

end of thread, other threads:[~2018-04-19  8:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19  7:24 [PATCH] platform/x86: dell-wmi: Ignore new rfkill and fn-lock events Kai-Heng Feng
2018-04-19  7:46 ` Pali Rohár
2018-04-19  8:09   ` Kai Heng Feng

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