switch: for surface 3 tablets, write the lid open to the device
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 30 Jan 2017 02:58:37 +0000 (12:58 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 30 Jan 2017 05:26:45 +0000 (15:26 +1000)
commitdc15a42d6cae4195d327253f6f05b65665eb3a93
tree4d792347568fa7812ee71c0dcf68e0e5959a4550
parent078564ce7a590454c6bb9663d3a3017c56b0b7e2
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>
src/evdev-lid.c
src/libinput-util.c
src/libinput-util.h
test/Makefile.am
test/litest-device-lid-switch-surface3.c [new file with mode: 0644]
test/litest.c
test/litest.h
test/test-lid.c
udev/90-libinput-model-quirks.hwdb
udev/parse_hwdb.py