* Re: [PATCH 2/4] HID: asus: Filter spurious HID vendor codes on ROG laptops
From: Mario Limonciello @ 2026-01-07 15:12 UTC (permalink / raw)
To: Ionut Nechita (Sunlight Linux), jikos, bentiss
Cc: benato.denis96, linux-input, linux-kernel, ionut_n2001
In-Reply-To: <20260107111945.48018-6-sunlightlinux@gmail.com>
On 1/7/26 5:19 AM, Ionut Nechita (Sunlight Linux) wrote:
> From: Ionut Nechita <ionut_n2001@yahoo.com>
>
> On Asus ROG G14 and G15 laptops, several HID vendor usage codes (0xea,
> 0xec, 0x02, 0x8a, 0x9e) are sent during normal operation without a clear
> purpose, generating unwanted "Unmapped Asus vendor usagepage code"
> warnings in dmesg.
>
> Add definitions for these codes and filter them out in asus_raw_event()
> to prevent kernel log spam.
>
> Tested on Asus ROG G14/G15 series laptops.
>
> Change-Id: I3f3b3a1e1698c8689e4c57582635435bfeda5990
Please strip Change-Id when sending patches to LKML.
> Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
Otherwise LGTM, feel free to add to next version.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> drivers/hid/hid-asus.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index eb14b9d13823b..06cd3d3b74af7 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -57,6 +57,13 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
> #define ROG_ALLY_X_MIN_MCU 313
> #define ROG_ALLY_MIN_MCU 319
>
> +/* Spurious HID codes sent by QUIRK_ROG_NKEY_KEYBOARD devices */
> +#define ASUS_SPURIOUS_CODE_0XEA 0xea
> +#define ASUS_SPURIOUS_CODE_0XEC 0xec
> +#define ASUS_SPURIOUS_CODE_0X02 0x02
> +#define ASUS_SPURIOUS_CODE_0X8A 0x8a
> +#define ASUS_SPURIOUS_CODE_0X9E 0x9e
> +
> #define SUPPORT_KBD_BACKLIGHT BIT(0)
>
> #define MAX_TOUCH_MAJOR 8
> @@ -348,6 +355,21 @@ static int asus_raw_event(struct hid_device *hdev,
> if (report->id == FEATURE_KBD_LED_REPORT_ID1 || report->id == FEATURE_KBD_LED_REPORT_ID2)
> return -1;
> if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
> + /*
> + * G14 and G15 send these codes on some keypresses with no
> + * discernable reason for doing so. Filter them out to avoid
> + * unmapped warning messages.
> + */
> + if (report->id == FEATURE_KBD_REPORT_ID) {
> + if (data[1] == ASUS_SPURIOUS_CODE_0XEA ||
> + data[1] == ASUS_SPURIOUS_CODE_0XEC ||
> + data[1] == ASUS_SPURIOUS_CODE_0X02 ||
> + data[1] == ASUS_SPURIOUS_CODE_0X8A ||
> + data[1] == ASUS_SPURIOUS_CODE_0X9E) {
> + return -1;
> + }
> + }
> +
> /*
> * G713 and G733 send these codes on some keypresses, depending on
> * the key pressed it can trigger a shutdown event if not caught.
^ permalink raw reply
* Re: [PATCH 1/4] HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant
From: Mario Limonciello @ 2026-01-07 15:13 UTC (permalink / raw)
To: Denis Benato, Ionut Nechita (Sunlight Linux), jikos, bentiss
Cc: linux-input, linux-kernel, ionut_n2001
In-Reply-To: <6550db38-e5a5-49f5-ac60-02d0374dd553@gmail.com>
On 1/7/26 7:00 AM, Denis Benato wrote:
>
> On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
>> From: Ionut Nechita <ionut_n2001@yahoo.com>
>>
>> Use the existing HID_UP_ASUSVENDOR constant instead of the magic number
>> 0xff310000 for better code clarity and maintainability.
>>
>> Change-Id: I65cf58cd0cd47acc39b755fa9a5fb7f2ad271046
Please strip change-id.
Otherwise LGTM and add to next version:
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Reviewed-by: Denis Benato <benato.denis96@gmail.com>
>> Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
>> ---
>> drivers/hid/hid-asus.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
>> index 472bca54642b9..eb14b9d13823b 100644
>> --- a/drivers/hid/hid-asus.c
>> +++ b/drivers/hid/hid-asus.c
>> @@ -317,7 +317,7 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
>> static int asus_event(struct hid_device *hdev, struct hid_field *field,
>> struct hid_usage *usage, __s32 value)
>> {
>> - if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
>> + if ((usage->hid & HID_USAGE_PAGE) == HID_UP_ASUSVENDOR &&
>> (usage->hid & HID_USAGE) != 0x00 &&
>> (usage->hid & HID_USAGE) != 0xff && !usage->type) {
>> hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
^ permalink raw reply
* Re: [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads
From: Benjamin Tissoires @ 2026-01-07 15:13 UTC (permalink / raw)
To: Jiri Kosina, Shuah Khan, Peter Hutterer
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko
In-Reply-To: <20251222-wip-hid-pressurepad-v2-0-054ac9689bb7@who-t.net>
On Mon, 22 Dec 2025 09:43:33 +1000, Peter Hutterer wrote:
> Nicely enough MS defines a button type for a pressurepad touchpad [2]
> and it looks like most touchpad vendors fill this in.
>
> The selftests require a bit of prep work (and a hack for the test
> itself) - hidtools 0.12 requires python-libevdev 0.13 which in turn
> provides constructors for unknown properties.
>
> [...]
Applied to hid/hid.git (for-6.19/upstream-fixes), thanks!
[1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
https://git.kernel.org/hid/hid/c/2b29a90131bb
[2/4] selftests/hid: require hidtools 0.12
https://git.kernel.org/hid/hid/c/1d6628f7f279
[3/4] selftests/hid: use a enum class for the different button types
https://git.kernel.org/hid/hid/c/4f36fdab084f
[4/4] selftests/hid: add a test for the Digitizer/Button Type pressurepad
https://git.kernel.org/hid/hid/c/f287ba5951a4
Cheers,
--
Benjamin Tissoires <bentiss@kernel.org>
^ permalink raw reply
* Re: [PATCH 3/4] HID: asus: Add WMI communication infrastructure
From: Mario Limonciello @ 2026-01-07 15:14 UTC (permalink / raw)
To: Denis Benato, Ionut Nechita (Sunlight Linux), jikos, bentiss
Cc: linux-input, linux-kernel, ionut_n2001
In-Reply-To: <088286f0-3469-4b2a-87bb-56440d40fb82@gmail.com>
On 1/7/26 7:07 AM, Denis Benato wrote:
>
> On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
>> From: Ionut Nechita <ionut_n2001@yahoo.com>
>>
>> Add the infrastructure needed for the HID driver to communicate with
>> the asus-wmi driver:
>>
>> - Add linux/acpi.h include (in alphabetical order)
> Mentioning the addition of acpi.h seems a bit too specific
> for a commit message, but wait for hid maintainers to
> tell.
>> - Define ASUS_WMI_METHODID_NOTIF method ID in asus-wmi.h
>> - Implement asus_wmi_send_event() function to send events to asus-wmi
>>
>> This infrastructure will be used to handle special keys that require
>> WMI communication.
>>
>> Change-Id: Ic4d9b35f8b1f2b48c7c26e7259b4d05951021b58
>> Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
>> ---
>> drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
>> include/linux/platform_data/x86/asus-wmi.h | 1 +
>> 2 files changed, 25 insertions(+)
>>
>> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
>> index 06cd3d3b74af7..05fa35489258d 100644
>> --- a/drivers/hid/hid-asus.c
>> +++ b/drivers/hid/hid-asus.c
>> @@ -23,6 +23,7 @@
>> /*
>> */
>>
>> +#include <linux/acpi.h>
>> #include <linux/dmi.h>
>> #include <linux/hid.h>
>> #include <linux/module.h>
>> @@ -321,6 +322,29 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
>> return 0;
>> }
>>
>> +/*
>> + * Send events to asus-wmi driver for handling special keys
>> + */
>> +static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
>> +{
>> + int err;
>> + u32 retval;
>> +
>> + err = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS,
>> + ASUS_WMI_METHODID_NOTIF, code, &retval);
> This code is based on the fact asus-wmi driver is available:
> are you sure this doesn't make the kernel compilation fail
> if such driver is not enabled?
asus-wmi.h has conditional behavior already:
#if IS_REACHABLE(CONFIG_ASUS_WMI)
>> + if (err) {
>> + pr_warn("Failed to notify asus-wmi: %d\n", err);
>> + return err;
>> + }
>> +
>> + if (retval != 0) {
>> + pr_warn("Failed to notify asus-wmi (retval): 0x%x\n", retval);
>> + return -EIO;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> static int asus_event(struct hid_device *hdev, struct hid_field *field,
>> struct hid_usage *usage, __s32 value)
>> {
>> diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
>> index 419491d4abca1..516538b5a527e 100644
>> --- a/include/linux/platform_data/x86/asus-wmi.h
>> +++ b/include/linux/platform_data/x86/asus-wmi.h
>> @@ -29,6 +29,7 @@
>> #define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
>> #define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
>> #define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
>> +#define ASUS_WMI_METHODID_NOTIF 0x00100021 /* Notify method */
>>
>> #define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
>>
^ permalink raw reply
* Re: [PATCH 3/4] HID: asus: Add WMI communication infrastructure
From: Denis Benato @ 2026-01-07 15:20 UTC (permalink / raw)
To: Mario Limonciello, Ionut Nechita (Sunlight Linux), jikos, bentiss
Cc: linux-input, linux-kernel, ionut_n2001
In-Reply-To: <58414ae4-59e4-4f3b-ba19-dd706e4ae1a9@kernel.org>
On 1/7/26 16:14, Mario Limonciello wrote:
> On 1/7/26 7:07 AM, Denis Benato wrote:
>>
>> On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
>>> From: Ionut Nechita <ionut_n2001@yahoo.com>
>>>
>>> Add the infrastructure needed for the HID driver to communicate with
>>> the asus-wmi driver:
>>>
>>> - Add linux/acpi.h include (in alphabetical order)
>> Mentioning the addition of acpi.h seems a bit too specific
>> for a commit message, but wait for hid maintainers to
>> tell.
>>> - Define ASUS_WMI_METHODID_NOTIF method ID in asus-wmi.h
>>> - Implement asus_wmi_send_event() function to send events to asus-wmi
>>>
>>> This infrastructure will be used to handle special keys that require
>>> WMI communication.
>>>
>>> Change-Id: Ic4d9b35f8b1f2b48c7c26e7259b4d05951021b58
>>> Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
>>> ---
>>> drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
>>> include/linux/platform_data/x86/asus-wmi.h | 1 +
>>> 2 files changed, 25 insertions(+)
>>>
>>> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
>>> index 06cd3d3b74af7..05fa35489258d 100644
>>> --- a/drivers/hid/hid-asus.c
>>> +++ b/drivers/hid/hid-asus.c
>>> @@ -23,6 +23,7 @@
>>> /*
>>> */
>>> +#include <linux/acpi.h>
>>> #include <linux/dmi.h>
>>> #include <linux/hid.h>
>>> #include <linux/module.h>
>>> @@ -321,6 +322,29 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
>>> return 0;
>>> }
>>> +/*
>>> + * Send events to asus-wmi driver for handling special keys
>>> + */
>>> +static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
>>> +{
>>> + int err;
>>> + u32 retval;
>>> +
>>> + err = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS,
>>> + ASUS_WMI_METHODID_NOTIF, code, &retval);
>> This code is based on the fact asus-wmi driver is available:
>> are you sure this doesn't make the kernel compilation fail
>> if such driver is not enabled?
>
> asus-wmi.h has conditional behavior already:
>
> #if IS_REACHABLE(CONFIG_ASUS_WMI)
>
Ah yes I missed that.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
>>> + if (err) {
>>> + pr_warn("Failed to notify asus-wmi: %d\n", err);
>>> + return err;
>>> + }
>>> +
>>> + if (retval != 0) {
>>> + pr_warn("Failed to notify asus-wmi (retval): 0x%x\n", retval);
>>> + return -EIO;
>>> + }
>>> +
>>> + return 0;
>>> +}
>>> +
>>> static int asus_event(struct hid_device *hdev, struct hid_field *field,
>>> struct hid_usage *usage, __s32 value)
>>> {
>>> diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
>>> index 419491d4abca1..516538b5a527e 100644
>>> --- a/include/linux/platform_data/x86/asus-wmi.h
>>> +++ b/include/linux/platform_data/x86/asus-wmi.h
>>> @@ -29,6 +29,7 @@
>>> #define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
>>> #define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
>>> #define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
>>> +#define ASUS_WMI_METHODID_NOTIF 0x00100021 /* Notify method */
>>> #define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
>>>
>
^ permalink raw reply
* [PATCH v3 0/4] HID: asus: Add Fn+F5 fan control key support for ROG laptops
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:22 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
From: Ionut Nechita <ionut_n2001@yahoo.com>
This series adds support for the Fn+F5 fan control key on Asus ROG
laptops and addresses spurious HID vendor codes that cause kernel log
spam on these devices.
The series introduces:
1. Code cleanup by replacing a magic number with an existing constant
2. Filtering of spurious HID vendor usage codes on ROG laptops
3. Infrastructure for HID-to-WMI communication with proper build guards
4. Fn+F5 fan control key handler with userspace fallback support
The Fn+F5 key handler attempts to forward events to asus-wmi when
available. If asus-wmi is unavailable or fails, the event is passed
to userspace via evdev, allowing userspace fan control implementations.
Tested on Asus ROG series laptops.
Changes in v3:
- Added IS_REACHABLE(CONFIG_ASUS_WMI) conditional compilation guards
to prevent build failures when asus-wmi is not compiled (patch 3)
- Modified Fn+F5 handler to pass events to userspace when asus-wmi is
unavailable or fails, enabling userspace fan control (patch 4)
- Updated comments and commit message to reflect that spurious codes
affect all ROG laptops, not just G14/G15, and occur during normal
operation, not just on keypresses (patch 2)
- Simplified commit message for WMI infrastructure patch (patch 3)
- Added Reviewed-by tag from Denis Benato
- Removed Change-Id tags
Changes in v2:
- Split the original patch into a logical series of 4 patches
- Improved code organization and commit messages
Ionut Nechita (4):
HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant
HID: asus: Filter spurious HID vendor codes on ROG laptops
HID: asus: Add WMI communication infrastructure
HID: asus: Implement Fn+F5 fan control key handler
drivers/hid/hid-asus.c | 80 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 80 insertions(+), 1 deletion(-)
--
2.52.0
^ permalink raw reply
* [PATCH v3 1/4] HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:22 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
Use the existing HID_UP_ASUSVENDOR constant instead of the magic number
0xff310000 for better code clarity and maintainability.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 472bca54642b9..eb14b9d13823b 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -317,7 +317,7 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
static int asus_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
- if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
+ if ((usage->hid & HID_USAGE_PAGE) == HID_UP_ASUSVENDOR &&
(usage->hid & HID_USAGE) != 0x00 &&
(usage->hid & HID_USAGE) != 0xff && !usage->type) {
hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
--
2.52.0
^ permalink raw reply related
* [PATCH v3 2/4] HID: asus: Filter spurious HID vendor codes on ROG laptops
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:22 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
On Asus ROG laptops, several HID vendor usage codes (0xea, 0xec, 0x02,
0x8a, 0x9e) are sent during normal operation without a clear purpose,
generating unwanted "Unmapped Asus vendor usagepage code" warnings in
dmesg.
Add definitions for these codes and filter them out in asus_raw_event()
to prevent kernel log spam.
Tested on Asus ROG series laptops.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index eb14b9d13823b..15c24d5812763 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -57,6 +57,13 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define ROG_ALLY_X_MIN_MCU 313
#define ROG_ALLY_MIN_MCU 319
+/* Spurious HID codes sent by QUIRK_ROG_NKEY_KEYBOARD devices */
+#define ASUS_SPURIOUS_CODE_0XEA 0xea
+#define ASUS_SPURIOUS_CODE_0XEC 0xec
+#define ASUS_SPURIOUS_CODE_0X02 0x02
+#define ASUS_SPURIOUS_CODE_0X8A 0x8a
+#define ASUS_SPURIOUS_CODE_0X9E 0x9e
+
#define SUPPORT_KBD_BACKLIGHT BIT(0)
#define MAX_TOUCH_MAJOR 8
@@ -348,6 +355,21 @@ static int asus_raw_event(struct hid_device *hdev,
if (report->id == FEATURE_KBD_LED_REPORT_ID1 || report->id == FEATURE_KBD_LED_REPORT_ID2)
return -1;
if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
+ /*
+ * ASUS ROG laptops send these codes during normal operation
+ * with no discernable reason. Filter them out to avoid
+ * unmapped warning messages.
+ */
+ if (report->id == FEATURE_KBD_REPORT_ID) {
+ if (data[1] == ASUS_SPURIOUS_CODE_0XEA ||
+ data[1] == ASUS_SPURIOUS_CODE_0XEC ||
+ data[1] == ASUS_SPURIOUS_CODE_0X02 ||
+ data[1] == ASUS_SPURIOUS_CODE_0X8A ||
+ data[1] == ASUS_SPURIOUS_CODE_0X9E) {
+ return -1;
+ }
+ }
+
/*
* G713 and G733 send these codes on some keypresses, depending on
* the key pressed it can trigger a shutdown event if not caught.
--
2.52.0
^ permalink raw reply related
* [PATCH v3 3/4] HID: asus: Add WMI communication infrastructure
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:22 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
Add infrastructure for the HID driver to communicate with the asus-wmi
driver for handling special keys that require WMI communication.
This includes:
- Define ASUS_WMI_METHODID_NOTIF method ID in asus-wmi.h
- Implement asus_wmi_send_event() function with proper conditional
compilation guards for when asus-wmi is not available
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 31 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 32 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 15c24d5812763..8828a3b3054fa 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -23,6 +23,7 @@
/*
*/
+#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/hid.h>
#include <linux/module.h>
@@ -321,6 +322,36 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
return 0;
}
+/*
+ * Send events to asus-wmi driver for handling special keys
+ */
+#if IS_REACHABLE(CONFIG_ASUS_WMI)
+static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
+{
+ int err;
+ u32 retval;
+
+ err = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS,
+ ASUS_WMI_METHODID_NOTIF, code, &retval);
+ if (err) {
+ pr_warn("Failed to notify asus-wmi: %d\n", err);
+ return err;
+ }
+
+ if (retval != 0) {
+ pr_warn("Failed to notify asus-wmi (retval): 0x%x\n", retval);
+ return -EIO;
+ }
+
+ return 0;
+}
+#else
+static inline int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
+{
+ return -ENODEV;
+}
+#endif
+
static int asus_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 419491d4abca1..516538b5a527e 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -29,6 +29,7 @@
#define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
#define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
#define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
+#define ASUS_WMI_METHODID_NOTIF 0x00100021 /* Notify method */
#define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
--
2.52.0
^ permalink raw reply related
* [PATCH v3 4/4] HID: asus: Implement Fn+F5 fan control key handler
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:22 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
On Asus ROG laptops, the Fn+F5 key (HID code 0xae) is used to cycle
through fan modes. This key press needs to be forwarded to the asus-wmi
driver to actually change the fan mode.
Add ASUS_FAN_CTRL_KEY_CODE define and implement the handler in
asus_raw_event() to send WMI events when this key is pressed.
When asus-wmi successfully handles the event, it is blocked from reaching
userspace. If asus-wmi is unavailable or fails, the event is passed to
userspace via evdev, allowing userspace implementations of fan control.
Tested on Asus ROG G14/G15 series laptops.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 35 ++++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 8828a3b3054fa..d6f0050fd441b 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -65,6 +65,9 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define ASUS_SPURIOUS_CODE_0X8A 0x8a
#define ASUS_SPURIOUS_CODE_0X9E 0x9e
+/* Special key codes */
+#define ASUS_FAN_CTRL_KEY_CODE 0xae
+
#define SUPPORT_KBD_BACKLIGHT BIT(0)
#define MAX_TOUCH_MAJOR 8
@@ -386,12 +389,34 @@ static int asus_raw_event(struct hid_device *hdev,
if (report->id == FEATURE_KBD_LED_REPORT_ID1 || report->id == FEATURE_KBD_LED_REPORT_ID2)
return -1;
if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
- /*
- * ASUS ROG laptops send these codes during normal operation
- * with no discernable reason. Filter them out to avoid
- * unmapped warning messages.
- */
if (report->id == FEATURE_KBD_REPORT_ID) {
+ /*
+ * Fn+F5 fan control key - try to send WMI event to toggle fan mode.
+ * If successful, block the event from reaching userspace.
+ * If asus-wmi is unavailable or the call fails, let the event
+ * pass to userspace so it can implement its own fan control.
+ */
+ if (data[1] == ASUS_FAN_CTRL_KEY_CODE) {
+ int ret = asus_wmi_send_event(drvdata, ASUS_FAN_CTRL_KEY_CODE);
+
+ if (ret == 0) {
+ /* Successfully handled by asus-wmi, block event */
+ return -1;
+ }
+
+ /*
+ * Warn if asus-wmi failed (but not if it's unavailable).
+ * Let the event reach userspace in all failure cases.
+ */
+ if (ret != -ENODEV)
+ hid_warn(hdev, "Failed to notify asus-wmi: %d\n", ret);
+ }
+
+ /*
+ * ASUS ROG laptops send these codes during normal operation
+ * with no discernable reason. Filter them out to avoid
+ * unmapped warning messages.
+ */
if (data[1] == ASUS_SPURIOUS_CODE_0XEA ||
data[1] == ASUS_SPURIOUS_CODE_0XEC ||
data[1] == ASUS_SPURIOUS_CODE_0X02 ||
--
2.52.0
^ permalink raw reply related
* Re: [PATCH v3 3/4] HID: asus: Add WMI communication infrastructure
From: Mario Limonciello @ 2026-01-07 15:26 UTC (permalink / raw)
To: Ionut Nechita (Sunlight Linux), benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel
In-Reply-To: <20260107152213.143247-8-sunlightlinux@gmail.com>
On 1/7/26 9:22 AM, Ionut Nechita (Sunlight Linux) wrote:
> From: Ionut Nechita <ionut_n2001@yahoo.com>
>
> Add infrastructure for the HID driver to communicate with the asus-wmi
> driver for handling special keys that require WMI communication.
>
> This includes:
> - Define ASUS_WMI_METHODID_NOTIF method ID in asus-wmi.h
> - Implement asus_wmi_send_event() function with proper conditional
> compilation guards for when asus-wmi is not available
>
> Reviewed-by: Denis Benato <benato.denis96@gmail.com>
> Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
> ---
> drivers/hid/hid-asus.c | 31 ++++++++++++++++++++++
> include/linux/platform_data/x86/asus-wmi.h | 1 +
> 2 files changed, 32 insertions(+)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 15c24d5812763..8828a3b3054fa 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -23,6 +23,7 @@
> /*
> */
>
> +#include <linux/acpi.h>
> #include <linux/dmi.h>
> #include <linux/hid.h>
> #include <linux/module.h>
> @@ -321,6 +322,36 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
> return 0;
> }
>
> +/*
> + * Send events to asus-wmi driver for handling special keys
> + */
> +#if IS_REACHABLE(CONFIG_ASUS_WMI)
I think this specific IS_REACHABLE isn't needed.
asus_wmi_evaluate_method() will return -ENODEV in that case already.
I think the warning you have below is actually helpful too because it
will be obvious to a user they forgot to enable asus-wmi in their kernel
config.
> +static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
> +{
> + int err;
> + u32 retval;
> +
> + err = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS,
> + ASUS_WMI_METHODID_NOTIF, code, &retval);
> + if (err) {
> + pr_warn("Failed to notify asus-wmi: %d\n", err);
> + return err;
> + }
> +
> + if (retval != 0) {
> + pr_warn("Failed to notify asus-wmi (retval): 0x%x\n", retval);
> + return -EIO;
> + }
> +
> + return 0;
> +}
> +#else
> +static inline int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
> +{
> + return -ENODEV;
> +}
> +#endif
> +
> static int asus_event(struct hid_device *hdev, struct hid_field *field,
> struct hid_usage *usage, __s32 value)
> {
> diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
> index 419491d4abca1..516538b5a527e 100644
> --- a/include/linux/platform_data/x86/asus-wmi.h
> +++ b/include/linux/platform_data/x86/asus-wmi.h
> @@ -29,6 +29,7 @@
> #define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
> #define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
> #define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
> +#define ASUS_WMI_METHODID_NOTIF 0x00100021 /* Notify method */
>
> #define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
>
^ permalink raw reply
* [PATCH v5 0/4] HID: asus: Add Fn+F5 fan control key support for ROG laptops
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:42 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
From: Ionut Nechita <ionut_n2001@yahoo.com>
This series adds support for the Fn+F5 fan control key on Asus ROG
laptops and addresses spurious HID vendor codes that cause kernel log
spam on these devices.
The series introduces:
1. Code cleanup by replacing a magic number with an existing constant
2. Filtering of spurious HID vendor usage codes on ROG laptops
3. Infrastructure for HID-to-WMI communication
4. Fn+F5 fan control key handler with userspace fallback support
The Fn+F5 key handler attempts to forward events to asus-wmi when
available. If asus-wmi is unavailable or fails, the event is passed
to userspace via evdev, allowing userspace fan control implementations.
Tested on Asus ROG series laptops.
Changes in v5:
- Removed IS_REACHABLE(CONFIG_ASUS_WMI) guards from patch 3 as
asus_wmi_evaluate_method() already returns -ENODEV when asus-wmi
is not available, and the warning is helpful for users (Mario's feedback)
- Updated commit message for patch 3 to reflect the removal of
conditional compilation guards
Changes in v4:
- Added Reviewed-by tag from Mario Limonciello (AMD) to all patches
Changes in v3:
- Added IS_REACHABLE(CONFIG_ASUS_WMI) conditional compilation guards
to prevent build failures when asus-wmi is not compiled (patch 3)
- Modified Fn+F5 handler to pass events to userspace when asus-wmi is
unavailable or fails, enabling userspace fan control (patch 4)
- Updated comments and commit message to reflect that spurious codes
affect all ROG laptops, not just G14/G15, and occur during normal
operation, not just on keypresses (patch 2)
- Simplified commit message for WMI infrastructure patch (patch 3)
- Added Reviewed-by tag from Denis Benato
- Removed Change-Id tags
Changes in v2:
- Split the original patch into a logical series of 4 patches
- Improved code organization and commit messages
Ionut Nechita (4):
HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant
HID: asus: Filter spurious HID vendor codes on ROG laptops
HID: asus: Add WMI communication infrastructure
HID: asus: Implement Fn+F5 fan control key handler
drivers/hid/hid-asus.c | 73 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 73 insertions(+), 1 deletion(-)
--
2.52.0
^ permalink raw reply
* [PATCH v5 1/4] HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:42 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107154219.164514-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
Use the existing HID_UP_ASUSVENDOR constant instead of the magic number
0xff310000 for better code clarity and maintainability.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 472bca54642b9..eb14b9d13823b 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -317,7 +317,7 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
static int asus_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
- if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
+ if ((usage->hid & HID_USAGE_PAGE) == HID_UP_ASUSVENDOR &&
(usage->hid & HID_USAGE) != 0x00 &&
(usage->hid & HID_USAGE) != 0xff && !usage->type) {
hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
--
2.52.0
^ permalink raw reply related
* [PATCH v5 2/4] HID: asus: Filter spurious HID vendor codes on ROG laptops
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:42 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107154219.164514-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
On Asus ROG laptops, several HID vendor usage codes (0xea, 0xec, 0x02,
0x8a, 0x9e) are sent during normal operation without a clear purpose,
generating unwanted "Unmapped Asus vendor usagepage code" warnings in
dmesg.
Add definitions for these codes and filter them out in asus_raw_event()
to prevent kernel log spam.
Tested on Asus ROG series laptops.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index eb14b9d13823b..15c24d5812763 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -57,6 +57,13 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define ROG_ALLY_X_MIN_MCU 313
#define ROG_ALLY_MIN_MCU 319
+/* Spurious HID codes sent by QUIRK_ROG_NKEY_KEYBOARD devices */
+#define ASUS_SPURIOUS_CODE_0XEA 0xea
+#define ASUS_SPURIOUS_CODE_0XEC 0xec
+#define ASUS_SPURIOUS_CODE_0X02 0x02
+#define ASUS_SPURIOUS_CODE_0X8A 0x8a
+#define ASUS_SPURIOUS_CODE_0X9E 0x9e
+
#define SUPPORT_KBD_BACKLIGHT BIT(0)
#define MAX_TOUCH_MAJOR 8
@@ -348,6 +355,21 @@ static int asus_raw_event(struct hid_device *hdev,
if (report->id == FEATURE_KBD_LED_REPORT_ID1 || report->id == FEATURE_KBD_LED_REPORT_ID2)
return -1;
if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
+ /*
+ * ASUS ROG laptops send these codes during normal operation
+ * with no discernable reason. Filter them out to avoid
+ * unmapped warning messages.
+ */
+ if (report->id == FEATURE_KBD_REPORT_ID) {
+ if (data[1] == ASUS_SPURIOUS_CODE_0XEA ||
+ data[1] == ASUS_SPURIOUS_CODE_0XEC ||
+ data[1] == ASUS_SPURIOUS_CODE_0X02 ||
+ data[1] == ASUS_SPURIOUS_CODE_0X8A ||
+ data[1] == ASUS_SPURIOUS_CODE_0X9E) {
+ return -1;
+ }
+ }
+
/*
* G713 and G733 send these codes on some keypresses, depending on
* the key pressed it can trigger a shutdown event if not caught.
--
2.52.0
^ permalink raw reply related
* [PATCH v5 3/4] HID: asus: Add WMI communication infrastructure
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:42 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107154219.164514-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
Add infrastructure for the HID driver to communicate with the asus-wmi
driver for handling special keys that require WMI communication.
This includes:
- Define ASUS_WMI_METHODID_NOTIF method ID in asus-wmi.h
- Implement asus_wmi_send_event() function to send events to asus-wmi
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 25 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 15c24d5812763..6fcd3213857cf 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -23,6 +23,7 @@
/*
*/
+#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/hid.h>
#include <linux/module.h>
@@ -321,6 +322,29 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
return 0;
}
+/*
+ * Send events to asus-wmi driver for handling special keys
+ */
+static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
+{
+ int err;
+ u32 retval;
+
+ err = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS,
+ ASUS_WMI_METHODID_NOTIF, code, &retval);
+ if (err) {
+ pr_warn("Failed to notify asus-wmi: %d\n", err);
+ return err;
+ }
+
+ if (retval != 0) {
+ pr_warn("Failed to notify asus-wmi (retval): 0x%x\n", retval);
+ return -EIO;
+ }
+
+ return 0;
+}
+
static int asus_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 419491d4abca1..516538b5a527e 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -29,6 +29,7 @@
#define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */
#define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */
#define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */
+#define ASUS_WMI_METHODID_NOTIF 0x00100021 /* Notify method */
#define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
--
2.52.0
^ permalink raw reply related
* [PATCH v5 4/4] HID: asus: Implement Fn+F5 fan control key handler
From: Ionut Nechita (Sunlight Linux) @ 2026-01-07 15:42 UTC (permalink / raw)
To: benato.denis96, jikos, bentiss
Cc: ionut_n2001, linux-input, linux-kernel, sunlightlinux, superm1
In-Reply-To: <20260107154219.164514-2-sunlightlinux@gmail.com>
From: Ionut Nechita <ionut_n2001@yahoo.com>
On Asus ROG laptops, the Fn+F5 key (HID code 0xae) is used to cycle
through fan modes. This key press needs to be forwarded to the asus-wmi
driver to actually change the fan mode.
Add ASUS_FAN_CTRL_KEY_CODE define and implement the handler in
asus_raw_event() to send WMI events when this key is pressed.
When asus-wmi successfully handles the event, it is blocked from reaching
userspace. If asus-wmi is unavailable or fails, the event is passed to
userspace via evdev, allowing userspace implementations of fan control.
Tested on Asus ROG G14/G15 series laptops.
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
---
drivers/hid/hid-asus.c | 35 ++++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 6fcd3213857cf..06f32a39c0cf7 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -65,6 +65,9 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define ASUS_SPURIOUS_CODE_0X8A 0x8a
#define ASUS_SPURIOUS_CODE_0X9E 0x9e
+/* Special key codes */
+#define ASUS_FAN_CTRL_KEY_CODE 0xae
+
#define SUPPORT_KBD_BACKLIGHT BIT(0)
#define MAX_TOUCH_MAJOR 8
@@ -379,12 +382,34 @@ static int asus_raw_event(struct hid_device *hdev,
if (report->id == FEATURE_KBD_LED_REPORT_ID1 || report->id == FEATURE_KBD_LED_REPORT_ID2)
return -1;
if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
- /*
- * ASUS ROG laptops send these codes during normal operation
- * with no discernable reason. Filter them out to avoid
- * unmapped warning messages.
- */
if (report->id == FEATURE_KBD_REPORT_ID) {
+ /*
+ * Fn+F5 fan control key - try to send WMI event to toggle fan mode.
+ * If successful, block the event from reaching userspace.
+ * If asus-wmi is unavailable or the call fails, let the event
+ * pass to userspace so it can implement its own fan control.
+ */
+ if (data[1] == ASUS_FAN_CTRL_KEY_CODE) {
+ int ret = asus_wmi_send_event(drvdata, ASUS_FAN_CTRL_KEY_CODE);
+
+ if (ret == 0) {
+ /* Successfully handled by asus-wmi, block event */
+ return -1;
+ }
+
+ /*
+ * Warn if asus-wmi failed (but not if it's unavailable).
+ * Let the event reach userspace in all failure cases.
+ */
+ if (ret != -ENODEV)
+ hid_warn(hdev, "Failed to notify asus-wmi: %d\n", ret);
+ }
+
+ /*
+ * ASUS ROG laptops send these codes during normal operation
+ * with no discernable reason. Filter them out to avoid
+ * unmapped warning messages.
+ */
if (data[1] == ASUS_SPURIOUS_CODE_0XEA ||
data[1] == ASUS_SPURIOUS_CODE_0XEC ||
data[1] == ASUS_SPURIOUS_CODE_0X02 ||
--
2.52.0
^ permalink raw reply related
* Re: [PATCH] HID: i2c-hid: fix potential buffer overflow in i2c_hid_get_report()
From: kenkinming2002 @ 2026-01-07 16:08 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <or6uoheepcbcx4sm36g7z3ccevhjn6iv2ddztx6mpw4qgbdoyo@n3yfbkwlye5i>
On Wed, Jan 07, 2026 at 03:20:13PM +0100, Benjamin Tissoires wrote:
> It makes sense to put this min call here, but it's already present at
> line 304 a few lines after. Could you remove that second check (and
> unnecessary one after your change).
The min call at line 304 uses ret_count which comes from the first 2
bytes in the device response and indicates the actual size of the
returned report descriptor. Notice that importantly ret_count can be
strictly smaller than ihid->bufsize because persumably not all reports
have the same size. The behavior will change if the caller provides a
larger buffer than is necessary. With the min call at line 304, we will
return the actual size of the report descriptor (without the 2 bytes
length header). Without the min call at 304, we will instead return the
size of supplied buffer.
Yours sincerely,
Ken Kwok
^ permalink raw reply
* Re: [PATCH] HID: i2c-hid: fix potential buffer overflow in i2c_hid_get_report()
From: Benjamin Tissoires @ 2026-01-07 17:36 UTC (permalink / raw)
To: jikos, Kwok Kin Ming; +Cc: linux-input, linux-kernel
In-Reply-To: <20251231181830.232239-1-kenkinming2002@gmail.com>
On Thu, 01 Jan 2026 02:18:26 +0800, Kwok Kin Ming wrote:
> `i2c_hid_xfer` is used to read `recv_len + sizeof(__le16)` bytes of data
> into `ihid->rawbuf`.
>
> The former can come from the userspace in the hidraw driver and is only
> bounded by HID_MAX_BUFFER_SIZE(16384) by default (unless we also set
> `max_buffer_size` field of `struct hid_ll_driver` which we do not).
>
> [...]
Applied to hid/hid.git (for-6.19/upstream-fixes), thanks!
[1/1] HID: i2c-hid: fix potential buffer overflow in i2c_hid_get_report()
https://git.kernel.org/hid/hid/c/2497ff38c530
Cheers,
--
Benjamin Tissoires <bentiss@kernel.org>
^ permalink raw reply
* Re: [PATCH] HID: i2c-hid: fix potential buffer overflow in i2c_hid_get_report()
From: Benjamin Tissoires @ 2026-01-07 17:37 UTC (permalink / raw)
To: kenkinming2002; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <aV5_76eRrcGJ1ehE@anonymous>
On Jan 08 2026, kenkinming2002@gmail.com wrote:
> On Wed, Jan 07, 2026 at 03:20:13PM +0100, Benjamin Tissoires wrote:
> > It makes sense to put this min call here, but it's already present at
> > line 304 a few lines after. Could you remove that second check (and
> > unnecessary one after your change).
>
> The min call at line 304 uses ret_count which comes from the first 2
> bytes in the device response and indicates the actual size of the
> returned report descriptor. Notice that importantly ret_count can be
> strictly smaller than ihid->bufsize because persumably not all reports
> have the same size. The behavior will change if the caller provides a
> larger buffer than is necessary. With the min call at line 304, we will
> return the actual size of the report descriptor (without the 2 bytes
> length header). Without the min call at 304, we will instead return the
> size of supplied buffer.
Oh, you're correct. Thanks.
Applied (as mentioned by the automated reply).
Cheers,
Benjamin
>
> Yours sincerely,
> Ken Kwok
^ permalink raw reply
* Re: [PATCH] HID: i2c-hid: override HID descriptors for some Haptick 5288 touchpads
From: Benjamin Tissoires @ 2026-01-07 17:45 UTC (permalink / raw)
To: Kwok Kin Ming; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <20251225190822.150872-1-kenkinming2002@gmail.com>
On Dec 26 2025, Kwok Kin Ming wrote:
> On some Samsung laptops (750XFG) with Haptick 5288 touchpads over
> designware i2c bus, the supplied HID descriptors and report descriptors
> can become partially corrupted under some circumstances.
>
> In particular, this can happen if the touchpad attempts to generate
> input reports while we try to retrieve the HID descriptors or the Report
> descriptor. This can be reproduced by repeatedly reloading the relevant
> kernel modules (i2c_hid_acpi and i2c_hid) and attempting to use the
> touchpad at the same time. The usage of a script is suggested for the
> reproduction of the issue.
>
> Since it is a race condition, one of the symptom of the issue is that it
> will eventually resolve itself after repeated rebooting.
>
> There is currently no way of handling malformed HID descriptors and
> report descriptors and per the I2C HID spec, it is not necessary for the
> HOST to re-retrieve a report descriptor under such circumstances.
> Instead of having a system to deal with malformed HID descriptors and
> report descriptors, we simply hard-code them.
>
> A related issues on another samsung laptop (750XED) have been reported
> on the archlinux forum.
>
> Links: https://bbs.archlinux.org/viewtopic.php?id=289627
> Signed-off-by: Kwok Kin Ming <kenkinming2002@gmail.com>
> ---
> Other fixes were attempted at the issue but none of them work. In
> summary, they included:
>
> 1: Remove I2C_HID_QUIRK_NO_IRQ_AFTER_RESET quirk.
> 2: Do not send power on command to the device before reset.
> 3: Detect if any interrupts have fired when we are reading HID
> descriptors and report descriptors in a racy manner.
>
> Other suggestions are welcomed.
I'm really not found of this patch. AFAICT, from the archlinux bug, the
device is presenting itself to HID, and we "just" have a truncated
report descriptor. I'm not sure if you can trigger that bug at the HID
descriptor level, without scripting it (so in real case scenarios).
The simplest "solution" following what you are doing is making a HID-BPF
fixup which checks whether the device properly sent the report
descriptor and if not puts the one here. The HID-BPF has the advantage
of being compatible with hid-multitouch so you won't get into troubles
with a separate module.
The proper solution should be to detect those situations. But you
mentioned above that the detection of the interrupts wasn't working.
Could you tell us more?
I'd very much not have a report descriptor written in stone in the
kernel when the device returns a correct one. Especially not at the
i2c-hid level (I would be happier with a HID module, but this might
break mutltiouch functionality).
Cheers,
Benjamin
>
> The patch triggers style check warnings due to long line but it should
> sitll be readable. The comments could be removed if necessary.
>
> Other samsung laptops affected by the issue could also be added if it
> can be confirmed.
>
> drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 262 +++++++++++++++++++++++
> 1 file changed, 262 insertions(+)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c b/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c
> index 210f17c3a0be..befec7a0c2fd 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c
> @@ -290,6 +290,260 @@ static const struct i2c_hid_desc_override sipodev_desc = {
> .i2c_name = "SYNA3602:00"
> };
>
> +static const struct i2c_hid_desc_override hantick5288_desc = {
> + .i2c_hid_desc_buffer = (uint8_t [])
> + {0x1e, 0x00, /* Length of descriptor */
> + 0x00, 0x01, /* Version of descriptor */
> + 0xe2, 0x01, /* Length of report descriptor */
> + 0x21, 0x00, /* Location of report descriptor */
> + 0x24, 0x00, /* Location of input report */
> + 0x1f, 0x00, /* Max input report length */
> + 0x25, 0x00, /* Location of output report */
> + 0x11, 0x00, /* Max output report length */
> + 0x22, 0x00, /* Location of command register */
> + 0x23, 0x00, /* Location of data register */
> + 0x11, 0x09, /* Vendor ID */
> + 0x88, 0x52, /* Product ID */
> + 0x06, 0x00, /* Version ID */
> + 0x00, 0x00, 0x00, 0x00, /* Reserved */
> + },
> + .hid_report_desc = (uint8_t [])
> + {0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
> + 0x09, 0x02, /* Usage (Mouse) */
> + 0xA1, 0x01, /* Collection (Application) */
> + 0x85, 0x01, /* Report ID (1) */
> + 0x09, 0x01, /* Usage (Pointer) */
> + 0xA1, 0x00, /* Collection (Physical) */
> + 0x05, 0x09, /* Usage Page (Button) */
> + 0x19, 0x01, /* Usage Minimum (0x01) */
> + 0x29, 0x02, /* Usage Maximum (0x02) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x95, 0x02, /* Report Count (2) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x95, 0x06, /* Report Count (6) */
> + 0x81, 0x01, /* Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
> + 0x09, 0x30, /* Usage (X) */
> + 0x09, 0x31, /* Usage (Y) */
> + 0x15, 0x81, /* Logical Minimum (-127) */
> + 0x25, 0x7F, /* Logical Maximum (127) */
> + 0x75, 0x08, /* Report Size (8) */
> + 0x95, 0x02, /* Report Count (2) */
> + 0x81, 0x06, /* Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position) */
> + 0xC0, /* End Collection */
> + 0xC0, /* End Collection */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x09, 0x05, /* Usage (Touch Pad) */
> + 0xA1, 0x01, /* Collection (Application) */
> + 0x95, 0x01, /* Report Count (1) */
> + 0x55, 0x0E, /* Unit Exponent (-2) */
> + 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */
> + 0x15, 0x00, /* Logical Minimum (0) */
> + 0x85, 0x04, /* Report ID (4) */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x09, 0x22, /* Usage (Finger) */
> + 0xA1, 0x02, /* Collection (Logical) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x09, 0x47, /* Usage (0x47) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x42, /* Usage (Tip Switch) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x75, 0x06, /* Report Size (6) */
> + 0x25, 0x05, /* Logical Maximum (5) */
> + 0x09, 0x51, /* Usage (0x51) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
> + 0x75, 0x10, /* Report Size (16) */
> + 0x26, 0x44, 0x0A, /* Logical Maximum (2628) */
> + 0x46, 0xB0, 0x04, /* Physical Maximum (1200) */
> + 0x09, 0x30, /* Usage (X) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x26, 0x34, 0x05, /* Logical Maximum (1332) */
> + 0x46, 0x38, 0x03, /* Physical Maximum (824) */
> + 0x09, 0x31, /* Usage (Y) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0xC0, /* End Collection */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x09, 0x22, /* Usage (Finger) */
> + 0xA1, 0x02, /* Collection (Logical) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x09, 0x47, /* Usage (0x47) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x42, /* Usage (Tip Switch) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x75, 0x06, /* Report Size (6) */
> + 0x25, 0x05, /* Logical Maximum (5) */
> + 0x09, 0x51, /* Usage (0x51) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
> + 0x75, 0x10, /* Report Size (16) */
> + 0x26, 0x44, 0x0A, /* Logical Maximum (2628) */
> + 0x46, 0xB0, 0x04, /* Physical Maximum (1200) */
> + 0x09, 0x30, /* Usage (X) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x26, 0x34, 0x05, /* Logical Maximum (1332) */
> + 0x46, 0x38, 0x03, /* Physical Maximum (824) */
> + 0x09, 0x31, /* Usage (Y) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0xC0, /* End Collection */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x09, 0x22, /* Usage (Finger) */
> + 0xA1, 0x02, /* Collection (Logical) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x09, 0x47, /* Usage (0x47) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x42, /* Usage (Tip Switch) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x75, 0x06, /* Report Size (6) */
> + 0x25, 0x05, /* Logical Maximum (5) */
> + 0x09, 0x51, /* Usage (0x51) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
> + 0x75, 0x10, /* Report Size (16) */
> + 0x26, 0x44, 0x0A, /* Logical Maximum (2628) */
> + 0x46, 0xB0, 0x04, /* Physical Maximum (1200) */
> + 0x09, 0x30, /* Usage (X) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x26, 0x34, 0x05, /* Logical Maximum (1332) */
> + 0x46, 0x38, 0x03, /* Physical Maximum (824) */
> + 0x09, 0x31, /* Usage (Y) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0xC0, /* End Collection */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x09, 0x22, /* Usage (Finger) */
> + 0xA1, 0x02, /* Collection (Logical) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x09, 0x47, /* Usage (0x47) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x42, /* Usage (Tip Switch) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x75, 0x06, /* Report Size (6) */
> + 0x25, 0x05, /* Logical Maximum (5) */
> + 0x09, 0x51, /* Usage (0x51) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
> + 0x75, 0x10, /* Report Size (16) */
> + 0x26, 0x44, 0x0A, /* Logical Maximum (2628) */
> + 0x46, 0xB0, 0x04, /* Physical Maximum (1200) */
> + 0x09, 0x30, /* Usage (X) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x26, 0x34, 0x05, /* Logical Maximum (1332) */
> + 0x46, 0x38, 0x03, /* Physical Maximum (824) */
> + 0x09, 0x31, /* Usage (Y) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0xC0, /* End Collection */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x55, 0x0C, /* Unit Exponent (-4) */
> + 0x66, 0x01, 0x10, /* Unit (System: SI Linear, Time: Seconds) */
> + 0x47, 0xFF, 0xFF, 0x00, 0x00, /* Physical Maximum (65534) */
> + 0x27, 0xFF, 0xFF, 0x00, 0x00, /* Logical Maximum (65534) */
> + 0x09, 0x56, /* Usage (0x56) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x25, 0x05, /* Logical Maximum (5) */
> + 0x09, 0x54, /* Usage (0x54) */
> + 0x75, 0x04, /* Report Size (4) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x09, /* Usage Page (Button) */
> + 0x09, 0x01, /* Usage (0x01) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x95, 0x01, /* Report Count (1) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x06, 0x01, 0xFF, /* Usage Page (Vendor Defined 0xFF01) */
> + 0x95, 0x01, /* Report Count (1) */
> + 0x75, 0x03, /* Report Size (3) */
> + 0x09, 0x41, /* Usage (0x41) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x42, /* Usage (0x42) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x09, 0x40, /* Usage (0x40) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x75, 0x24, /* Report Size (36) */
> + 0x81, 0x03, /* Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x85, 0x02, /* Report ID (2) */
> + 0x25, 0x0F, /* Logical Maximum (15) */
> + 0x75, 0x04, /* Report Size (4) */
> + 0x09, 0x55, /* Usage (0x55) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0x09, 0x59, /* Usage (0x59) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0x85, 0x06, /* Report ID (6) */
> + 0x06, 0x00, 0xFF, /* Usage Page (Vendor Defined 0xFF00) */
> + 0x09, 0xC5, /* Usage (0xC5) */
> + 0x26, 0xFF, 0x00, /* Logical Maximum (255) */
> + 0x75, 0x08, /* Report Size (8) */
> + 0x96, 0x00, 0x01, /* Report Count (256) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0xC0, /* End Collection */
> + 0x05, 0x0D, /* Usage Page (Digitizer) */
> + 0x09, 0x0E, /* Usage (0x0E) */
> + 0xA1, 0x01, /* Collection (Application) */
> + 0x85, 0x03, /* Report ID (3) */
> + 0x09, 0x22, /* Usage (Finger) */
> + 0xA1, 0x02, /* Collection (Logical) */
> + 0x09, 0x52, /* Usage (0x52) */
> + 0x25, 0x0A, /* Logical Maximum (10) */
> + 0x95, 0x01, /* Report Count (1) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0xC0, /* End Collection */
> + 0x09, 0x22, /* Usage (Finger) */
> + 0xA1, 0x00, /* Collection (Physical) */
> + 0x85, 0x05, /* Report ID (5) */
> + 0x25, 0x01, /* Logical Maximum (1) */
> + 0x75, 0x01, /* Report Size (1) */
> + 0x09, 0x57, /* Usage (0x57) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0x09, 0x58, /* Usage (0x58) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0x75, 0x06, /* Report Size (6) */
> + 0xB1, 0x03, /* Feature (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0xC0, /* End Collection */
> + 0xC0, /* End Collection */
> + 0x06, 0x01, 0xFF, /* Usage Page (Vendor Defined 0xFF01) */
> + 0x09, 0x02, /* Usage (0x02) */
> + 0xA1, 0x01, /* Collection (Application) */
> + 0x75, 0x08, /* Report Size (8) */
> + 0x85, 0x0D, /* Report ID (13) */
> + 0x09, 0xD5, /* Usage (0xD5) */
> + 0x95, 0x18, /* Report Count (24) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0x85, 0x0C, /* Report ID (12) */
> + 0x09, 0xD6, /* Usage (0xD6) */
> + 0x96, 0x91, 0x00, /* Report Count (145) */
> + 0xB1, 0x02, /* Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0x09, 0x30, /* Usage (0x30) */
> + 0x85, 0x07, /* Report ID (7) */
> + 0x95, 0x07, /* Report Count (7) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x70, /* Usage (0x70) */
> + 0x85, 0x0E, /* Report ID (14) */
> + 0x95, 0xC9, /* Report Count (-55) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x71, /* Usage (0x71) */
> + 0x85, 0x08, /* Report ID (8) */
> + 0x95, 0x97, /* Report Count (-105) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x72, /* Usage (0x72) */
> + 0x85, 0x09, /* Report ID (9) */
> + 0x95, 0xFD, /* Report Count (-3) */
> + 0x81, 0x02, /* Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) */
> + 0x09, 0x73, /* Usage (0x73) */
> + 0x85, 0x0A, /* Report ID (10) */
> + 0x95, 0x20, /* Report Count (32) */
> + 0x91, 0x02, /* Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) */
> + 0xC0, /* End Collection */
> + },
> + .hid_report_desc_size = 482,
> + .i2c_name = "SPPT2600:00"
> +};
>
> static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = {
> {
> @@ -415,6 +669,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = {
> },
> .driver_data = (void *)&sipodev_desc
> },
> + {
> + .ident = "Samsung 750XFG",
> + .matches = {
> + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
> + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "750XFG"),
> + },
> + .driver_data = (void *)&hantick5288_desc
> + },
> { } /* Terminate list */
> };
>
> --
> 2.52.0
>
^ permalink raw reply
* Re: [PATCH] HID: i2c-hid: override HID descriptors for some Haptick 5288 touchpads
From: kenkinming2002 @ 2026-01-07 18:14 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <3sbccjhicn22ubkbgz23njhsektkrva3b2udaavg2onxmo5uah@2vt472vdjehm>
On Wed, Jan 07, 2026 at 06:45:45PM +0100, Benjamin Tissoires wrote:
> I'm really not found of this patch.
Me neither and would be happy with a cleaner solution.
> I'm really not found of this patch. AFAICT, from the archlinux bug, the
> device is presenting itself to HID, and we "just" have a truncated
> report descriptor. I'm not sure if you can trigger that bug at the HID
> descriptor level, without scripting it (so in real case scenarios).
At least I can trigger it, because I have an full disk encryption setup
and my theory is that I might unintentionally touch the trackpad while
typing the password. That would explain how I come across the bug.
> The simplest "solution" following what you are doing is making a HID-BPF
> fixup which checks whether the device properly sent the report
> descriptor and if not puts the one here. The HID-BPF has the advantage
> of being compatible with hid-multitouch so you won't get into troubles
> with a separate module.
This might be a solution but would that not only fix it just for me? I
would have to look into how to do HID-BPF fixup.
> The proper solution should be to detect those situations. But you
> mentioned above that the detection of the interrupts wasn't working.
> Could you tell us more?
This is the diff that is lying in my filesystem. I do not see a nice way
to do it without any race. The call to msleep(1) is just a best effort
to make sure any interrupt that have fired would be seen but there is no
guarantee. Now that I think about it, there might be some memory
visiblity issue with multicore but I am not sure.
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index f9b9dd0d9bb8..161eb8301763 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -66,6 +66,7 @@
/* flags */
#define I2C_HID_STARTED 0
#define I2C_HID_RESET_PENDING 1
+#define I2C_HID_IRQ_HANDLED 2
#define I2C_HID_PWR_ON 0x00
#define I2C_HID_PWR_SLEEP 0x01
@@ -219,7 +220,25 @@ static int i2c_hid_xfer(struct i2c_hid *ihid,
n++;
}
+ // On some devices, what we received will may become corrupted if we
+ // are also supposed to receive input reports asynchronously at the
+ // same time, persumably because the hardware buffer in the device is
+ // shared.
+ clear_bit(I2C_HID_IRQ_HANDLED, &ihid->flags);
ret = i2c_transfer(client->adapter, msgs, n);
+ if(recv_len != 0)
+ while(ret == n)
+ {
+ msleep(1);
+ if(!test_and_clear_bit(I2C_HID_IRQ_HANDLED, &ihid->flags))
+ break;
+
+ i2c_hid_dbg(ihid, "%s: interrupted transfer: res=%*ph\n",
+ __func__, recv_len, recv_buf);
+
+ clear_bit(I2C_HID_IRQ_HANDLED, &ihid->flags);
+ ret = i2c_transfer(client->adapter, msgs, n);
+ }
if (ret != n)
return ret < 0 ? ret : -EIO;
@@ -585,6 +604,7 @@ static irqreturn_t i2c_hid_irq(int irq, void *dev_id)
{
struct i2c_hid *ihid = dev_id;
+ set_bit(I2C_HID_IRQ_HANDLED, &ihid->flags);
i2c_hid_get_input(ihid);
return IRQ_HANDLED;
Simply disable and enabling interrupt would not work since we would be
just masking the interrupt on the cpu side. In fact, that is another fix
that I have attempted:
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 63f46a2e5..28ba480e4 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -219,7 +219,9 @@ static int i2c_hid_xfer(struct i2c_hid *ihid,
n++;
}
+ disable_irq(client->irq);
ret = i2c_transfer(client->adapter, msgs, n);
+ enable_irq(client->irq);
if (ret != n)
return ret < 0 ? ret : -EIO;
> I'd very much not have a report descriptor written in stone in the
> kernel when the device returns a correct one. Especially not at the
> i2c-hid level (I would be happier with a HID module, but this might
> break mutltiouch functionality).
Same, which is why I am asking for suggestion to alternative fixes.
Yours sincerly,
Ken Kwok
^ permalink raw reply related
* Re: [PATCH v3] HID: Apply quirk HID_QUIRK_ALWAYS_POLL to Edifier QR30 (2d99:a101)
From: Jiri Kosina @ 2026-01-07 20:53 UTC (permalink / raw)
To: Rodrigo Lugathe da Conceição Alves
Cc: bentiss, linux-input, linux-kernel, linux-usb, stern,
dmitry.torokhov, linuxhid, linuxsound, michal.pecio
In-Reply-To: <20251127220357.1218420-1-lugathe2@gmail.com>
On Thu, 27 Nov 2025, Rodrigo Lugathe da Conceição Alves wrote:
> The USB speaker has a bug that causes it to reboot when changing the
> brightness using the physical knob.
>
> Add a new vendor and product ID entry in hid-ids.h, and register
> the corresponding device in hid-quirks.c with the required quirk.
>
> Signed-off-by: Rodrigo Lugathe da Conceição Alves <lugathe2@gmail.com>
Applied to hid.git#for-6.19/upstream-fixes. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] HID: quirks: work around VID/PID conflict for appledisplay
From: Jiri Kosina @ 2026-01-07 20:56 UTC (permalink / raw)
To: René Rebe; +Cc: linux-input, Benjamin Tissoires
In-Reply-To: <20251128.134641.2239011056142092631.rene@exactco.de>
On Fri, 28 Nov 2025, René Rebe wrote:
> For years I wondered why the Apple Cinema Display driver would not
> just work for me. Turns out the hidraw driver instantly takes it
> over. Fix by adding appledisplay VID/PIDs to hid_have_special_driver.
>
> Fixes: 069e8a65cd79 ("Driver for Apple Cinema Display")
> Signed-off-by: René Rebe <rene@exactco.de>
Applied to hid.git#for-6.19/upstream-fixes.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] HID: Elecom: Add support for ELECOM M-XT3DRBK (018C)
From: Jiri Kosina @ 2026-01-07 21:01 UTC (permalink / raw)
To: Arnoud Willemsen; +Cc: bentiss, linux-input, linux-kernel
In-Reply-To: <20251207024318.14666-2-mail@lynthium.com>
On Sun, 7 Dec 2025, Arnoud Willemsen wrote:
> Wireless/new version of the Elecom trackball mouse M-XT3DRBK has a
> product id that differs from the existing M-XT3DRBK.
> The report descriptor format also seems to have changed and matches
> other (newer?) models instead (except for six buttons instead of eight).
> This patch follows the same format as the patch for the M-XT3URBK (018F)
> by Naoki Ueki (Nov 3rd 2025) to enable the sixth mouse button.
>
> dmesg output:
> [ 292.074664] usb 1-2: new full-speed USB device number 7 using xhci_hcd
> [ 292.218667] usb 1-2: New USB device found, idVendor=056e, idProduct=018c, bcdDevice= 1.00
> [ 292.218676] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [ 292.218679] usb 1-2: Product: ELECOM TrackBall Mouse
> [ 292.218681] usb 1-2: Manufacturer: ELECOM
>
> usbhid-dump output:
> 001:006:000:DESCRIPTOR 1765072638.050578
> 05 01 09 02 A1 01 09 01 A1 00 85 01 05 09 19 01
> 29 05 15 00 25 01 95 08 75 01 81 02 95 01 75 00
> 81 01 05 01 09 30 09 31 16 00 80 26 FF 7F 75 10
> 95 02 81 06 C0 A1 00 05 01 09 38 15 81 25 7F 75
> 08 95 01 81 06 C0 A1 00 05 0C 0A 38 02 95 01 75
> 08 15 81 25 7F 81 06 C0 C0 06 01 FF 09 00 A1 01
> 85 02 09 00 15 00 26 FF 00 75 08 95 07 81 02 C0
> 05 0C 09 01 A1 01 85 05 15 00 26 3C 02 19 00 2A
> 3C 02 75 10 95 01 81 00 C0 05 01 09 80 A1 01 85
> 03 19 81 29 83 15 00 25 01 95 03 75 01 81 02 95
> 01 75 05 81 01 C0 06 BC FF 09 88 A1 01 85 04 95
> 01 75 08 15 00 26 FF 00 19 00 2A FF 00 81 00 C0
> 06 02 FF 09 02 A1 01 85 06 09 02 15 00 26 FF 00
> 75 08 95 07 B1 02 C0
>
> Signed-off-by: Arnoud Willemsen <mail@lynthium.com>
Applied to hid.git#for-6.19/upstream-fixes, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH v2 0/4] Add output report support for QuickI2C driver
From: Jiri Kosina @ 2026-01-07 21:04 UTC (permalink / raw)
To: Even Xu; +Cc: bentiss, srinivas.pandruvada, linux-input, linux-kernel
In-Reply-To: <20251209075215.1535371-1-even.xu@intel.com>
On Tue, 9 Dec 2025, Even Xu wrote:
> This patch serial adds support for HID output reports in the Quicki2c
> driver by implementing the output_report callback in the HID low-level
> driver interface.
>
> This change introduces:
> - Refine QuickI2C driver to use size_t for all length-related variables
> - Enhance the quicki2c_init_write_buf() function by adding support for
> writing to the output register based on the content being written
> - Add quicki2c_hid_output_report() and quicki2c_output_report() function
> that processe the HID output reports request
>
> This enables proper communication with HID devices that require output
> report functionality, such as setting device configuration or updating
> device firmware.
Now queued in hid.git#for-6.20/intel-thc, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox