aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-logitech-dj.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-logitech-dj.c')
-rw-r--r--drivers/hid/hid-logitech-dj.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 980ede54782d..486dbde2ba2d 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -193,9 +193,6 @@ static const u8 hid_reportid_size_map[NUMBER_OF_HID_REPORTS] = {
193 193
194static struct hid_ll_driver logi_dj_ll_driver; 194static struct hid_ll_driver logi_dj_ll_driver;
195 195
196static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf,
197 size_t count,
198 unsigned char report_type);
199static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev); 196static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev);
200 197
201static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev, 198static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev,
@@ -262,7 +259,6 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
262 } 259 }
263 260
264 dj_hiddev->ll_driver = &logi_dj_ll_driver; 261 dj_hiddev->ll_driver = &logi_dj_ll_driver;
265 dj_hiddev->hid_output_raw_report = logi_dj_output_hidraw_report;
266 262
267 dj_hiddev->dev.parent = &djrcv_hdev->dev; 263 dj_hiddev->dev.parent = &djrcv_hdev->dev;
268 dj_hiddev->bus = BUS_USB; 264 dj_hiddev->bus = BUS_USB;
@@ -544,9 +540,10 @@ static void logi_dj_ll_close(struct hid_device *hid)
544 dbg_hid("%s:%s\n", __func__, hid->phys); 540 dbg_hid("%s:%s\n", __func__, hid->phys);
545} 541}
546 542
547static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf, 543static int logi_dj_ll_raw_request(struct hid_device *hid,
548 size_t count, 544 unsigned char reportnum, __u8 *buf,
549 unsigned char report_type) 545 size_t count, unsigned char report_type,
546 int reqtype)
550{ 547{
551 struct dj_device *djdev = hid->driver_data; 548 struct dj_device *djdev = hid->driver_data;
552 struct dj_receiver_dev *djrcv_dev = djdev->dj_receiver_dev; 549 struct dj_receiver_dev *djrcv_dev = djdev->dj_receiver_dev;
@@ -567,15 +564,8 @@ static int logi_dj_output_hidraw_report(struct hid_device *hid, u8 * buf,
567 out_buf[1] = djdev->device_index; 564 out_buf[1] = djdev->device_index;
568 memcpy(out_buf + 2, buf, count); 565 memcpy(out_buf + 2, buf, count);
569 566
570 /*
571 * hid-generic calls us with hid_output_raw_report(), but the LEDs
572 * are set through a SET_REPORT command. It works for USB-HID devices
573 * because usbhid either calls a SET_REPORT or directly send the output
574 * report depending if the device presents an urbout.
575 * Let be simple, send a SET_REPORT request.
576 */
577 ret = hid_hw_raw_request(djrcv_dev->hdev, out_buf[0], out_buf, 567 ret = hid_hw_raw_request(djrcv_dev->hdev, out_buf[0], out_buf,
578 DJREPORT_SHORT_LENGTH, report_type, HID_REQ_SET_REPORT); 568 DJREPORT_SHORT_LENGTH, report_type, reqtype);
579 569
580 kfree(out_buf); 570 kfree(out_buf);
581 return ret; 571 return ret;
@@ -662,6 +652,7 @@ static struct hid_ll_driver logi_dj_ll_driver = {
662 .stop = logi_dj_ll_stop, 652 .stop = logi_dj_ll_stop,
663 .open = logi_dj_ll_open, 653 .open = logi_dj_ll_open,
664 .close = logi_dj_ll_close, 654 .close = logi_dj_ll_close,
655 .raw_request = logi_dj_ll_raw_request,
665}; 656};
666 657
667 658