Commit graph

4 commits

Author SHA1 Message Date
Peter Hutterer
9dbcc68621 test: auto-generate the udev rules
We only ever set properties in the devices, so let's make that more explicit
and auto-generate the udev rule. This way we're hopefully better protected
from the various typos that hid in those rules over the years, but also be
prepared for passing the udev property key/value pairs elsewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-14 08:52:58 +10:00
Peter Hutterer
639ed0b641 Switch from udev property parsing to the quirks system
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:37:22 +10:00
Peter Hutterer
2346801b0e test: switch to a TEST_DEVICE macro for all the litest test devices
The test device initialization code was a bit of duplicated boilerplate and
required adding a reference to the devices to the 'devices' list in litest.c.
Automate this with a new TEST_DEVICE macro that adds the devices to a custom
section in the binary, then loops throught that section to get the device out.

This reduces the boilerplate for each test device to just the TEST_MACRO and
the LITEST_foo device enum entry. It also now automates the shortname of the
device.

The device's shortname was standardised in this approach as well, lowercase
and dashes only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-21 15:06:17 +10:00
Peter Hutterer
dc15a42d6c 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>
2017-01-30 15:26:45 +10:00