diff mbox series

[06/11] HID: asus: introduce small delay on Asus Z13 RGB init

Message ID 20250319191320.10092-7-lkml@antheas.dev (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series HID: asus: hid-asus and asus-wmi backlight unification, Z13 QOL improvements | expand

Commit Message

Antheas Kapenekakis March 19, 2025, 7:13 p.m. UTC
The folio keyboard of the Z13 can get stuck in its BIOS mode, where the
touchpad behaves like a mouse and the keyboard start button is not
reliable if we perform the initialization too quickly. This mostly
happens during boot, and can be verified to be caused by hid-asus
through simple blacklisting. A small delay fixes it.

Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
 drivers/hid/hid-asus.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Luke D. Jones March 20, 2025, 7:12 a.m. UTC | #1
On 20/03/25 08:13, Antheas Kapenekakis wrote:
> The folio keyboard of the Z13 can get stuck in its BIOS mode, where the
> touchpad behaves like a mouse and the keyboard start button is not
> reliable if we perform the initialization too quickly. This mostly
> happens during boot, and can be verified to be caused by hid-asus
> through simple blacklisting. A small delay fixes it.
> 
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> ---
>   drivers/hid/hid-asus.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 85ae75478b796..5b75ee83ae290 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -571,6 +571,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
>   	unsigned char kbd_func;
>   	int ret;
>   
> +	/* Wait a bit before init to prevent locking the keyboard */
> +	if (dmi_match(DMI_PRODUCT_FAMILY, "ROG Flow Z13"))
> +		msleep(500);
> +
>   	ret = asus_kbd_init(hdev);
>   	if (ret < 0)
>   		return ret;

See my comment on patch 1 about trying a loop with the init 
request/response as a hopeful way to test readiness.

Cheers,
Luke.
Antheas Kapenekakis March 20, 2025, 8:30 a.m. UTC | #2
On Thu, 20 Mar 2025 at 08:12, Luke D. Jones <luke@ljones.dev> wrote:
>
> On 20/03/25 08:13, Antheas Kapenekakis wrote:
> > The folio keyboard of the Z13 can get stuck in its BIOS mode, where the
> > touchpad behaves like a mouse and the keyboard start button is not
> > reliable if we perform the initialization too quickly. This mostly
> > happens during boot, and can be verified to be caused by hid-asus
> > through simple blacklisting. A small delay fixes it.
> >
> > Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> > ---
> >   drivers/hid/hid-asus.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> > index 85ae75478b796..5b75ee83ae290 100644
> > --- a/drivers/hid/hid-asus.c
> > +++ b/drivers/hid/hid-asus.c
> > @@ -571,6 +571,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
> >       unsigned char kbd_func;
> >       int ret;
> >
> > +     /* Wait a bit before init to prevent locking the keyboard */
> > +     if (dmi_match(DMI_PRODUCT_FAMILY, "ROG Flow Z13"))
> > +             msleep(500);
> > +
> >       ret = asus_kbd_init(hdev);
> >       if (ret < 0)
> >               return ret;
>
> See my comment on patch 1 about trying a loop with the init
> request/response as a hopeful way to test readiness.
>
> Cheers,
> Luke.

Turns out there isn't an init problem. I have removed this patch from V2.

It was hid-asus taking control of the touchpad from hid-multitouch. So
adding HID_GROUP_GENERIC fixes this. I replaced it with that and
squashed the rename patch alongside it.

Antheas
Luke D. Jones March 20, 2025, 9:03 p.m. UTC | #3
On 20/03/25 21:30, Antheas Kapenekakis wrote:
> On Thu, 20 Mar 2025 at 08:12, Luke D. Jones <luke@ljones.dev> wrote:
>>
>> On 20/03/25 08:13, Antheas Kapenekakis wrote:
>>> The folio keyboard of the Z13 can get stuck in its BIOS mode, where the
>>> touchpad behaves like a mouse and the keyboard start button is not
>>> reliable if we perform the initialization too quickly. This mostly
>>> happens during boot, and can be verified to be caused by hid-asus
>>> through simple blacklisting. A small delay fixes it.
>>>
>>> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
>>> ---
>>>    drivers/hid/hid-asus.c | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
>>> index 85ae75478b796..5b75ee83ae290 100644
>>> --- a/drivers/hid/hid-asus.c
>>> +++ b/drivers/hid/hid-asus.c
>>> @@ -571,6 +571,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
>>>        unsigned char kbd_func;
>>>        int ret;
>>>
>>> +     /* Wait a bit before init to prevent locking the keyboard */
>>> +     if (dmi_match(DMI_PRODUCT_FAMILY, "ROG Flow Z13"))
>>> +             msleep(500);
>>> +
>>>        ret = asus_kbd_init(hdev);
>>>        if (ret < 0)
>>>                return ret;
>>
>> See my comment on patch 1 about trying a loop with the init
>> request/response as a hopeful way to test readiness.
>>
>> Cheers,
>> Luke.
> 
> Turns out there isn't an init problem. I have removed this patch from V2.
> 
> It was hid-asus taking control of the touchpad from hid-multitouch. So
> adding HID_GROUP_GENERIC fixes this. I replaced it with that and
> squashed the rename patch alongside it.
> 
> Antheas

Awesome. Is this the one on `#define INPUT_REPORT_ID 0x5d`?
diff mbox series

Patch

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 85ae75478b796..5b75ee83ae290 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -571,6 +571,10 @@  static int asus_kbd_register_leds(struct hid_device *hdev)
 	unsigned char kbd_func;
 	int ret;
 
+	/* Wait a bit before init to prevent locking the keyboard */
+	if (dmi_match(DMI_PRODUCT_FAMILY, "ROG Flow Z13"))
+		msleep(500);
+
 	ret = asus_kbd_init(hdev);
 	if (ret < 0)
 		return ret;