All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events
@ 2020-05-13 13:05 Hans de Goede
  2020-05-13 17:29   ` Mario.Limonciello
  2020-05-19 17:51 ` Pali Rohár
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2020-05-13 13:05 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko, Pali Rohár, Matthew Garrett
  Cc: Hans de Goede, Mario Limonciello, platform-driver-x86, linux-kernel

Ignore events with a type of 0x0011 and a code of 0xfff2 / 0xfff3,
this silences the following messages being logged when the keyboard is
detached / attached on a Dell Venue 11 Pro 7130:

[   63.621953] dell_wmi: Unknown key with type 0x0011 and code 0xfff2 pressed
[   70.240558] dell_wmi: Unknown key with type 0x0011 and code 0xfff3 pressed

Note SW_TABLET_MODE is already reported through the intel_vbtn driver on
this and other Dell devices, so dell_wmi should not report this too,
to avoid duplicate events.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/dell-wmi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 86e8dd6a8b33..c25a4286d766 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -310,6 +310,16 @@ static const struct key_entry dell_wmi_keymap_type_0011[] = {
 	/* Battery inserted */
 	{ KE_IGNORE, 0xfff1, { KEY_RESERVED } },
 
+	/*
+	 * Detachable keyboard detached / undocked
+	 * Note SW_TABLET_MODE is already reported through the intel_vbtn
+	 * driver for this, so we ignore it.
+	 */
+	{ KE_IGNORE, 0xfff2, { KEY_RESERVED } },
+
+	/* Detachable keyboard attached / docked */
+	{ KE_IGNORE, 0xfff3, { KEY_RESERVED } },
+
 	/* Keyboard backlight level changed */
 	{ KE_IGNORE, KBD_LED_OFF_TOKEN,      { KEY_RESERVED } },
 	{ KE_IGNORE, KBD_LED_ON_TOKEN,       { KEY_RESERVED } },
-- 
2.26.0


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

* RE: [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events
  2020-05-13 13:05 [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events Hans de Goede
@ 2020-05-13 17:29   ` Mario.Limonciello
  2020-05-19 17:51 ` Pali Rohár
  1 sibling, 0 replies; 4+ messages in thread
From: Mario.Limonciello @ 2020-05-13 17:29 UTC (permalink / raw)
  To: hdegoede, dvhart, andy, pali, mjg59; +Cc: platform-driver-x86, linux-kernel

> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Wednesday, May 13, 2020 8:06 AM
> To: Darren Hart; Andy Shevchenko; Pali Rohár; Matthew Garrett
> Cc: Hans de Goede; Limonciello, Mario; platform-driver-x86@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached
> events
> 
> 
> [EXTERNAL EMAIL]
> 
> Ignore events with a type of 0x0011 and a code of 0xfff2 / 0xfff3,
> this silences the following messages being logged when the keyboard is
> detached / attached on a Dell Venue 11 Pro 7130:
> 
> [   63.621953] dell_wmi: Unknown key with type 0x0011 and code 0xfff2 pressed
> [   70.240558] dell_wmi: Unknown key with type 0x0011 and code 0xfff3 pressed
> 
> Note SW_TABLET_MODE is already reported through the intel_vbtn driver on
> this and other Dell devices, so dell_wmi should not report this too,
> to avoid duplicate events.

If they didn't also come through on intel-vbtn I would have proposed that we
should have a separate tablet mode switch coming from dell-wmi too.

As a general note the reason for these is that the WMI architecture on Windows
differs in that applications typically directly receive the events and do things
with them.

> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/platform/x86/dell-wmi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 86e8dd6a8b33..c25a4286d766 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -310,6 +310,16 @@ static const struct key_entry dell_wmi_keymap_type_0011[]
> = {
>  	/* Battery inserted */
>  	{ KE_IGNORE, 0xfff1, { KEY_RESERVED } },
> 
> +	/*
> +	 * Detachable keyboard detached / undocked
> +	 * Note SW_TABLET_MODE is already reported through the intel_vbtn
> +	 * driver for this, so we ignore it.
> +	 */
> +	{ KE_IGNORE, 0xfff2, { KEY_RESERVED } },
> +
> +	/* Detachable keyboard attached / docked */
> +	{ KE_IGNORE, 0xfff3, { KEY_RESERVED } },
> +
>  	/* Keyboard backlight level changed */
>  	{ KE_IGNORE, KBD_LED_OFF_TOKEN,      { KEY_RESERVED } },
>  	{ KE_IGNORE, KBD_LED_ON_TOKEN,       { KEY_RESERVED } },
> --
> 2.26.0

Reviewed-by: Mario Limonciello <Mario.limonciello@dell.com>

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

* RE: [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events
@ 2020-05-13 17:29   ` Mario.Limonciello
  0 siblings, 0 replies; 4+ messages in thread
From: Mario.Limonciello @ 2020-05-13 17:29 UTC (permalink / raw)
  To: hdegoede, dvhart, andy, pali, mjg59; +Cc: platform-driver-x86, linux-kernel

> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Wednesday, May 13, 2020 8:06 AM
> To: Darren Hart; Andy Shevchenko; Pali Rohár; Matthew Garrett
> Cc: Hans de Goede; Limonciello, Mario; platform-driver-x86@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached
> events
> 
> 
> [EXTERNAL EMAIL]
> 
> Ignore events with a type of 0x0011 and a code of 0xfff2 / 0xfff3,
> this silences the following messages being logged when the keyboard is
> detached / attached on a Dell Venue 11 Pro 7130:
> 
> [   63.621953] dell_wmi: Unknown key with type 0x0011 and code 0xfff2 pressed
> [   70.240558] dell_wmi: Unknown key with type 0x0011 and code 0xfff3 pressed
> 
> Note SW_TABLET_MODE is already reported through the intel_vbtn driver on
> this and other Dell devices, so dell_wmi should not report this too,
> to avoid duplicate events.

If they didn't also come through on intel-vbtn I would have proposed that we
should have a separate tablet mode switch coming from dell-wmi too.

As a general note the reason for these is that the WMI architecture on Windows
differs in that applications typically directly receive the events and do things
with them.

> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/platform/x86/dell-wmi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 86e8dd6a8b33..c25a4286d766 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -310,6 +310,16 @@ static const struct key_entry dell_wmi_keymap_type_0011[]
> = {
>  	/* Battery inserted */
>  	{ KE_IGNORE, 0xfff1, { KEY_RESERVED } },
> 
> +	/*
> +	 * Detachable keyboard detached / undocked
> +	 * Note SW_TABLET_MODE is already reported through the intel_vbtn
> +	 * driver for this, so we ignore it.
> +	 */
> +	{ KE_IGNORE, 0xfff2, { KEY_RESERVED } },
> +
> +	/* Detachable keyboard attached / docked */
> +	{ KE_IGNORE, 0xfff3, { KEY_RESERVED } },
> +
>  	/* Keyboard backlight level changed */
>  	{ KE_IGNORE, KBD_LED_OFF_TOKEN,      { KEY_RESERVED } },
>  	{ KE_IGNORE, KBD_LED_ON_TOKEN,       { KEY_RESERVED } },
> --
> 2.26.0

Reviewed-by: Mario Limonciello <Mario.limonciello@dell.com>

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

* Re: [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events
  2020-05-13 13:05 [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events Hans de Goede
  2020-05-13 17:29   ` Mario.Limonciello
@ 2020-05-19 17:51 ` Pali Rohár
  1 sibling, 0 replies; 4+ messages in thread
From: Pali Rohár @ 2020-05-19 17:51 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Darren Hart, Andy Shevchenko, Matthew Garrett, Mario Limonciello,
	platform-driver-x86, linux-kernel

On Wednesday 13 May 2020 15:05:44 Hans de Goede wrote:
> Ignore events with a type of 0x0011 and a code of 0xfff2 / 0xfff3,
> this silences the following messages being logged when the keyboard is
> detached / attached on a Dell Venue 11 Pro 7130:
> 
> [   63.621953] dell_wmi: Unknown key with type 0x0011 and code 0xfff2 pressed
> [   70.240558] dell_wmi: Unknown key with type 0x0011 and code 0xfff3 pressed
> 
> Note SW_TABLET_MODE is already reported through the intel_vbtn driver on
> this and other Dell devices, so dell_wmi should not report this too,
> to avoid duplicate events.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Looks good, you can add my:

Acked-by: Pali Rohár <pali@kernel.org>

> ---
>  drivers/platform/x86/dell-wmi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 86e8dd6a8b33..c25a4286d766 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -310,6 +310,16 @@ static const struct key_entry dell_wmi_keymap_type_0011[] = {
>  	/* Battery inserted */
>  	{ KE_IGNORE, 0xfff1, { KEY_RESERVED } },
>  
> +	/*
> +	 * Detachable keyboard detached / undocked
> +	 * Note SW_TABLET_MODE is already reported through the intel_vbtn
> +	 * driver for this, so we ignore it.
> +	 */
> +	{ KE_IGNORE, 0xfff2, { KEY_RESERVED } },
> +
> +	/* Detachable keyboard attached / docked */
> +	{ KE_IGNORE, 0xfff3, { KEY_RESERVED } },
> +
>  	/* Keyboard backlight level changed */
>  	{ KE_IGNORE, KBD_LED_OFF_TOKEN,      { KEY_RESERVED } },
>  	{ KE_IGNORE, KBD_LED_ON_TOKEN,       { KEY_RESERVED } },
> -- 
> 2.26.0
> 

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

end of thread, other threads:[~2020-05-19 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 13:05 [PATCH] platform/x86: dell-wmi: Ignore keyboard attached / detached events Hans de Goede
2020-05-13 17:29 ` Mario.Limonciello
2020-05-13 17:29   ` Mario.Limonciello
2020-05-19 17:51 ` Pali Rohár

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.