Skip to contentSkip to conversation

platform/x86: dell-wmi: Add an event created by Dell Latitude 5495

PATCH Superseded Shih-Yuan Lee (FourDollars) 2 participants 11 messages Dec 19, 2017 1 message not in the archive x86 platform drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: dell-wmi: Add an event created by Dell Latitude 5495

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/platform/x86/dell-wmi.c +3 -0
index fb25b20..d40f803 100644
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+	/* Mic mute */
+	{ KE_KEY, 0x150, { KEY_F20 } },
+
 	/* Fn-lock */
 	{ KE_IGNORE, 0x151, { KEY_RESERVED } },
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 12 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/platform/x86/dell-wmi.c +0 -0
index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 5 lines
drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+	/* Mic mute */
+	{ KE_KEY, 0x150, { KEY_F20 } },

Hi! Are you sure that this key code needs to be in 0010 table? Because primary this table is constructed from DMI information. See array bios_to_linux_keycode[].

Quoted 4 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
 	/* Fn-lock */
 	{ KE_IGNORE, 0x151, { KEY_RESERVED } },
 
Signature · 2 lines
Pali Rohár
[email protected]

A message that is not in the archive (sent off-list or not yet received): CAApEhgh1XfzeoWL6JQN-oOn9yGvJWB74jdfFKtL==UEyhNQs7Q@mail.gmail.com

#3 lore raw
Quoted 26 lines · On Tuesday 19 December 2017 16:38:32 Shih-Yuan Lee (FourDollars) wrote:
Quoted 10 lines · Pali Rohár

Review

Quoted 8 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/platform/x86/dell-wmi.c

Quoted 14 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 9 lines

index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Hi! Are you sure that this key code needs to be in 0010 table? Because primary this table is constructed from DMI information. See array bios_to_linux_keycode[].

Quoted 2 lines

Because I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed" in dmesg when pressing the mic mute key.

And do you see following message?
"firmware scancode 0x%x maps to unrecognized keycode 0x%x\n"

Quoted 13 lines
Quoted 10 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 269

Quoted 5 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
      /* Fn-lock */
      { KE_IGNORE, 0x151, { KEY_RESERVED } },
 

--
Pali Rohár
[email protected]

Signature · 2 lines
Pali Rohár
[email protected]
#4 lore raw
Quoted 27 lines · Pali Rohár
Quoted 26 lines · On Tuesday 19 December 2017 16:38:32 Shih-Yuan Lee (FourDollars) wrote:
Quoted 24 lines · Pali Rohár

Review

Quoted 8 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/platform/x86/dell-wmi.c

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 9 lines

index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Hi! Are you sure that this key code needs to be in 0010 table? Because primary this table is constructed from DMI information. See array bios_to_linux_keycode[].

Quoted 5 lines
Quoted 2 lines

Because I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed" in dmesg when pressing the mic mute key.

And do you see following message?
"firmware scancode 0x%x maps to unrecognized keycode 0x%x\n"

No, do I put some specific kernel parameter to see it?

Quoted 18 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
      /* Fn-lock */
      { KE_IGNORE, 0x151, { KEY_RESERVED } },
 
Quoted 7 lines
Quoted 4 lines

--
Pali Rohár
[email protected]

--
Pali Rohár
[email protected]

Signature · 2 lines
Shih-Yuan Lee (FourDollars) | Software Engineer / Debian Developer |
Delivery | Customer Engineering | Devices | Canonical
#5 lore raw
Quoted 28 lines · On Tuesday 19 December 2017 16:45:44 Shih-Yuan Lee (FourDollars) wrote:
Quoted 27 lines · Pali Rohár
Quoted 26 lines · On Tuesday 19 December 2017 16:38:32 Shih-Yuan Lee (FourDollars) wrote:
Quoted 24 lines · Pali Rohár

Review

Quoted 8 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/platform/x86/dell-wmi.c

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 9 lines

index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Hi! Are you sure that this key code needs to be in 0010 table? Because primary this table is constructed from DMI information. See array bios_to_linux_keycode[].

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Because I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed" in dmesg when pressing the mic mute key.

And do you see following message?
"firmware scancode 0x%x maps to unrecognized keycode 0x%x\n"

No, do I put some specific kernel parameter to see it?

It is print in same way as above Unknown key with type ...

Signature · 2 lines
Pali Rohár
[email protected]
#6 lore raw
Quoted 29 lines · Pali Rohár
Quoted 28 lines · On Tuesday 19 December 2017 16:45:44 Shih-Yuan Lee (FourDollars) wrote:
Quoted 27 lines · Pali Rohár
Quoted 26 lines · On Tuesday 19 December 2017 16:38:32 Shih-Yuan Lee (FourDollars) wrote:
Quoted 24 lines · Pali Rohár

Review

Quoted 8 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/platform/x86/dell-wmi.c

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 9 lines

index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Hi! Are you sure that this key code needs to be in 0010 table? Because primary this table is constructed from DMI information. See array bios_to_linux_keycode[].

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Because I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed" in dmesg when pressing the mic mute key.

And do you see following message?
"firmware scancode 0x%x maps to unrecognized keycode 0x%x\n"

No, do I put some specific kernel parameter to see it?

It is print in same way as above Unknown key with type ...

OK, I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed". There is no "firmware scancode 0x%x maps to unrecognized keycode 0x%x\n" at all.

Signature · 2 lines
Shih-Yuan Lee (FourDollars) | Software Engineer / Debian Developer |
Delivery | Customer Engineering | Devices | Canonical
#7 lore raw
Quoted 33 lines · On Tuesday 19 December 2017 17:02:52 Shih-Yuan Lee (FourDollars) wrote:
Quoted 32 lines · Pali Rohár
Quoted 31 lines · On Tuesday 19 December 2017 16:45:44 Shih-Yuan Lee (FourDollars) wrote:
Quoted 30 lines · Pali Rohár
Quoted 28 lines · On Tuesday 19 December 2017 16:38:32 Shih-Yuan Lee (FourDollars) wrote:
Quoted 10 lines · Pali Rohár

Review

Quoted 8 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/platform/x86/dell-wmi.c

Quoted 14 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 9 lines

index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Hi! Are you sure that this key code needs to be in 0010 table? Because primary this table is constructed from DMI information. See array bios_to_linux_keycode[].

Because I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed" in dmesg when pressing the mic mute key.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

And do you see following message?
"firmware scancode 0x%x maps to unrecognized keycode 0x%x\n"

No, do I put some specific kernel parameter to see it?

It is print in same way as above Unknown key with type ...

OK, I saw "dell_wmi: Unknown key with type 0x0010 and code 0x0150 pressed". There is no "firmware scancode 0x%x maps to unrecognized keycode 0x%x\n" at all.

Ok, then adding additional entry is needed.

Signature · 2 lines
Pali Rohár
[email protected]
#8 lore raw
In reply to Shih-Yuan Lee (FourDollars)
Quoted 12 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/platform/x86/dell-wmi.c +0 -0
index fb25b20..d40f803 100644

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 5 lines
drivers/platform/x86/dell-wmi.c +2 -0
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+	/* Mic mute */
+	{ KE_KEY, 0x150, { KEY_F20 } },

Why F20 for mic mute? We have KEY_MICMUTE.

Quoted 4 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
 	/* Fn-lock */
 	{ KE_IGNORE, 0x151, { KEY_RESERVED } },
 
Signature · 2 lines
Pali Rohár
[email protected]
#9 lore raw
Quoted 8 lines · Pali Rohár
Quoted 7 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
Quoted 12 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 10 lines
drivers/platform/x86/dell-wmi.c +2 -0
index fb25b20..d40f803 100644
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Why F20 for mic mute? We have KEY_MICMUTE.

Because X Window System doesn't support KEY_MICMUTE [1] directly, it still relies on systemd/udev rule [2] to convert it to KEY_F20 again in the user space.
So I am also wondering why not using KEY_F20 directly and I am also thinking about changing the bios_to_linux_keycode's KEY_MICMUTE to KEY_F20 for compatibility.

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=54171
[2]: https://github.com/systemd/systemd/commit/fc6e082622c73eb9a22ce16a278d8c4dd7594cbb

Quoted 9 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 269

Quoted 5 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
      /* Fn-lock */
      { KE_IGNORE, 0x151, { KEY_RESERVED } },
 

--
Pali Rohár
[email protected]

Signature · 2 lines
Shih-Yuan Lee (FourDollars) | Software Engineer / Debian Developer |
Delivery | Customer Engineering | Devices | Canonical
#10 lore raw
Quoted 21 lines · On Tuesday 19 December 2017 17:17:24 Shih-Yuan Lee (FourDollars) wrote:
Quoted 8 lines · Pali Rohár
Quoted 7 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
Quoted 12 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 10 lines
drivers/platform/x86/dell-wmi.c +2 -0
index fb25b20..d40f803 100644
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Why F20 for mic mute? We have KEY_MICMUTE.

Quoted 1 line

Because X Window System doesn't support KEY_MICMUTE [1] directly,

This is not an argument why adding hacks into kernel code. If one userspace application is buggy and cannot handle new key code (e.g. KEY_MICMUTE), then userspace application needs to be fixed.

There are also other userspace applications which uses input devices.

Quoted 3 lines

it
still relies on systemd/udev rule [2] to convert it to KEY_F20 again in the user space.

That sounds like another bug which should be fixed. Translating correct key to incorrect one is a bad idea.

Quoted 3 lines

So I am also wondering why not using KEY_F20 directly and I am also thinking about changing the bios_to_linux_keycode's KEY_MICMUTE to KEY_F20 for compatibility.

NACK. This does not make sense as we already have a key code for mic mute. KEY_MICMUTE was created specially for mic mute key and KEY_F20 for F20 key. Those are two different keys.

Also such change would be regression for all applications which expects KEY_MICMUTE for mic mute key.

Quoted 11 lines

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=54171
[2]: https://github.com/systemd/systemd/commit/fc6e082622c73eb9a22ce16a278d8c4dd7594cbb

Quoted 9 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 269

Quoted 5 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
      /* Fn-lock */
      { KE_IGNORE, 0x151, { KEY_RESERVED } },
 

--
Pali Rohár
[email protected]

Signature · 2 lines
Pali Rohár
[email protected]
#11 lore raw
Quoted 41 lines · Pali Rohár
Quoted 21 lines · On Tuesday 19 December 2017 17:17:24 Shih-Yuan Lee (FourDollars) wrote:
Quoted 8 lines · Pali Rohár
Quoted 7 lines · On Tuesday 19 December 2017 11:38:34 Shih-Yuan Lee (FourDollars) wrote:

The Dell Latitude 5495 has the mic mute key.

---
 drivers/platform/x86/dell-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
Quoted 12 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 265

Quoted 10 lines
drivers/platform/x86/dell-wmi.c +2 -0
index fb25b20..d40f803 100644
@@ -261,6 +261,9 @@ static const u16 bios_to_linux_keycode[256] = {
  * override them.
  */
 static const struct key_entry dell_wmi_keymap_type_0010[] = {
+     /* Mic mute */
+     { KE_KEY, 0x150, { KEY_F20 } },

Why F20 for mic mute? We have KEY_MICMUTE.

Quoted 1 line

Because X Window System doesn't support KEY_MICMUTE [1] directly,

This is not an argument why adding hacks into kernel code. If one userspace application is buggy and cannot handle new key code (e.g. KEY_MICMUTE), then userspace application needs to be fixed.

There are also other userspace applications which uses input devices.

Quoted 3 lines

it
still relies on systemd/udev rule [2] to convert it to KEY_F20 again in the user space.

That sounds like another bug which should be fixed. Translating correct key to incorrect one is a bad idea.

Quoted 3 lines

So I am also wondering why not using KEY_F20 directly and I am also thinking about changing the bios_to_linux_keycode's KEY_MICMUTE to KEY_F20 for compatibility.

Quoted 6 lines

NACK. This does not make sense as we already have a key code for mic mute. KEY_MICMUTE was created specially for mic mute key and KEY_F20 for F20 key. Those are two different keys.

Also such change would be regression for all applications which expects KEY_MICMUTE for mic mute key.

OK. Let me send a different version for this patch.

Quoted 16 lines
Quoted 12 lines

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=54171
[2]: https://github.com/systemd/systemd/commit/fc6e082622c73eb9a22ce16a278d8c4dd7594cbb

Quoted 9 lines

drivers/platform/x86/dell-wmi.c static const u16 bios_to_linux_keycode[256] = { · line 269

Quoted 5 lines
drivers/platform/x86/dell-wmi.c +1 -0
+
      /* Fn-lock */
      { KE_IGNORE, 0x151, { KEY_RESERVED } },
 

--
Pali Rohár
[email protected]

--
Pali Rohár
[email protected]

Signature · 2 lines
Shih-Yuan Lee (FourDollars) | Software Engineer / Debian Developer |
Delivery | Customer Engineering | Devices | Canonical