Re: [PATCH v5] platform/x86/lenovo: Add Yoga Book 9 keyboard dock detection driver

From: johannes . goede

Date: Mon Jun 08 2026 - 15:23:25 EST


Hi,

On 8-Jun-26 21:05, Dave Carey wrote:
> Hi Hans,
>
> Confirmed: on the YB9, both lenovo-ymc and yb9-kbdock register input
> nodes with SW_TABLET_MODE in their capability bitmap (SW=2 in
> /proc/bus/input/devices). You are right that this is a problem
> regardless of which one fires events -- GNOME reads the capability at
> startup.
>
> The recommended fix would be: add a DMI blocklist to lenovo_ymc_probe()
> to return early on the Yoga Book 9, matching on:
>
> DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> DMI_MATCH(DMI_PRODUCT_NAME, "83KJ"),
>
> That leaves yb9-kbdock as the sole SW_TABLET_MODE source on this
> hardware.

Ack, that sounds like the right approach.


> Two questions on how you'd like to proceed:
>
> 1. Should the lenovo-ymc fix come as a standalone patch, or would you
> prefer a v6 2-patch series with the ymc change as patch 1/2 and the
> kbdock driver as patch 2/2?

I think a v6 series makes most sense, even if one of the patches
is just an unmodified reposting of this v5.

> 2. For the early return in probe(): you suggested "return 0" to avoid
> WMI framework error messages. That requires a NULL guard in
> lenovo_ymc_notify() since priv is never set in that path. Is that
> the right approach, or would you prefer a different pattern?

My bad, that should be -ENODEV, so that the driver does not count
as being bound, while still suppressing errors from the caller of
probe. That should avoid lenovo_ymc_notify() getting called.

Assuming there is no other functionality in lenovo-ymc we care
about ...

Regards,

Hans