From: Ionut Nechita <redacted>
Hi,
This patch addresses two issues with Asus ROG G14/G15 laptops:
1. Kernel log spam from unmapped HID vendor codes
2. Non-functional Fn+F5 fan control key
Problem:
--------
Asus ROG G14 and G15 laptops send several HID vendor usage codes (0xea,
0xec, 0x02, 0x8a, 0x9e) during normal keypresses with no clear purpose.
This generates continuous "Unmapped Asus vendor usagepage code" warnings
in dmesg, cluttering the kernel log.
Additionally, the Fn+F5 key (code 0xae) which should cycle through fan
modes is not handled, preventing users from controlling fan behavior
through the keyboard shortcut.
Solution:
---------
- Filter out the spurious HID codes for ROG N-Key keyboards to eliminate
log spam
- Add asus_wmi_send_event() function to enable communication between
hid-asus and asus-wmi drivers
- Implement Fn+F5 (0xae) handler that triggers WMI events to toggle fan
modes
- Replace magic number with HID_UP_ASUSVENDOR constant for clarity
Testing:
--------
Tested on Asus ROG G14 (2021) and G15 (2022) models:
- Kernel log no longer shows unmapped vendor code warnings
- Fn+F5 key now cycles through fan modes (silent/balanced/performance)
- No regressions observed with other keyboard functionality
Impact:
-------
Affects Asus ROG laptop users who experience:
- Cluttered kernel logs from HID warnings
- Non-functional fan control hotkey
Ionut Nechita (1):
HID: asus: Filter HID vendor codes and add WMI fan control support
for ROG laptops
drivers/hid/hid-asus.c | 48 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 2 +
2 files changed, 49 insertions(+), 1 deletion(-)
--
2.52.0
From: Ionut Nechita <redacted>
On Asus ROG G14 and G15 laptops, several HID vendor usage codes are sent
during normal operation without a clear purpose, generating unwanted
"Unmapped Asus vendor usagepage code" warnings in dmesg.
Additionally, the Fn+F5 fan control key (code 0xae) needs to communicate
with the asus-wmi driver to toggle between fan modes, but this was not
previously handled.
Changes:
- Filter out spurious HID codes (0xea, 0xec, 0x02, 0x8a, 0x9e) for
QUIRK_ROG_NKEY_KEYBOARD devices to prevent kernel log spam
- Add asus_wmi_send_event() function to communicate with asus-wmi driver
- Implement Fn+F5 (0xae) fan control key handler that triggers WMI events
- Replace magic number 0xff310000 with HID_UP_ASUSVENDOR constant for
better code clarity
This eliminates unnecessary kernel warnings and enables proper fan control
functionality on affected Asus ROG laptops.
Tested on Asus ROG G14/G15 series laptops.
Signed-off-by: Ionut Nechita <redacted>
---
drivers/hid/hid-asus.c | 48 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 2 +
2 files changed, 49 insertions(+), 1 deletion(-)
@@ -348,6 +374,26 @@ 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){+/* Additional report filtering */+if(report->id==FEATURE_KBD_REPORT_ID){+/* Fn+F5 "fan" symbol, trigger WMI event to toggle next mode */+if(data[1]==0xae){+ret=asus_wmi_send_event(drvdata,0xae);+if(ret<0){+hid_warn(hdev,"Asus failed to trigger fan control event");+}+return-1;+/*+*G14andG15sendthesecodesonsomekeypresseswithno+*discernablereasonfordoingso.We'llfilterthemouttoavoid+*unmappedwarningmessageslater+*/+}elseif(data[1]==0xea||data[1]==0xec||data[1]==0x02||+data[1]==0x8a||data[1]==0x9e){+return-1;+}+}+/**G713andG733sendthesecodesonsomekeypresses,dependingon*thekeypresseditcantriggerashutdowneventifnotcaught.
From: Ionut Nechita <redacted>
On Asus ROG G14 and G15 laptops, several HID vendor usage codes are sent
during normal operation without a clear purpose, generating unwanted
"Unmapped Asus vendor usagepage code" warnings in dmesg.
Additionally, the Fn+F5 fan control key (code 0xae) needs to communicate
with the asus-wmi driver to toggle between fan modes, but this was not
previously handled.
Changes:
- Filter out spurious HID codes (0xea, 0xec, 0x02, 0x8a, 0x9e) for
QUIRK_ROG_NKEY_KEYBOARD devices to prevent kernel log spam
- Add asus_wmi_send_event() function to communicate with asus-wmi driver
- Implement Fn+F5 (0xae) fan control key handler that triggers WMI events
- Replace magic number 0xff310000 with HID_UP_ASUSVENDOR constant for
better code clarity
I feel these should be split into smaller logical patches.
quoted hunk
This eliminates unnecessary kernel warnings and enables proper fan control
functionality on affected Asus ROG laptops.
Tested on Asus ROG G14/G15 series laptops.
Signed-off-by: Ionut Nechita <redacted>
---
drivers/hid/hid-asus.c | 48 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 2 +
2 files changed, 49 insertions(+), 1 deletion(-)
@@ -314,10 +316,33 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size) return 0; }+/*+ * This enables triggering events in asus-wmi+ */+static int asus_wmi_send_event(struct asus_drvdata *drvdat, 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) {- 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",
@@ -330,6 +355,7 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field, static int asus_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) {+ int ret; struct asus_drvdata *drvdata = hid_get_drvdata(hdev); if (drvdata->battery && data[0] == BATTERY_REPORT_ID)
@@ -348,6 +374,26 @@ 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) {+ /* Additional report filtering */+ if (report->id == FEATURE_KBD_REPORT_ID) {+ /* Fn+F5 "fan" symbol, trigger WMI event to toggle next mode */+ if (data[1] == 0xae) {
As this has a meaning you've identified shouldn't it have a #define as well?
quoted hunk
+ ret = asus_wmi_send_event(drvdata, 0xae);
+ if (ret < 0) {
+ hid_warn(hdev, "Asus failed to trigger fan control event");
+ }
+ return -1;
+ /*
+ * G14 and G15 send these codes on some keypresses with no
+ * discernable reason for doing so. We'll filter them out to avoid
+ * unmapped warning messages later
+ */
+ } else if (data[1] == 0xea || data[1] == 0xec || data[1] == 0x02 ||
+ data[1] == 0x8a || data[1] == 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.
From: Ionut Nechita <redacted>
Hi Mario and maintainers,
Thank you for the review feedback on v1. I've addressed all the issues:
Changes in v2:
- Split the monolithic patch into 4 logical patches as requested
- Fixed include order (linux/acpi.h now before linux/dmi.h)
- Added #define ASUS_FAN_CTRL_KEY_CODE for 0xae instead of magic number
- Added #defines for the filtered spurious codes as well for clarity
The patch series now:
1. Replaces magic number with existing HID_UP_ASUSVENDOR constant
2. Filters spurious HID vendor codes (with proper #defines)
3. Adds WMI communication infrastructure
4. Implements Fn+F5 fan control key handler (using #define)
This eliminates kernel log spam from unmapped HID codes and enables
proper fan control functionality on Asus ROG G14/G15 laptops.
Tested on Asus ROG G14/G15 series laptops.
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 | 60 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 60 insertions(+), 1 deletion(-)
--
2.52.0
From: Ionut Nechita <redacted>
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
Signed-off-by: Ionut Nechita <redacted>
---
drivers/hid/hid-asus.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
From: Ionut Nechita <redacted>
Add the infrastructure needed for the HID driver to communicate with
the asus-wmi driver:
- Add linux/acpi.h include (in alphabetical order)
- 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 <redacted>
---
drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 25 insertions(+)
From: Ionut Nechita <redacted>
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.
Tested on Asus ROG G14/G15 series laptops.
Change-Id: Ic03df877b71e34c421e992a06e5e706d954e7dbf
Signed-off-by: Ionut Nechita <redacted>
---
drivers/hid/hid-asus.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
@@ -379,12 +382,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){-/*-*G14andG15sendthesecodesonsomekeypresseswithno-*discernablereasonfordoingso.Filterthemouttoavoid-*unmappedwarningmessages.-*/if(report->id==FEATURE_KBD_REPORT_ID){+/* Fn+F5 fan control key, send WMI event to toggle fan mode */+if(data[1]==ASUS_FAN_CTRL_KEY_CODE){+intret=asus_wmi_send_event(drvdata,ASUS_FAN_CTRL_KEY_CODE);++if(ret<0)+hid_warn(hdev,"Failed to trigger fan control event\n");+return-1;+}++/*+*G14andG15sendthesecodesonsomekeypresseswithno+*discernablereasonfordoingso.Filterthemouttoavoid+*unmappedwarningmessages.+*/if(data[1]==ASUS_SPURIOUS_CODE_0XEA||data[1]==ASUS_SPURIOUS_CODE_0XEC||data[1]==ASUS_SPURIOUS_CODE_0X02||
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
From: Ionut Nechita <redacted>
Hi Mario and maintainers,
Hi!
Maintainer of asus-wmi here, thanks a lot for your help!
Thanks Mario for including me too to the party!
A note for the future: from my email client it appears as if you sent
v2 in reply to the previous patch, I have done that on the iio subsystem
and I have been discouraged from doing so because the mail ends up
far from the latest received ones and maintainers are more likely to miss
it.
Thank you for the review feedback on v1. I've addressed all the issues:
Changes in v2:
- Split the monolithic patch into 4 logical patches as requested
- Fixed include order (linux/acpi.h now before linux/dmi.h)
- Added #define ASUS_FAN_CTRL_KEY_CODE for 0xae instead of magic number
- Added #defines for the filtered spurious codes as well for clarity
The patch series now:
1. Replaces magic number with existing HID_UP_ASUSVENDOR constant
2. Filters spurious HID vendor codes (with proper #defines)
3. Adds WMI communication infrastructure
4. Implements Fn+F5 fan control key handler (using #define)
This eliminates kernel log spam from unmapped HID codes and enables
proper fan control functionality on Asus ROG G14/G15 laptops.
From my notes those unmapped codepages is the embedded controller
echoing out settings for the Windows application armoury-crate to
check if it is still in sync.
Tested on Asus ROG G14/G15 series laptops.
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 | 60 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 60 insertions(+), 1 deletion(-)
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
From: Ionut Nechita <redacted>
Use the existing HID_UP_ASUSVENDOR constant instead of the magic number
0xff310000 for better code clarity and maintainability.
Change-Id: I65cf58cd0cd47acc39b755fa9a5fb7f2ad271046
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
From: Ionut Nechita <redacted>
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
Signed-off-by: Ionut Nechita <redacted>
@@ -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.+ */
Pretty much all ASUS laptops do, not just G14 or G15, and it's not
only on keypresses.
+ 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.
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
From: Ionut Nechita <redacted>
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.
quoted hunk
- 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 <redacted>
---
drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 25 insertions(+)
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
quoted hunk
From: Ionut Nechita <redacted>
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.
Tested on Asus ROG G14/G15 series laptops.
Change-Id: Ic03df877b71e34c421e992a06e5e706d954e7dbf
Signed-off-by: Ionut Nechita <redacted>
---
drivers/hid/hid-asus.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
@@ -379,12 +382,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){-/*-*G14andG15sendthesecodesonsomekeypresseswithno-*discernablereasonfordoingso.Filterthemouttoavoid-*unmappedwarningmessages.-*/if(report->id==FEATURE_KBD_REPORT_ID){+/* Fn+F5 fan control key, send WMI event to toggle fan mode */+if(data[1]==ASUS_FAN_CTRL_KEY_CODE){+intret=asus_wmi_send_event(drvdata,ASUS_FAN_CTRL_KEY_CODE);+
What if asus-wmi is not compiled with the kernel?
Would it make sense, in that situation (or in case of a failure)
to tell userspace (via evdev) about the button press?
+ if (ret < 0)
+ hid_warn(hdev, "Failed to trigger fan control event\n");
+ return -1;
+ }
+
+ /*
+ * 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 (data[1] == ASUS_SPURIOUS_CODE_0XEA ||
data[1] == ASUS_SPURIOUS_CODE_0XEC ||
data[1] == ASUS_SPURIOUS_CODE_0X02 ||
From: Mario Limonciello <superm1@kernel.org> Date: 2026-01-07 15:12:36
On 1/7/26 5:19 AM, Ionut Nechita (Sunlight Linux) wrote:
From: Ionut Nechita <redacted>
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 <redacted>
Otherwise LGTM, feel free to add to next version.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
From: Mario Limonciello <superm1@kernel.org> Date: 2026-01-07 15:13:02
On 1/7/26 7:00 AM, Denis Benato wrote:
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
quoted
From: Ionut Nechita <redacted>
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>
From: Mario Limonciello <superm1@kernel.org> Date: 2026-01-07 15:14:52
On 1/7/26 7:07 AM, Denis Benato wrote:
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
quoted
From: Ionut Nechita <redacted>
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.
quoted
- 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 <redacted>
---
drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 25 insertions(+)
On 1/7/26 12:19, Ionut Nechita (Sunlight Linux) wrote:
quoted
From: Ionut Nechita <redacted>
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.
quoted
- 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 <redacted>
---
drivers/hid/hid-asus.c | 24 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 1 +
2 files changed, 25 insertions(+)