[PATCH libinput 0/4] Lenovo X1 Carbon 3rd support
Hans de Goede
hdegoede at redhat.com
Thu Jan 29 00:48:04 PST 2015
Hi,
On 29-01-15 05:55, Peter Hutterer wrote:
>
> Lenovo is back with a new generation hardware, the trackpoint's physical
> buttons are back, and our headache is back too. Lenovo decided to wire the
> buttons to the touchpad so they show up as BTN_0, 1, 2. Which means we have
> to re-route them through the trackpoint device, much like we already do for
> the T440 generation software buttons.
>
> So we have one more special case for this hardware and need to treat it
> separately. Turned out to be relatively easy, but we need udev to tag the
> device for us - BTN_0 etc. are overloaded on other touchpads for scroll
> buttons [1] so we can't just apply this on the general case.
I'm not entirely happy with these bits:
@@ -1107,6 +1107,12 @@ tp_tag_device(struct evdev_device *device,
if (udev_device_get_property_value(udev_device,
"TOUCHPAD_HAS_TRACKPOINT_BUTTONS"))
device->tags |= EVDEV_TAG_TOUCHPAD_TRACKPOINT;
+
+ /* Magic version tag: used by the litest device. Should never be set
+ * in real life but allows us to test for these features without
+ * requiring custom udev rules during make check */
+ if (libevdev_get_id_version(device->evdev) == 0xfffa)
+ device->tags |= EVDEV_TAG_TOUCHPAD_TRACKPOINT;
}
static struct evdev_dispatch_interface tp_interface = {
@@ -65,6 +65,7 @@ static struct input_id input_id = {
.bustype = 0x11,
.vendor = 0x2,
.product = 0x7,
+ .version = 0xfffa, /* Magic value, used to detect this test device */
};
static int events[] = {
But I cannot think of a better solution either... So lets go with this for
now. We may need to rethink this when we get more udev properties which we
also want to use in the test-suite.
The entire series is:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Regards,
Hans
More information about the wayland-devel
mailing list