dmidecode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] dmioem: Decode Dell-specific DMI type 178


From: Armin Wolf
Subject: Re: [PATCH] dmioem: Decode Dell-specific DMI type 178
Date: Fri, 11 Oct 2024 23:41:34 +0200
User-agent: Mozilla Thunderbird

Am 02.10.24 um 17:02 schrieb Armin Wolf via dmidecode-devel:

OEM DMI type 178 is used by the dell-wmi-base driver to translate
WMI event scancodes into hotkey events. Include the available
information in the output of dmidecode.

Any thoughts on this?

Thanks,
Armin Wolf

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
  dmioem.c | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)

diff --git a/dmioem.c b/dmioem.c
index 964f287..f6ade2f 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -144,6 +144,21 @@ static void dmi_dell_bios_flags(u64 flags)
        pr_attr("ACPI WMI Supported", "%s", (flags.l & (1 << 1)) ? "Yes" : 
"No");
  }

+static void dmi_dell_hotkeys(const struct dmi_header *h)
+{
+       int count = (h->length - 0x04) / 0x04;
+       u8 *hotkey;
+
+       pr_list_start("Hotkey Mappings", NULL);
+       for (int i = 0; i < count; i++)
+       {
+               hotkey = h->data + 0x04 + 0x04 * i;
+               pr_list_item("Scancode 0x%04hx -> Keycode 0x%04hx",
+                            WORD(hotkey + 0x00), WORD(hotkey + 0x02));
+       }
+       pr_list_end();
+}
+
  static void dmi_dell_indexed_io_access(const struct dmi_header *h)
  {
        static const char *checksum_types[] = {
@@ -225,6 +240,11 @@ static int dmi_decode_dell(const struct dmi_header *h)
                        dmi_dell_bios_flags(QWORD(data + 0x04));
                        break;

+               case 178:
+                       pr_handle_name("Dell Hotkeys");
+                       dmi_dell_hotkeys(h);
+                       break;
+
                case 212:
                        pr_handle_name("Dell Indexed I/O Access");
                        if (h->length < 0x0C) break;
--
2.39.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]