[PATCH v7 0/2] platform/x86/lenovo: Add Yoga Book 9 keyboard dock detection driver

Dave Carey posted 2 patches 1 day ago
.../testing/sysfs-driver-lenovo-yb9-kbdock    |  19 +
MAINTAINERS                                   |   7 +
drivers/platform/x86/lenovo/Kconfig           |  14 +
drivers/platform/x86/lenovo/Makefile          |   1 +
drivers/platform/x86/lenovo/yb9-kbdock.c      | 317 ++++++++++++++++++
drivers/platform/x86/lenovo/ymc.c             |  19 +++++++++++++++
6 files changed, 377 insertions(+)
[PATCH v7 0/2] platform/x86/lenovo: Add Yoga Book 9 keyboard dock detection driver
Posted by Dave Carey 1 day ago
This series adds keyboard dock detection for the Lenovo Yoga Book 9
14IAH10 and fixes a pre-existing SW_TABLET_MODE conflict that the new
driver exposes.

Patch 1/2 fixes lenovo-ymc: it registers an input node advertising
SW_TABLET_MODE on the Yoga Book 9, but so does patch 2/2.  Userspace
(GNOME) reads SW_TABLET_MODE at login from every input node that
advertises the capability and does not tolerate two such nodes.  The fix
returns -ENODEV in lenovo-ymc probe() for this hardware; the
ymc_ec_trigger EC write is separately gated by a DMI table that already
excludes this machine, so no other functionality is affected.

Patch 2/2 is the keyboard dock driver.

Changes since v6:
- Use wmidev_query_block() in place of deprecated wmidev_block_query().
  Use __free(kfree) to manage the output buffer; simplify the parsing
  to a single length check now that the WMI core handles type conversion.
- Define BKBD_FIELD with GENMASK() and extract the field with FIELD_GET()
  instead of open-coded masking.
- Use guard(mutex) for all lock/unlock pairs.
- Add yb9_kbdock_sync_locked() helper to consolidate the duplicated
  initial-state read pattern in event_probe, block_probe, and resume.
- Add linux/bitfield.h, linux/cleanup.h, linux/slab.h includes.
- Fix comment on struct mutex field; use Context:/Returns: sections in
  the kerneldoc comment for yb9_kbdock_query_locked().

Dave Carey (2):
  platform/x86/lenovo: lenovo-ymc: Suppress probe on Yoga Book 9 14IAH10
  platform/x86/lenovo: Add Yoga Book 9 keyboard dock detection driver

 .../testing/sysfs-driver-lenovo-yb9-kbdock    |  19 +
 MAINTAINERS                                   |   7 +
 drivers/platform/x86/lenovo/Kconfig           |  14 +
 drivers/platform/x86/lenovo/Makefile          |   1 +
 drivers/platform/x86/lenovo/yb9-kbdock.c      | 317 ++++++++++++++++++
 drivers/platform/x86/lenovo/ymc.c             |  19 +++++++++++++++
 6 files changed, 377 insertions(+)

--
2.54.0