summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-01-30 12:58:37 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-01-30 15:26:45 +1000
commitdc15a42d6cae4195d327253f6f05b65665eb3a93 (patch)
tree4d792347568fa7812ee71c0dcf68e0e5959a4550 /udev
parent078564ce7a590454c6bb9663d3a3017c56b0b7e2 (diff)
switch: for surface 3 tablets, write the lid open to the device
These tablets only ever give us a close event, the open event is broken. So when we detect keyboard events, fix the kernel device's state by writing the event to the fd. We still sync the lid state manually, in case this fails and we don't get the SW_LID through the normal event sequence. If it works fine, the real open event will just be ignored. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'udev')
-rw-r--r--udev/90-libinput-model-quirks.hwdb24
-rwxr-xr-xudev/parse_hwdb.py4
2 files changed, 18 insertions, 10 deletions
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index a5102d2..86eea0d 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -17,6 +17,15 @@
# Sort by brand, model
##########################################
+# Chassis types 9 (Laptop) and 10
+# (Notebook) are expected to have working
+# lid switches
+##########################################
+libinput:name:*Lid Switch*:dmi:*:ct10:*
+libinput:name:*Lid Switch*:dmi:*:ct9:*
+ LIBINPUT_ATTR_LID_SWITCH_RELIABILITY=reliable
+
+##########################################
# ALPS
##########################################
libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:dmi:*
@@ -151,6 +160,13 @@ libinput:name:*Logitech M570*:dmi:*
LIBINPUT_MODEL_TRACKBALL=1
##########################################
+# Microsoft
+##########################################
+# Surface3 needs us to write the open lid switch event
+libinput:name:*Lid Switch*:dmi:*svnMicrosoftCorporation:pnSurface3:*
+ LIBINPUT_ATTR_LID_SWITCH_RELIABILITY=write_open
+
+##########################################
# Synaptics
##########################################
libinput:touchpad:input:b0011v0002p0007*
@@ -188,11 +204,3 @@ libinput:touchpad:input:b0003v056Ap*
libinput:name:*Trackball*:dmi:*
LIBINPUT_MODEL_TRACKBALL=1
-##########################################
-# Chassis types 9 (Laptop) and 10
-# (Notebook) are expected to have working
-# lid switches
-##########################################
-libinput:name:*Lid Switch*:dmi:*:ct10:*
-libinput:name:*Lid Switch*:dmi:*:ct9:*
- LIBINPUT_ATTR_LID_SWITCH_RELIABILITY=reliable
diff --git a/udev/parse_hwdb.py b/udev/parse_hwdb.py
index 102ef6c..d079be2 100755
--- a/udev/parse_hwdb.py
+++ b/udev/parse_hwdb.py
@@ -102,10 +102,10 @@ def property_grammar():
size_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
for name, val in sz_props]
- reliability_tags = (Literal("reliable"))
+ reliability_tags = Or(('reliable', 'write_open'))
reliability = [Literal('LIBINPUT_ATTR_LID_SWITCH_RELIABILITY')('NAME') -
Suppress('=') -
- Group(OneOrMore(reliability_tags))('VALUE')]
+ reliability_tags('VALUE')]
grammar = Or(model_props + size_props + reliability)