[PATCH libinput 4/4] Move Wacom touchpad tagging to the udev rules

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 4 23:41:32 PDT 2015


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad.c            | 5 +----
 src/evdev.c                        | 1 +
 src/evdev.h                        | 1 +
 udev/90-libinput-model-quirks.hwdb | 6 ++++++
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index f60265d..64cf468 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1388,7 +1388,6 @@ tp_init_palmdetect(struct tp_dispatch *tp,
 		   struct evdev_device *device)
 {
 	int width, height;
-	unsigned int vendor_id;
 
 	tp->palm.right_edge = INT_MAX;
 	tp->palm.left_edge = INT_MIN;
@@ -1399,11 +1398,9 @@ tp_init_palmdetect(struct tp_dispatch *tp,
 	height = abs(device->abs.absinfo_y->maximum -
 		    device->abs.absinfo_y->minimum);
 
-	vendor_id = evdev_device_get_id_vendor(device);
-
 	/* Wacom doesn't have internal touchpads,
 	 * Apple touchpads are always big enough to warrant palm detection */
-	if (vendor_id == VENDOR_ID_WACOM) {
+	if (device->model == EVDEV_MODEL_WACOM_TOUCHPAD) {
 		return 0;
 	} else if (device->model != EVDEV_MODEL_APPLE_TOUCHPAD) {
 		/* We don't know how big the touchpad is */
diff --git a/src/evdev.c b/src/evdev.c
index c1fe3e5..b8f798e 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1514,6 +1514,7 @@ evdev_read_model(struct evdev_device *device)
 		{ "LIBINPUT_MODEL_SYSTEM76_KUDU", EVDEV_MODEL_SYSTEM76_KUDU },
 		{ "LIBINPUT_MODEL_CLEVO_W740SU", EVDEV_MODEL_CLEVO_W740SU },
 		{ "LIBINPUT_MODEL_APPLE_TOUCHPAD", EVDEV_MODEL_APPLE_TOUCHPAD },
+		{ "LIBINPUT_MODEL_WACOM_TOUCHPAD", EVDEV_MODEL_WACOM_TOUCHPAD },
 		{ NULL, EVDEV_MODEL_DEFAULT },
 	};
 	const struct model_map *m = model_map;
diff --git a/src/evdev.h b/src/evdev.h
index 70a66a2..f074ad7 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -104,6 +104,7 @@ enum evdev_device_model {
 	EVDEV_MODEL_SYSTEM76_KUDU,
 	EVDEV_MODEL_CLEVO_W740SU,
 	EVDEV_MODEL_APPLE_TOUCHPAD,
+	EVDEV_MODEL_WACOM_TOUCHPAD,
 };
 
 struct mt_slot {
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 13ff518..4fda18d 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -71,3 +71,9 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnSystem76*pvrgalu1*
 # Kudu Professional
 libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnSystem76*pvrkudp1*
  LIBINPUT_MODEL_SYSTEM76_KUDU=1
+
+##########################################
+# Wacom
+##########################################
+libinput:touchpad:input:b0003v056Ap*
+ LIBINPUT_MODEL_WACOM_TOUCHPAD=1
-- 
2.4.1



More information about the wayland-devel mailing list