[PATCH libinput 2/2] tablet: use libwacom_new_from_path() to handle more tablets

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 9 22:03:46 PDT 2015


Some tablets cannot be differentiated by pid/vid alone, use the device path
instead - that gives libwacom the ability to extract the information required
to handle the device (libwacom doesn't open the path, it just reads through
the sysfs entry of the device).

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index c4b4154..9096925 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -1062,10 +1062,7 @@ tablet_init_left_handed(struct evdev_device *device)
 	WacomDeviceDatabase *db;
 	WacomDevice *d = NULL;
 	WacomError *error;
-	int vid, pid;
-
-	vid = evdev_device_get_id_vendor(device);
-	pid = evdev_device_get_id_product(device);
+	const char *devnode;
 
 	db = libwacom_database_new();
 	if (!db) {
@@ -1074,7 +1071,12 @@ tablet_init_left_handed(struct evdev_device *device)
 		return;
 	}
 	error = libwacom_error_new();
-	d = libwacom_new_from_usbid(db, vid, pid, error);
+	devnode = udev_device_get_devnode(device->udev_device);
+
+	d = libwacom_new_from_path(db,
+				   devnode,
+				   WFALLBACK_NONE,
+				   error);
 
 	if (d) {
 		if (libwacom_is_reversible(d))
-- 
2.1.0



More information about the wayland-devel mailing list