Re: [PATCH v3 7/7] HID: asus: Re-send the Zenbook Duo keyboard handshake after probe
From: Denis Benato
Date: Sun Oct 18 2026 - 13:11:08 EST
On 10/13/26 12:40, Paolo Pisati wrote:
> From: Rebecca Mara Müller <rebecca.mara@xxxxxxxxx>
>
> When docked, the Zenbook Duo keyboard powers up in F-key mode and
> needs the "ASUS Tech.Inc." handshake to emit hotkeys at all. The
> handshake sent from probe is lost again when hid-multitouch configures
> the touchpad on the sibling USB interface, which resets the keyboard
> to F-key mode, so the hotkeys stop working as soon as the touchpad is
> set up.
>
> Re-send the handshake from delayed work two seconds after probe.
So this patch is based on an arbitrary wait that is based on the
assumption that some other device gets initialized...
Can you try making this deterministic? Maybe returning from
_probe a specific value will postpone binding of this driver after
all other drivers and you can comment in code why it was done...
Or perhaps you can setup some way of hid-multitouch to signal
completion?
Regardless I will also review what we have here in case this ends
up to be the best way to go.
> Assisted-by: LLM
> Signed-off-by: Rebecca Mara Müller <rebecca.mara@xxxxxxxxx>
> Link: https://lore.kernel.org/r/20260811125548.1975748-1-rebecca.mara@xxxxxxxxx
> [pisati: taken from Rebecca's standalone UX8407AA patch and adapted to
> the current driver; initialize and cancel the work unconditionally]
> Assisted-by: LLM
> Signed-off-by: Paolo Pisati <p.pisati@xxxxxxxxx>
> ---
> drivers/hid/hid-asus.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 503396963eeb..ce413eb011c4 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -173,6 +173,7 @@ struct asus_drvdata {
> unsigned long battery_next_query;
> struct asus_hid_listener listener;
> bool fn_lock;
> + struct delayed_work reinit_work;
Why not reusing the workqueue we have already?
> };
>
> static int asus_report_battery(struct asus_drvdata *, u8 *, int);
> @@ -1474,6 +1475,17 @@ static int __maybe_unused asus_reset_resume(struct hid_device *hdev)
> return 0;
> }
>
> +static void asus_reinit_work(struct work_struct *work)
> +{
> + struct asus_drvdata *drvdata = container_of(work, struct asus_drvdata,
> + reinit_work.work);
> + int ret;
> +
> + ret = asus_kbd_init(drvdata->hdev, FEATURE_KBD_REPORT_ID);
> + if (ret < 0)
> + hid_warn(drvdata->hdev, "Failed to re-initialize the keyboard: %d\n", ret);
> +}
> +
> static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
> {
> struct hid_report_enum *rep_enum;
> @@ -1570,6 +1582,8 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
> is_vendor = true;
> }
>
> + INIT_DELAYED_WORK(&drvdata->reinit_work, asus_reinit_work);
> +
> ret = asus_worker_create(hdev, drvdata);
> if (ret) {
> hid_warn(hdev, "Failed to initialize worker: %d\n", ret);
> @@ -1605,6 +1619,16 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
> }
> }
>
> + /*
> + * When docked, the Zenbook Duo keyboard drops back to F-key mode when
> + * hid-multitouch configures the touchpad on the sibling USB interface,
> + * which can happen after the handshake above. Send it again once the
> + * dust has settled.
> + */
> + if (is_vendor && (drvdata->quirks & QUIRK_ZENBOOK_DUO_KEYBOARD) &&
> + hid_is_usb(hdev))
> + schedule_delayed_work(&drvdata->reinit_work, msecs_to_jiffies(2000));
> +
> /* Laptops keyboard backlight is always at 0x5a */
> if (is_vendor && (drvdata->quirks & QUIRK_USE_KBD_BACKLIGHT) &&
> (asus_has_report_id(hdev, FEATURE_KBD_REPORT_ID)) &&
> @@ -1639,6 +1663,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
>
> return 0;
> err_stop_hw:
> + cancel_delayed_work_sync(&drvdata->reinit_work);
> if (drvdata->listener.brightness_set)
> asus_hid_unregister_listener(&drvdata->listener);
>
> @@ -1654,6 +1679,7 @@ static void asus_remove(struct hid_device *hdev)
> if (drvdata->listener.brightness_set)
> asus_hid_unregister_listener(&drvdata->listener);
>
> + cancel_delayed_work_sync(&drvdata->reinit_work);
> asus_worker_stop(drvdata->worker);
> hid_hw_stop(hdev);
> }