From 038c50077ce7c8ea71e2c2eb4f7d813fe852b8d5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 24 Aug 2015 13:23:46 +1000 Subject: [PATCH] driver-hidpp10: force the index to 0x00 for wired devices Signed-off-by: Peter Hutterer --- src/driver-hidpp10.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index 64c83fcc..6bc80094 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -175,10 +175,12 @@ hidpp10drv_probe(struct ratbag_device *device, const struct ratbag_id id) int rc; struct hidpp10drv_data *drv_data; struct hidpp10_device dev; + bool is_unifying_receiver; /* check if the device is a unifying receiver first so we can update * the hidraw path before we open it */ - if (hidpp10drv_is_unifying_receiver(device)) + is_unifying_receiver = hidpp10drv_is_unifying_receiver(device); + if (is_unifying_receiver) hidpp10drv_find_unifying_hidraw(device); rc = ratbag_open_hidraw(device); @@ -194,9 +196,13 @@ hidpp10drv_probe(struct ratbag_device *device, const struct ratbag_id id) if (!drv_data) return -ENODEV; - rc = hidpp10_get_device_from_wpid(device, - id.id.product, - &dev); + if (is_unifying_receiver) + rc = hidpp10_get_device_from_wpid(device, + id.id.product, + &dev); + else /* wired devices are 0 */ + rc = hidpp10_get_device_from_idx(device, 0, &dev); + if (rc) { log_error(device->ratbag, "Failed to get HID++1.0 device for %s\n",