[PATCH v2 0/2] platform/x86: asus-wmi: make the tablet switch work on the ProArt PX13
Robin Everaars <[email protected]> Wed, 05 Aug 2026 14:11:20 +0000
| Newsgroups | org.kernel.vger.platform-driver-x86,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------2a493985d898c0e1ed00876b59350c340a0377c3cab0d6ea9895cbfc7322e2fb Content-Type: multipart/mixed; boundary=38bc989c5136bca246adc4176316ef3db2d6f026fb38fe4f2cc43d89c555 From: Robin Everaars <[email protected]> To: [email protected], [email protected] Cc: [email protected], [email protected], [email protected], [email protected], [email protected] Subject: [PATCH v2 0/2] platform/x86: asus-wmi: make the tablet switch work on the ProArt PX13 Date: Wed, 5 Aug 2026 16:11:12 +0200 Message-ID: <[email protected]> X-Mailer: git-send-email 2.55.0 In-Reply-To: <[email protected]> References: <[email protected]> MIME-Version: 1.0 --38bc989c5136bca246adc4176316ef3db2d6f026fb38fe4f2cc43d89c555 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Changes in v2: - Patch 1: use FIELD_GET() for the presence and state bits instead of open mask-and-test, and add the linux/bitfiel d.h include it needs. Suggested by Denis Benato. This also drops the !! on the return, since FIELD_GET already yields 0 or 1. No functional change; re-tested on the same machine. - No other changes. Patch 2 is unchanged. Note that asus-wmi.c had no FIELD_GET() users before this, and the neighbouring asus_wmi_dev_is_present() still open-codes the same presence test, so the file is now mixed. Happy to send a separate cleanup converting the remaining ASUS_WMI_DSTS_* users, and the masks in asus-wmi.h to BIT(), if that is wanted; it seemed wrong to fold unrelated churn into a fix. v1: https://lore.kernel.org/platform-driver-x86/[email protected]/ 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 | 56 +++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) base-commit: aca 39607c1734ed976fdd65deb75b3555a5a0326 -- 2.55.0 --38bc989c5136bca246adc4176316ef3db2d6f026fb38fe4f2cc43d89c555 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="publickey - [email protected] - 0x8B6BA132.asc"; name="publickey - [email protected] - 0x8B6BA132.asc" Content-Type: application/pgp-keys; filename="publickey - [email protected] - 0x8B6BA132.asc"; name="publickey - [email protected] - 0x8B6BA132.asc" LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCkNvbW1lbnQ6IGh0dHBzOi8vZ29w ZW5wZ3Aub3JnClZlcnNpb246IEdv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dQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQ== --38bc989c5136bca246adc4176316ef3db2d6f026fb38fe4f2cc43d89c555-- --------2a493985d898c0e1ed00876b59350c340a0377c3cab0d6ea9895cbfc7322e2fb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wqsEARYIAF0FgmpzRIgJEB3Ff2vLBhqKNRQAAAAAABwAEHNhbHRAbm90YXRp b25zLm9wZW5wZ3Bqcy5vcmf0kS9YJD5knszmMw2zATKOFiEEi2uhMrb2XujF nFjLHcV/a8sGGooAAAF8AQDv+KSker4hSxoSu85+y/NyiBpJAtitwiWDeduw ClQgOgD/RE8tb4BTdR/x7z7QmWNZ7KvP6ooFP/+zlNN7sltAAw8= =rYjd -----END PGP SIGNATURE----- --------2a493985d898c0e1ed00876b59350c340a0377c3cab0d6ea9895cbfc7322e2fb--