From b60416083ecc6edd2961d85dd431381bf02047e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Santamar=C3=ADa=20Rogado?= Date: Fri, 2 Jan 2026 05:55:33 +0100 Subject: [PATCH] quirks: rework tablet mode using chassis type Don't disable inputs for detachable and tablet devices, they are physically unplugged from their input devices but tend to have buttons as internal keyboard in the tablet part that must work always. We know what kind of device is using the Chassis Type DMI value. Also remove specific device quirks now covered by the chassis type. Finally refactor some Lenovo devices using this quirk and redefine Dell 2-in-1 with this quirk using chassis type. Part-of: --- quirks/10-generic-keyboard.quirks | 20 ++++++ quirks/30-vendor-microsoft.quirks | 5 -- quirks/50-system-acer.quirks | 5 +- quirks/50-system-asus.quirks | 6 -- quirks/50-system-dell.quirks | 26 +++----- quirks/50-system-lenovo.quirks | 102 ++++++++++------------------- quirks/50-system-minisforum.quirks | 5 -- 7 files changed, 63 insertions(+), 106 deletions(-) diff --git a/quirks/10-generic-keyboard.quirks b/quirks/10-generic-keyboard.quirks index 882f97bd..b08b5ca7 100644 --- a/quirks/10-generic-keyboard.quirks +++ b/quirks/10-generic-keyboard.quirks @@ -9,3 +9,23 @@ AttrKeyboardIntegration=internal MatchUdevType=keyboard MatchBus=bluetooth AttrKeyboardIntegration=external + +# Detachable devices usually have the tablet part buttons wired as ps2 keyboard, +# don't disable them when tablet-mode switch is in effect. +# DMI Chassis Type 20h (32 decimal) is Detachable as per SMBIOS specification. +[Detachable Device Buttons] +MatchBus=ps2 +MatchUdevType=keyboard +MatchDMIModalias=dmi:*:ct32:* +ModelTabletModeNoSuspend=1 + +# Tablet devices usually have the tablet part buttons wired as ps2 keyboard, +# despite being tablets some of them, e.g. Microsoft Surface Laptop Studio, +# expose tablet-mode switch, so don't disable the ps2 keyboard. +# Tablets that don't expose tablet-mode switch won't have any diference. +# DMI Chassis Type 1Eh (30 decimal) is Tablet as per SMBIOS specification. +[Tablet Device Buttons] +MatchBus=ps2 +MatchUdevType=keyboard +MatchDMIModalias=dmi:*:ct30:* +ModelTabletModeNoSuspend=1 diff --git a/quirks/30-vendor-microsoft.quirks b/quirks/30-vendor-microsoft.quirks index 27be091e..5a0be059 100644 --- a/quirks/30-vendor-microsoft.quirks +++ b/quirks/30-vendor-microsoft.quirks @@ -28,11 +28,6 @@ MatchUdevType=touchpad AttrPressureRange=25:10 AttrPalmPressureThreshold=500 -[Microsoft Surface Laptop Studio Built-In Peripherals] -MatchName=*Microsoft Surface* -MatchDMIModalias=dmi:*svnMicrosoftCorporation:*pnSurfaceLaptopStudio -ModelTabletModeNoSuspend=1 - [Microsoft Nano Transceiver v2.0] MatchUdevType=mouse MatchBus=usb diff --git a/quirks/50-system-acer.quirks b/quirks/50-system-acer.quirks index fcac08eb..38a983c2 100644 --- a/quirks/50-system-acer.quirks +++ b/quirks/50-system-acer.quirks @@ -1,7 +1,4 @@ -[Acer Switch Alpha 12] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnAcer:pnSwitchSA5-271:* -ModelTabletModeNoSuspend=1 +# Do not edit this file, it will be overwritten on update [Acer Spin 5] MatchName=AT Translated Set 2 keyboard diff --git a/quirks/50-system-asus.quirks b/quirks/50-system-asus.quirks index af6c51eb..e7615ba3 100644 --- a/quirks/50-system-asus.quirks +++ b/quirks/50-system-asus.quirks @@ -42,12 +42,6 @@ MatchProduct=0x1866 MatchUdevType=keyboard AttrKeyboardIntegration=internal -# don't disable volume buttons in tablet mode -[Asus ROG Flow Z13 2025 volume buttons] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnASUSTeKCOMPUTERINC.:pnROGFlowZ13GZ302EA_GZ302EA:* -ModelTabletModeNoSuspend=1 - # enable "disable touchpad while typing" to work with z13 keyboard [Asus ROG FLow Z13 2025 keyboard] MatchUdevType=keyboard diff --git a/quirks/50-system-dell.quirks b/quirks/50-system-dell.quirks index 52d66734..b1e6c086 100644 --- a/quirks/50-system-dell.quirks +++ b/quirks/50-system-dell.quirks @@ -84,21 +84,6 @@ MatchName=*DualPoint Stick MatchDMIModalias=dmi:*svnDellInc.:pnLatitudeE7470* AttrTrackpointMultiplier=0.125 -[Latitude 7275] -MatchName=*AT Translated Set 2 keyboard* -MatchDMIModalias=dmi:*:svnDellInc.:pnLatitude7275:* -ModelTabletModeNoSuspend=1 - -[Latitude 7285] -MatchName=*AT Translated Set 2 keyboard* -MatchDMIModalias=dmi:*:svnDellInc.:pnLatitude7285:* -ModelTabletModeNoSuspend=1 - -[Dell Pro Rugged Tablet] -MatchName=*AT Translated Set 2 keyboard* -MatchDMIModalias=dmi:*:svnDellInc.:pnDellProRugged*TabletRA*:* -ModelTabletModeNoSuspend=1 - [Latitude 7480 Touchpad] MatchName=DLL07A0* MatchDMIModalias=dmi:**bvnDellInc.:*:pnLatitude7480* @@ -125,9 +110,14 @@ MatchVendor=0x2575 MatchProduct=0x0204 ModelDellCanvasTotem=1 -[Dell 2-in-1 Models] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*:svnDellInc.:pn*2-in-1:* +# Dell 2-in-1s have DMI Chassis Type Convertible, match it as by name can be +# 2-in-1, 2n1 or even some models miss it in name. Also Dell respect this, even +# if they made a mistake they tend to fix it in firmware updates. +# DMI Chassis Type 1Fh (31 decimal) is Convertible as per SMBIOS specification. +[Dell 2-in-1 Model Buttons] +MatchBus=ps2 +MatchUdevType=keyboard +MatchDMIModalias=dmi:*:svnDellInc.:*:ct31:* ModelTabletModeNoSuspend=1 # This is a true pressurepad so disable pressure for contact size diff --git a/quirks/50-system-lenovo.quirks b/quirks/50-system-lenovo.quirks index 52494630..9ff9f66f 100644 --- a/quirks/50-system-lenovo.quirks +++ b/quirks/50-system-lenovo.quirks @@ -170,76 +170,23 @@ MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX1Carbon6th:* AttrEventCode=-ABS_MT_TOOL_TYPE ModelLenovoX1Gen6Touchpad=1 -[Lenovo X41 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnIBM:*pvrThinkPadX41Tablet:* +# IBM ThinkPad X41 Tablet identify itself as DMI Chassis Type: 0Ah 10 Notebook +# but it's really a convertible one and have buttons wired as ps2 keyboard, +# don't disable them when tablet-mode switch is in effect. +[IBM ThinkPad X41 Tablet Buttons] +MatchUdevType=keyboard +MatchBus=ps2 +MatchDMIModalias=dmi:*svnIBM:*:pvrThinkPadX41Tablet:* ModelTabletModeNoSuspend=1 -[Lenovo X60 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX60Tablet:* -ModelTabletModeNoSuspend=1 - -[Lenovo X61 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX61Tablet:* -ModelTabletModeNoSuspend=1 - -# Lenovo X220 Tablet special bezel buttons are associated to the -# keyboard and would therefore mistakenly be deactivated as well. -# See https://gitlab.freedesktop.org/libinput/libinput/issues/154 -[Lenovo X220 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX220Tablet:* -ModelTabletModeNoSuspend=1 - -# Special bezel button deactivation with -# keyboard also applies to X230 Tablet -[Lenovo X230 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX230Tablet:* -ModelTabletModeNoSuspend=1 - -# Special bezel button deactivation with -# keyboard also applies to X200 Tablet -[Lenovo X200 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX200Tablet:* -ModelTabletModeNoSuspend=1 - -[Lenovo X201 Tablet] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX201Tablet:* -ModelTabletModeNoSuspend=1 - -# Lenovo MIIX 720 comes with a detachable keyboard. We must not disable -# the keyboard because some keys are still accessible on the screen and -# volume rocker. See -# https://gitlab.freedesktop.org/libinput/libinput/issues/115 -[Lenovo MIIX 720] -MatchName=AT Raw Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrLenovoMIIX720-12IKB:* -ModelTabletModeNoSuspend=1 - -# Lenovo ThinkPad X1 Tablet (1st Gen) also comes with a detachable keyboard. -# We must not disable the keyboard because some keys are still accessible on -# volume rocker. -[Lenovo ThinkPad X1 Tablet (1st Gen)] -MatchName=AT Raw Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX1Tablet:* -ModelTabletModeNoSuspend=1 - -# Duet 7i tablet switch activated by folding keyboard cover, or removing it. -# We must not disable volume rocker 'keyboard'. -[Lenovo Duet 7i] -MatchName=AT Raw Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrYogaDuet713IML05:* -ModelTabletModeNoSuspend=1 - -# Lenovo IdeaPad Duet 3 also comes with a detachable keyboard. -[Lenovo IdeaPad Duet 3] -MatchName=AT Raw Set 2 keyboard -MatchDMIModalias=dmi:*svnLENOVO:*pvrIdeaPadDuet3*:* +# Lenovo ThinkPad X60 X61 X200 X201 X220 X230 Tablets identify themselves as +# DMI Chassis Type: 0Ah 10 Notebook but they are really convertibles ones and +# have buttons wired as ps2 keyboard, don't disable them when tablet-mode switch +# is in effect. +[Lenovo ThinkPad X Tablet Series Buttons] +MatchUdevType=keyboard +MatchBus=ps2 +MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadX*Tablet:* ModelTabletModeNoSuspend=1 # Modifies pressure range to avoid random jumps. @@ -274,3 +221,22 @@ AttrTrackpointMultiplier=0.4 MatchName=* Touchpad MatchDMIModalias=dmi:*:svnLENOVO:*pvrYogaSlim7Carbon13IAP7:* AttrEventCode=-ABS_MT_TOOL_TYPE + +# Lenovo detachable devices prior to SMBIOS 3.0.0 specficiation (2015-02-12) +# when Tablet, Convertible and Detachable Chassis Types didn't exist use Hand +# Held. e.g. First Miix devices till Lenovo MIIX 300-10IBY (80NR) and initial +# firmware versions of Lenovo MIIX 310-10ICR (80SG). +# Match chassis and *MIIX* Product Version. +# DMI Chassis Type 0Bh (11 decimal) is Hand Held as per SMBIOS specification. +[Lenovo 1st Convertible Device Buttons] +MatchBus=ps2 +MatchUdevType=keyboard +MatchDMIModalias=dmi:*:svnLENOVO:*:pvr*MIIX*:*:ct11:* +ModelTabletModeNoSuspend=1 + +# Match also *Miix* Product Version. +[Lenovo 1st Convertible Device Buttons 2] +MatchBus=ps2 +MatchUdevType=keyboard +MatchDMIModalias=dmi:*:svnLENOVO:*:pvr*Miix*:*:ct11:* +ModelTabletModeNoSuspend=1 diff --git a/quirks/50-system-minisforum.quirks b/quirks/50-system-minisforum.quirks index 1e01f438..fcbc17fc 100644 --- a/quirks/50-system-minisforum.quirks +++ b/quirks/50-system-minisforum.quirks @@ -1,10 +1,5 @@ # Do not edit this file, it will be overwritten on update -[Minisforum V3 volume keys] -MatchName=AT Translated Set 2 keyboard -MatchDMIModalias=dmi:*svnMicroComputer(HK)TechLimited:pnV3:* -ModelTabletModeNoSuspend=1 - [Minisforum V3 touchpad dwt] MatchName=USB Keyboard MatchDMIModalias=dmi:*svnMicroComputer(HK)TechLimited:pnV3:*