diff options
author | Peter Wu <lekensteyn@gmail.com> | 2013-09-19 22:53:02 +0200 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2013-09-19 22:53:02 +0200 |
commit | 3d89e9b3766644ae7265bd59a4a461dc25966287 (patch) | |
tree | eab95d707fad7112efc4c720fa515da60bac5c04 | |
parent | 51bf8e01087685b4bd1b5e8f6154812842f222e0 (diff) | |
download | linux-logitech-wtp.tar.gz |
HID: logitech-dj: re-add device enumeration on probelogitech-wtp
The query part got removed in "HID: Workaround for Logitech Unifying
Receiver on XHCI systems" because it would not work reliable for some
XHCI systems. This also has as side-effect that enumeration will happen
delayed (e.g. when a mouse is moved, or a key is pressed). As it also
breaks module reloads, revert that part.
(When the HID module is reloaded, it is possible that the receiver still
has a radio link to a HID device. Then when a HID++ report is received
(type 0x10 or 0x11), this packet would be dropped because the device is
not yet known.)
Small spelling fixes, and sync the return/break change to
https://chromium-review.googlesource.com/167554
Signed-off-by: Peter Wu <lekensteyn@gmail.com>
-rw-r--r-- | drivers/hid/hid-logitech-dj.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 386040b04992..f0916ebfcf8f 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -452,7 +452,7 @@ static void delayedwork_callback(struct work_struct *work) /* Device is connected, but only now paired. Fallthrough. Note: If we fallthrough here, we should not fallthrough the next case, since that's the case for connection status - info arriving before paried. */ + info arriving before paired. */ case REPORT_TYPE_NOTIF_CONNECTION_STATUS: if (dj_report.report_type == REPORT_TYPE_NOTIF_CONNECTION_STATUS) { param_status = dj_report.report_params[ @@ -472,6 +472,7 @@ static void delayedwork_callback(struct work_struct *work) dev_err(&djrcv_hdev->dev, "%s: failed adding dj_device\n", __func__); + return; } else { djdev->hid_device_started = 1; } @@ -482,7 +483,6 @@ static void delayedwork_callback(struct work_struct *work) return; } hidpp_connect_change(hidpp_dev, connected); - break; } /* Fallthrough for case where djdev is NULL. */ default: @@ -494,7 +494,7 @@ static void delayedwork_callback(struct work_struct *work) * hid-core discards all packets coming from a device while probe() is * executing. */ if (!djrcv_dev->paired_dj_devices[dj_report.device_index]) { - /* ok, we don't know the device that just got conntected, just + /* ok, we don't know the device that just got connected, just * re-ask the receiver for the list of connected devices. */ djrcv_dev->connected[dj_report.device_index] = true; retval = logi_dj_recv_query_paired_devices(djrcv_dev); @@ -1029,12 +1029,18 @@ static int logi_dj_probe(struct hid_device *hdev, /* Allow incoming packets to arrive: */ hid_device_io_start(hdev); - /* Normally we'd query for paired devices here, but some controllers - don't successfully send (or recieve?) the messages for this. Instead, - we'll wait for packets to arrive and issue a query then. */ + retval = logi_dj_recv_query_paired_devices(djrcv_dev); + if (retval < 0) { + dev_err(&hdev->dev, "%s:logi_dj_recv_query_paired_devices " + "error:%d\n", __func__, retval); + goto logi_dj_recv_query_paired_devices_failed; + } return retval; +logi_dj_recv_query_paired_devices_failed: + hdev->ll_driver->close(hdev); + llopen_failed: switch_to_dj_mode_fail: hid_hw_stop(hdev); |