summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-01-25 17:41:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-01-30 15:26:44 +1000
commit2a8d64c02d5326900703d6ea65a9e0edd74d5678 (patch)
tree28eb1278494c57a7d9eeddab0ef9193898cfe6b8 /udev
parent4eb29a8cc5eb36962a6cb14be032a4ca09296ffb (diff)
udev: mark all laptops as lid switch reliable
If the chassis type is 9 or 10 (Laptop, Notebook) let's assume that our lid switch works. On anything else we leave it at unknown. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'udev')
-rw-r--r--udev/90-libinput-model-quirks.hwdb9
-rwxr-xr-xudev/parse_hwdb.py8
2 files changed, 16 insertions, 1 deletions
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 04bdf9a3..a5102d2f 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -187,3 +187,12 @@ 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 d90c90fc..102ef6c8 100755
--- a/udev/parse_hwdb.py
+++ b/udev/parse_hwdb.py
@@ -98,10 +98,16 @@ def property_grammar():
('LIBINPUT_ATTR_SIZE_HINT', Group(dimension('SETTINGS*'))),
('LIBINPUT_ATTR_RESOLUTION_HINT', Group(dimension('SETTINGS*'))),
)
+
size_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
for name, val in sz_props]
- grammar = Or(model_props + size_props);
+ reliability_tags = (Literal("reliable"))
+ reliability = [Literal('LIBINPUT_ATTR_LID_SWITCH_RELIABILITY')('NAME') -
+ Suppress('=') -
+ Group(OneOrMore(reliability_tags))('VALUE')]
+
+ grammar = Or(model_props + size_props + reliability)
return grammar