tablet: use libwacom_new_from_path() to handle more tablets

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@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Peter Hutterer 2015-03-10 14:14:20 +10:00
parent be5c7d7176
commit b45fe45b1c

View file

@ -1069,10 +1069,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) {
@ -1081,7 +1078,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))