[PATCH] platform/x86: dell-wmi-base: Fix the data pointer for event sequences
From: Rosen Penev
Date: Sat Nov 14 2026 - 01:22:56 EST
dell_wmi_process_key() expects its buffer argument to point at the
data that follows the event code. The 0x0000 and 0x0012 callers pass
buffer_entry + 3 for a code at buffer_entry[2], and commit
392c19faec6b ("platform/x86: dell-wmi-base: Fix handling of ultra performance key")
relies on this. The remaining count passed for event sequences
(len - i - 1) also counts from the word after the code.
For sequences of type 0x0010 and 0x0011, however, buffer_entry + i is
passed, which points at the code itself. The tablet mode switch event
(type 0x0011, code 0xe070) then reports !0xe070, so SW_TABLET_MODE is
always 0 and tablet mode is never reported.
Pass the word after the code.
Fixes: 5fbd827eb9c2 ("platform/x86: dell-wmi: Recognise or support new switches")
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
Developed with the help of an AI coding assistant (Claude Opus 5.5),
which found the issue and drafted the fix; I reviewed it and am
responsible for it. Builds cleanly with W=1.
Not runtime tested: the M4800 does not send the tablet mode event.
drivers/platform/x86/dell/dell-wmi-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
index 44857e99fdfe..c778409ca099 100644
--- a/drivers/platform/x86/dell/dell-wmi-base.c
+++ b/drivers/platform/x86/dell/dell-wmi-base.c
@@ -523,7 +523,7 @@ static void dell_wmi_notify(struct wmi_device *wdev, const struct wmi_buffer *bu
for (i = 2; i < len; ++i)
i += dell_wmi_process_key(wdev, le16_to_cpu(buffer_entry[1]),
le16_to_cpu(buffer_entry[i]),
- buffer_entry + i,
+ buffer_entry + i + 1,
len - i - 1);
break;
case 0x0012:
base-commit: 2800868f63227c8237d70c41e70d441c919620d6
--
2.56.0