Skip to content

RFC platform/x86: Add and use a dual_accel_detect() helper

Hans de Goede linux-acpi platform-driver-x86 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1platform/x86: Add and use a dual_accel_detect() helperdrivers/platform/x86/Kconfig drivers/platform/x86/dual_accel_detect.h drivers/platform/x86/intel-hid.c +2 more+101 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/1] platform/x86: Add and use a dual_accel_detect() helper

Hi All,

I've marked this as a RFC because I'm waiting for feedback from the bug-reporter to check if this actually fixes his issue. But I fully expect it will (I already tested this on some of my own hw).

IOW I don't expect this patch to change before I will merge it, so please review.

Here is more info from the commit msg:

"""
Various 360 degree hinges (yoga) style 2-in-1 devices use 2 accelerometers to allow the OS to determine the angle between the display and the base of the device.

On Windows these are read by a special HingeAngleService process which calls undocumented ACPI methods, to let the firmware know if the 2-in-1 is in tablet- or laptop-mode. The firmware may use this to disable the kbd and touchpad to avoid spurious input in tablet-mode as well as to report SW_TABLET_MODE info to the OS.

Since Linux does not call these undocumented methods, the SW_TABLET_MODE info reported by various pdx86 drivers is incorrect on these devices.

Before this commit the intel-hid and thinkpad_acpi code already had 2 hardcoded checks for ACPI hardware-ids of dual-accel sensors to avoid reporting broken info.

And now we also have a bug-report about the same problem in the intel-vbtn code. Since there are at least 3 different ACPI hardware-ids in play, add a new dual_accel_detect() helper which checks for all 3, rather then adding different hardware-ids to the drivers as bug-reports trickle in. """

Regards,

Hans

Hans de Goede (1):
platform/x86: Add and use a dual_accel_detect() helper

 drivers/platform/x86/Kconfig             |  3 +
 drivers/platform/x86/dual_accel_detect.h | 75 ++++++++++++++++++++++++
 drivers/platform/x86/intel-hid.c         | 21 ++-----
 drivers/platform/x86/intel-vbtn.c        | 18 +++++-
 drivers/platform/x86/thinkpad_acpi.c     |  3 +-
 5 files changed, 101 insertions(+), 19 deletions(-)
 create mode 100644 drivers/platform/x86/dual_accel_detect.h
Signature · 1 line
2.31.1