The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] platform/x86: asus-wmi: make the tablet switch work on the ProArt PX13
@ 2026-08-05 10:15 Robin Everaars
  2026-08-05 10:15 ` [PATCH 1/2] platform/x86: asus-wmi: keep the lid-flip state when UNKNOWN is set Robin Everaars
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Robin Everaars @ 2026-08-05 10:15 UTC (permalink / raw)
  To: hansg, ilpo.jarvinen
  Cc: corentin.chary, luke, denis.benato, platform-driver-x86,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2176 bytes --]

SW_TABLET_MODE never moves on an ASUS ProArt PX13 (HN7306EAC), and no
tablet_mode_sw value fixes it, because two independent things are in the way.

The first is a devstate quirk. The lid-flip devstate on this machine sets
ASUS_WMI_DSTS_UNKNOWN_BIT alongside the state bit while folded, so
ASUS_WMI_DEVID_LID_FLIP_ROG answers 0x00010000 open and 0x00010003 folded.
asus_wmi_get_devstate_simple() reads that bit as "state not known" and fails
with -ENODEV, throwing away a valid state that is sitting in bit 0.

The second is the devid/notify pairing. asus-wmi ties the devid it polls to the
one notify code it listens for, and tablet_mode_sw only offers fixed pairings.
This chassis reads the hinge at LID_FLIP_ROG but notifies with NOTIFY_LID_FLIP,
a combination no value covers: tablet_mode_sw=2 pins the switch on and suspends
the internal keyboard for good, while tablet_mode_sw=3 polls the right devid but
never hears the event.

Patch 1 adds a tablet-specific read that gates on
 the presence bit only, used
from the two tablet-switch paths and leaving every other
asus_wmi_get_devstate_simple() caller alone. Patch 2 accepts either lid-flip
notify code once a lid-flip switch is registered; both are the same "lid flip
action" event and both already map to KEY_PROG2 in the sparse keymap.

Machines with a keyboard-dock switch notify with 0x75 and are unaffected, and
with no switch registered the event code is 0 so the old equality test is what
still runs.

Tested on the one machine I have, an ASUS ProArt PX13 HN7306EAC: six clean
SW_TABLET_MODE transitions over three fold cycles with no stray KEY_PROG2, and
libinput suspends the internal keyboard and touchpad on fold and restores them
on unfold. I do not have another convertible to check the untouched paths on
hardware, so review of the dock case would be welcome.

Robin Everaars (2):
  platform/x86: asus-wmi: keep the lid-flip state when UNKNOWN is set
  platform/x86: asus-wmi: accept either lid-
flip notify code

 drivers/platform/x86/asus-wmi.c | 55 +++++++++++++++++++++++++++++++--
 1 file changed, 52 insertions(+), 3 deletions(-)


base-commit: aca39607c1734ed976fdd65deb75b3555a5a0326
-- 
2.55.0


[-- Attachment #1.2: publickey - robineveraars@pm.me - 0x8B6BA132.asc --]
[-- Type: application/pgp-keys, Size: 889 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 322 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-08-05 14:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 10:15 [PATCH 0/2] platform/x86: asus-wmi: make the tablet switch work on the ProArt PX13 Robin Everaars
2026-08-05 10:15 ` [PATCH 1/2] platform/x86: asus-wmi: keep the lid-flip state when UNKNOWN is set Robin Everaars
2026-08-05 12:07   ` Denis Benato
2026-08-05 10:15 ` [PATCH 2/2] platform/x86: asus-wmi: accept either lid-flip notify code Robin Everaars
2026-08-05 12:11   ` Denis Benato
2026-08-05 14:11 ` [PATCH v2 0/2] platform/x86: asus-wmi: make the tablet switch work on the ProArt PX13 Robin Everaars
2026-08-05 14:11   ` [PATCH v2 1/2] platform/x86: asus-wmi: keep the lid-flip state when UNKNOWN is set Robin Everaars
2026-08-05 14:11   ` [PATCH v2 2/2] platform/x86: asus-wmi: accept either lid-flip notify code Robin Everaars

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox