diff options
author | Andrew de los Reyes <adlr@chromium.org> | 2013-02-18 12:20:23 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-03-01 08:14:59 -0500 |
commit | 8af6c08830b1ae114d1a8b548b1f8b056e068887 (patch) | |
tree | 806d9b7ae3408e4ee17b2dfa0f848e79be3d87a9 /drivers/hid | |
parent | a9dd22b73085734735cfa07398451b061626cc53 (diff) |
Revert "HID: Fix logitech-dj: missing Unifying device issue"
This reverts commit 596264082f10dd4a567c43d4526b2f54ac5520bc.
The reverted commit was a workaround needed when drivers became unable
to communicate with devices during probe(). Now that such
communication is possible, the workaround is not needed.
Signed-off-by: Andrew de los Reyes <adlr@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-logitech-dj.c | 45 | ||||
-rw-r--r-- | drivers/hid/hid-logitech-dj.h | 1 |
2 files changed, 0 insertions, 46 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index bf647ef18086..199b78c8a5f3 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c | |||
@@ -193,7 +193,6 @@ static struct hid_ll_driver logi_dj_ll_driver; | |||
193 | static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf, | 193 | static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf, |
194 | size_t count, | 194 | size_t count, |
195 | unsigned char report_type); | 195 | unsigned char report_type); |
196 | static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev); | ||
197 | 196 | ||
198 | static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev, | 197 | static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev, |
199 | struct dj_report *dj_report) | 198 | struct dj_report *dj_report) |
@@ -234,7 +233,6 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, | |||
234 | if (dj_report->report_params[DEVICE_PAIRED_PARAM_SPFUNCTION] & | 233 | if (dj_report->report_params[DEVICE_PAIRED_PARAM_SPFUNCTION] & |
235 | SPFUNCTION_DEVICE_LIST_EMPTY) { | 234 | SPFUNCTION_DEVICE_LIST_EMPTY) { |
236 | dbg_hid("%s: device list is empty\n", __func__); | 235 | dbg_hid("%s: device list is empty\n", __func__); |
237 | djrcv_dev->querying_devices = false; | ||
238 | return; | 236 | return; |
239 | } | 237 | } |
240 | 238 | ||
@@ -245,12 +243,6 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, | |||
245 | return; | 243 | return; |
246 | } | 244 | } |
247 | 245 | ||
248 | if (djrcv_dev->paired_dj_devices[dj_report->device_index]) { | ||
249 | /* The device is already known. No need to reallocate it. */ | ||
250 | dbg_hid("%s: device is already known\n", __func__); | ||
251 | return; | ||
252 | } | ||
253 | |||
254 | dj_hiddev = hid_allocate_device(); | 246 | dj_hiddev = hid_allocate_device(); |
255 | if (IS_ERR(dj_hiddev)) { | 247 | if (IS_ERR(dj_hiddev)) { |
256 | dev_err(&djrcv_hdev->dev, "%s: hid_allocate_device failed\n", | 248 | dev_err(&djrcv_hdev->dev, "%s: hid_allocate_device failed\n", |
@@ -314,7 +306,6 @@ static void delayedwork_callback(struct work_struct *work) | |||
314 | struct dj_report dj_report; | 306 | struct dj_report dj_report; |
315 | unsigned long flags; | 307 | unsigned long flags; |
316 | int count; | 308 | int count; |
317 | int retval; | ||
318 | 309 | ||
319 | dbg_hid("%s\n", __func__); | 310 | dbg_hid("%s\n", __func__); |
320 | 311 | ||
@@ -347,25 +338,6 @@ static void delayedwork_callback(struct work_struct *work) | |||
347 | logi_dj_recv_destroy_djhid_device(djrcv_dev, &dj_report); | 338 | logi_dj_recv_destroy_djhid_device(djrcv_dev, &dj_report); |
348 | break; | 339 | break; |
349 | default: | 340 | default: |
350 | /* A normal report (i. e. not belonging to a pair/unpair notification) | ||
351 | * arriving here, means that the report arrived but we did not have a | ||
352 | * paired dj_device associated to the report's device_index, this | ||
353 | * means that the original "device paired" notification corresponding | ||
354 | * to this dj_device never arrived to this driver. The reason is that | ||
355 | * hid-core discards all packets coming from a device while probe() is | ||
356 | * executing. */ | ||
357 | if (!djrcv_dev->paired_dj_devices[dj_report.device_index]) { | ||
358 | /* ok, we don't know the device, just re-ask the | ||
359 | * receiver for the list of connected devices. */ | ||
360 | retval = logi_dj_recv_query_paired_devices(djrcv_dev); | ||
361 | if (!retval) { | ||
362 | /* everything went fine, so just leave */ | ||
363 | break; | ||
364 | } | ||
365 | dev_err(&djrcv_dev->hdev->dev, | ||
366 | "%s:logi_dj_recv_query_paired_devices " | ||
367 | "error:%d\n", __func__, retval); | ||
368 | } | ||
369 | dbg_hid("%s: unexpected report type\n", __func__); | 341 | dbg_hid("%s: unexpected report type\n", __func__); |
370 | } | 342 | } |
371 | } | 343 | } |
@@ -396,12 +368,6 @@ static void logi_dj_recv_forward_null_report(struct dj_receiver_dev *djrcv_dev, | |||
396 | if (!djdev) { | 368 | if (!djdev) { |
397 | dbg_hid("djrcv_dev->paired_dj_devices[dj_report->device_index]" | 369 | dbg_hid("djrcv_dev->paired_dj_devices[dj_report->device_index]" |
398 | " is NULL, index %d\n", dj_report->device_index); | 370 | " is NULL, index %d\n", dj_report->device_index); |
399 | kfifo_in(&djrcv_dev->notif_fifo, dj_report, sizeof(struct dj_report)); | ||
400 | |||
401 | if (schedule_work(&djrcv_dev->work) == 0) { | ||
402 | dbg_hid("%s: did not schedule the work item, was already " | ||
403 | "queued\n", __func__); | ||
404 | } | ||
405 | return; | 371 | return; |
406 | } | 372 | } |
407 | 373 | ||
@@ -432,12 +398,6 @@ static void logi_dj_recv_forward_report(struct dj_receiver_dev *djrcv_dev, | |||
432 | if (dj_device == NULL) { | 398 | if (dj_device == NULL) { |
433 | dbg_hid("djrcv_dev->paired_dj_devices[dj_report->device_index]" | 399 | dbg_hid("djrcv_dev->paired_dj_devices[dj_report->device_index]" |
434 | " is NULL, index %d\n", dj_report->device_index); | 400 | " is NULL, index %d\n", dj_report->device_index); |
435 | kfifo_in(&djrcv_dev->notif_fifo, dj_report, sizeof(struct dj_report)); | ||
436 | |||
437 | if (schedule_work(&djrcv_dev->work) == 0) { | ||
438 | dbg_hid("%s: did not schedule the work item, was already " | ||
439 | "queued\n", __func__); | ||
440 | } | ||
441 | return; | 401 | return; |
442 | } | 402 | } |
443 | 403 | ||
@@ -479,10 +439,6 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) | |||
479 | struct dj_report *dj_report; | 439 | struct dj_report *dj_report; |
480 | int retval; | 440 | int retval; |
481 | 441 | ||
482 | /* no need to protect djrcv_dev->querying_devices */ | ||
483 | if (djrcv_dev->querying_devices) | ||
484 | return 0; | ||
485 | |||
486 | dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); | 442 | dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); |
487 | if (!dj_report) | 443 | if (!dj_report) |
488 | return -ENOMEM; | 444 | return -ENOMEM; |
@@ -494,7 +450,6 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) | |||
494 | return retval; | 450 | return retval; |
495 | } | 451 | } |
496 | 452 | ||
497 | |||
498 | static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, | 453 | static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, |
499 | unsigned timeout) | 454 | unsigned timeout) |
500 | { | 455 | { |
diff --git a/drivers/hid/hid-logitech-dj.h b/drivers/hid/hid-logitech-dj.h index 4a4000340ce1..fd28a5e0ca3b 100644 --- a/drivers/hid/hid-logitech-dj.h +++ b/drivers/hid/hid-logitech-dj.h | |||
@@ -101,7 +101,6 @@ struct dj_receiver_dev { | |||
101 | struct work_struct work; | 101 | struct work_struct work; |
102 | struct kfifo notif_fifo; | 102 | struct kfifo notif_fifo; |
103 | spinlock_t lock; | 103 | spinlock_t lock; |
104 | bool querying_devices; | ||
105 | }; | 104 | }; |
106 | 105 | ||
107 | struct dj_device { | 106 | struct dj_device { |