From: Aoto <aoto.tokizawa@gmail.com>
To: linux-input@vger.kernel.org, konrad.dybcio@oss.qualcomm.com,
jikos@kernel.org, bentiss@kernel.org
Cc: Aoto Tokizawa <aoto.tokizawa@gmail.com>
Subject: [PATCH] HID: asus: support the Zenbook A14 (UX3407QA) keyboard
Date: Mon, 21 Sep 2026 16:37:29 -0700 [thread overview]
Message-ID: <20260921233729.1286-1-aoto.tokizawa@gmail.com> (raw)
From: Aoto Tokizawa <aoto.tokizawa@gmail.com>
Signed-off-by: Aoto Tokizawa <aoto.tokizawa@gmail.com>
---
drivers/hid/hid-asus.c | 48 ++++++++++++++++++++++++++++++++++++------
drivers/hid/hid-ids.h | 1 +
2 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index c38a2b3b33d9..5e068d0668fe 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -100,6 +100,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define QUIRK_ROG_ALLY_XPAD BIT(13)
#define QUIRK_HID_FN_LOCK BIT(14)
#define QUIRK_FILTER_CAMERA_COMPANION BIT(15)
+#define QUIRK_NO_KBD_INIT BIT(16)
+#define QUIRK_A14_KEYBOARD BIT(17)
#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
QUIRK_NO_INIT_REPORTS | \
@@ -169,6 +171,7 @@ struct asus_drvdata {
bool battery_in_query;
unsigned long battery_next_query;
struct asus_hid_listener listener;
+ struct led_classdev kbd_backlight;
bool fn_lock;
};
@@ -939,6 +942,16 @@ static bool asus_has_report_id(struct hid_device *hdev, u16 report_id)
return false;
}
+static int asus_kbd_backlight_set_blocking(struct led_classdev *led,
+ enum led_brightness brightness)
+{
+ struct asus_drvdata *drvdata =
+ container_of(led, struct asus_drvdata, kbd_backlight);
+
+ asus_kbd_set_brightness(drvdata->hdev, brightness);
+ return 0;
+}
+
static int asus_kbd_register_leds(struct hid_device *hdev)
{
struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
@@ -969,6 +982,24 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
le16_to_cpu(udev->descriptor.idProduct));
}
+ if ((drvdata->quirks & QUIRK_A14_KEYBOARD)) {
+ const u8 buf[FEATURE_KBD_REPORT_SIZE] = {
+ FEATURE_KBD_REPORT_ID, 0xd0, 0x8f, 0x01
+ };
+
+ ret = asus_kbd_set_report(hdev, buf, sizeof(buf));
+ if (ret < 0)
+ return ret;
+
+ drvdata->kbd_backlight.name = "asus::kbd_backlight";
+ drvdata->kbd_backlight.max_brightness = 3;
+ drvdata->kbd_backlight.brightness_set_blocking =
+ asus_kbd_backlight_set_blocking;
+
+ return devm_led_classdev_register(&hdev->dev,
+ &drvdata->kbd_backlight);
+ }
+
drvdata->listener.brightness_set = asus_kbd_backlight_set;
ret = asus_hid_register_listener(&drvdata->listener);
if (ret < 0) {
@@ -1493,12 +1524,14 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
return ret;
}
- for (int r = 0; r < ARRAY_SIZE(asus_report_id_init); r++) {
- if (asus_has_report_id(hdev, asus_report_id_init[r])) {
- ret = asus_kbd_init(hdev, asus_report_id_init[r]);
- if (ret < 0)
- hid_warn(hdev, "Failed to initialize 0x%x: %d.\n",
- asus_report_id_init[r], ret);
+ if (!(drvdata->quirks & QUIRK_NO_KBD_INIT)) {
+ for (int r = 0; r < ARRAY_SIZE(asus_report_id_init); r++) {
+ if (asus_has_report_id(hdev, asus_report_id_init[r])) {
+ ret = asus_kbd_init(hdev, asus_report_id_init[r]);
+ if (ret < 0)
+ hid_warn(hdev, "Failed to initialize 0x%x: %d.\n",
+ asus_report_id_init[r], ret);
+ }
}
}
@@ -1670,6 +1703,9 @@ static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
static const struct hid_device_id asus_devices[] = {
{ HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD), I2C_KEYBOARD_QUIRKS},
+ { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
+ USB_DEVICE_ID_ASUSTEK_I2C_ZENBOOK_A14_KEYBOARD),
+ QUIRK_NO_KBD_INIT | QUIRK_USE_KBD_BACKLIGHT | QUIRK_A14_KEYBOARD },
{ HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
USB_DEVICE_ID_ASUSTEK_I2C_ZENBOOK_KEYBOARD),
I2C_KEYBOARD_QUIRKS | QUIRK_FILTER_CAMERA_COMPANION },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index b3aca5aa9176..a665863b11b8 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -219,6 +219,7 @@
#define USB_DEVICE_ID_ASUSTEK_T100CHI_KEYBOARD 0x8502
#define USB_DEVICE_ID_ASUSTEK_T101HA_KEYBOARD 0x183d
#define USB_DEVICE_ID_ASUSTEK_T304_KEYBOARD 0x184a
+#define USB_DEVICE_ID_ASUSTEK_I2C_ZENBOOK_A14_KEYBOARD 0x0220
#define USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD 0x8585
#define USB_DEVICE_ID_ASUSTEK_I2C_ZENBOOK_KEYBOARD 0x4b42
#define USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD 0x0101
--
2.55.0
reply other threads:[~2026-09-21 23:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260921233729.1286-1-aoto.tokizawa@gmail.com \
--to=aoto.tokizawa@gmail.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox