From: Nathan Chancellor <nathan@kernel.org>
To: Paolo Pisati <p.pisati@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org
Subject: Re: [PATCH 1/7] hid-asus: Fix up Zenbook Duo report descriptors
Date: Sat, 13 Jun 2026 12:19:53 -0400 [thread overview]
Message-ID: <20260613161953.GA2700668@ax162> (raw)
In-Reply-To: <20260513163248.16483-2-p.pisati@gmail.com>
Hi Paolo,
On Wed, May 13, 2026 at 06:32:42PM +0200, Paolo Pisati wrote:
> From: Joshua Leivenzon <hacker1024@users.sourceforge.net>
>
> This is similar to the T100CHI/T90CHI keyboard dock fix.
> Without it, all reports log:
>
> Unmapped Asus vendor usagepage code 0x76
>
> Signed-off-by: Joshua Leivenzon <hacker1024@users.sourceforge.net>
> ---
> drivers/hid/hid-asus.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 3f5e96900b67a..ce246efba74d3 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -99,6 +99,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
> #define QUIRK_ROG_CLAYMORE_II_KEYBOARD BIT(12)
> #define QUIRK_ROG_ALLY_XPAD BIT(13)
> #define QUIRK_HID_FN_LOCK BIT(14)
> +#define QUIRK_ZENBOOK_DUO_KEYBOARD BIT(15)
>
> #define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
> QUIRK_NO_INIT_REPORTS | \
> @@ -1384,17 +1385,20 @@ static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> hid_info(hdev, "Fixing up Asus T100 keyb report descriptor\n");
> rdesc[74] &= ~HID_MAIN_ITEM_CONSTANT;
> }
> - /* For the T100CHI/T90CHI keyboard dock */
> - if (drvdata->quirks & (QUIRK_T100CHI | QUIRK_T90CHI)) {
> + /* For the T100CHI/T90CHI keyboard dock and Zenbook Duo 2024+ keyboards */
> + if (drvdata->quirks & (QUIRK_T100CHI | QUIRK_T90CHI | QUIRK_ZENBOOK_DUO_KEYBOARD)) {
> int rsize_orig;
> int offs;
>
> if (drvdata->quirks & QUIRK_T100CHI) {
> rsize_orig = 403;
> offs = 388;
> - } else {
> + } else if (drvdata->quirks & QUIRK_T90CHI) {
> rsize_orig = 306;
> offs = 291;
> + } else if (drvdata->quirks & QUIRK_ZENBOOK_DUO_KEYBOARD) {
> + rsize_orig = 257;
> + offs = 176;
> }
The way this if block is now written will cause a clang warning:
https://lore.kernel.org/202606110526.QfgiXQTQ-lkp@intel.com/
It is obviously a false positive since we know one of those branches
will be taken from the parent if statement's condition.
Consider keeping the else, maybe with a comment, to make it clear to
both humans and the compiler that all cases are covered?
} else { /* QUIRK_ZENBOOK_DUO_KEYBOARD */
rsize_orig = 257;
offs = 176;
}
> /*
> @@ -1414,7 +1418,8 @@ static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
>
> hid_info(hdev, "Fixing up %s keyb report descriptor\n",
> drvdata->quirks & QUIRK_T100CHI ?
> - "T100CHI" : "T90CHI");
> + "T100CHI" : drvdata->quirks & QUIRK_T90CHI ?
> + "T90CHI" : "ZENBOOK DUO");
>
> memcpy(new_rdesc, rdesc, rsize_orig);
> *rsize = rsize_orig + 1;
> --
> 2.53.0
>
--
Cheers,
Nathan
next prev parent reply other threads:[~2026-06-13 16:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 16:32 [PATCH 0/7] ASUS Zenbook Duo keyboard support Paolo Pisati
2026-05-13 16:32 ` [PATCH 1/7] hid-asus: Fix up Zenbook Duo report descriptors Paolo Pisati
2026-05-14 6:50 ` sashiko-bot
2026-06-13 16:19 ` Nathan Chancellor [this message]
2026-05-13 16:32 ` [PATCH 2/7] hid-asus: Add missing Zenbook Duo hotkeys Paolo Pisati
2026-05-14 7:49 ` sashiko-bot
2026-05-13 16:32 ` [PATCH 3/7] hid-asus: Add report descriptor fixup offsets for UX8406MA USB keyboard Paolo Pisati
2026-05-13 16:32 ` [PATCH 4/7] hid-asus: Remove more bogus zero bytes from some report descriptors Paolo Pisati
2026-05-14 8:57 ` sashiko-bot
2026-05-13 16:32 ` [PATCH 5/7] hid-asus: Fix input mapping on dedicated vendor HID interfaces Paolo Pisati
2026-05-14 10:32 ` sashiko-bot
2026-05-13 16:32 ` [PATCH 6/7] hid-asus: Allow adding custom hotkey handler logic Paolo Pisati
2026-05-14 11:14 ` sashiko-bot
2026-05-13 16:32 ` [PATCH 7/7] hid-asus: add prod-id, quirk for Zenbook Duo keyboard Paolo Pisati
2026-05-14 12:03 ` sashiko-bot
2026-06-10 15:54 ` [PATCH 0/7] ASUS Zenbook Duo keyboard support Jiri Kosina
2026-06-10 18:06 ` Jiri Kosina
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=20260613161953.GA2700668@ax162 \
--to=nathan@kernel.org \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=p.pisati@gmail.com \
/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