1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#include <linux/device.h>
28#include <linux/hid.h>
29#include <linux/module.h>
30#include <linux/slab.h>
31#include <linux/usb.h>
32#include <linux/leds.h>
33
34#include "hid-ids.h"
35
36#define VAIO_RDESC_CONSTANT (1 << 0)
37#define SIXAXIS_CONTROLLER_USB (1 << 1)
38#define SIXAXIS_CONTROLLER_BT (1 << 2)
39#define BUZZ_CONTROLLER (1 << 3)
40#define PS3REMOTE (1 << 4)
41
42static const u8 sixaxis_rdesc_fixup[] = {
43 0x95, 0x13, 0x09, 0x01, 0x81, 0x02, 0x95, 0x0C,
44 0x81, 0x01, 0x75, 0x10, 0x95, 0x04, 0x26, 0xFF,
45 0x03, 0x46, 0xFF, 0x03, 0x09, 0x01, 0x81, 0x02
46};
47
48static const u8 sixaxis_rdesc_fixup2[] = {
49 0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0xa1, 0x02,
50 0x85, 0x01, 0x75, 0x08, 0x95, 0x01, 0x15, 0x00,
51 0x26, 0xff, 0x00, 0x81, 0x03, 0x75, 0x01, 0x95,
52 0x13, 0x15, 0x00, 0x25, 0x01, 0x35, 0x00, 0x45,
53 0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x13, 0x81,
54 0x02, 0x75, 0x01, 0x95, 0x0d, 0x06, 0x00, 0xff,
55 0x81, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05,
56 0x01, 0x09, 0x01, 0xa1, 0x00, 0x75, 0x08, 0x95,
57 0x04, 0x35, 0x00, 0x46, 0xff, 0x00, 0x09, 0x30,
58 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x81, 0x02,
59 0xc0, 0x05, 0x01, 0x95, 0x13, 0x09, 0x01, 0x81,
60 0x02, 0x95, 0x0c, 0x81, 0x01, 0x75, 0x10, 0x95,
61 0x04, 0x26, 0xff, 0x03, 0x46, 0xff, 0x03, 0x09,
62 0x01, 0x81, 0x02, 0xc0, 0xa1, 0x02, 0x85, 0x02,
63 0x75, 0x08, 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02,
64 0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95,
65 0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02,
66 0x85, 0xef, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01,
67 0xb1, 0x02, 0xc0, 0xc0,
68};
69
70static __u8 ps3remote_rdesc[] = {
71 0x05, 0x01,
72 0x09, 0x05,
73 0xA1, 0x01,
74
75
76 0xA1, 0x02,
77
78
79
80 0x75, 0x08,
81 0x95, 0x01,
82 0x81, 0x01,
83
84
85
86 0x05, 0x09,
87 0x19, 0x01,
88 0x29, 0x18,
89 0x14,
90 0x25, 0x01,
91 0x75, 0x01,
92 0x95, 0x18,
93 0x81, 0x02,
94
95 0xC0,
96
97
98 0xA1, 0x02,
99
100
101 0x05, 0x09,
102 0x18,
103 0x29, 0xFE,
104 0x14,
105 0x26, 0xFE, 0x00,
106 0x75, 0x08,
107 0x95, 0x01,
108 0x80,
109
110
111
112 0x75, 0x08,
113 0x95, 0x06,
114 0x81, 0x01,
115
116
117 0x05, 0x06,
118 0x09, 0x20,
119 0x14,
120 0x25, 0x05,
121 0x75, 0x08,
122 0x95, 0x01,
123 0x81, 0x02,
124
125 0xC0,
126
127 0xC0
128};
129
130static const unsigned int ps3remote_keymap_joypad_buttons[] = {
131 [0x01] = KEY_SELECT,
132 [0x02] = BTN_THUMBL,
133 [0x03] = BTN_THUMBR,
134 [0x04] = BTN_START,
135 [0x05] = KEY_UP,
136 [0x06] = KEY_RIGHT,
137 [0x07] = KEY_DOWN,
138 [0x08] = KEY_LEFT,
139 [0x09] = BTN_TL2,
140 [0x0a] = BTN_TR2,
141 [0x0b] = BTN_TL,
142 [0x0c] = BTN_TR,
143 [0x0d] = KEY_OPTION,
144 [0x0e] = KEY_BACK,
145 [0x0f] = BTN_0,
146 [0x10] = KEY_SCREEN,
147 [0x11] = KEY_HOMEPAGE,
148 [0x14] = KEY_ENTER,
149};
150static const unsigned int ps3remote_keymap_remote_buttons[] = {
151 [0x00] = KEY_1,
152 [0x01] = KEY_2,
153 [0x02] = KEY_3,
154 [0x03] = KEY_4,
155 [0x04] = KEY_5,
156 [0x05] = KEY_6,
157 [0x06] = KEY_7,
158 [0x07] = KEY_8,
159 [0x08] = KEY_9,
160 [0x09] = KEY_0,
161 [0x0e] = KEY_ESC,
162 [0x0f] = KEY_CLEAR,
163 [0x16] = KEY_EJECTCD,
164 [0x1a] = KEY_MENU,
165 [0x28] = KEY_TIME,
166 [0x30] = KEY_PREVIOUS,
167 [0x31] = KEY_NEXT,
168 [0x32] = KEY_PLAY,
169 [0x33] = KEY_REWIND,
170 [0x34] = KEY_FORWARD,
171 [0x38] = KEY_STOP,
172 [0x39] = KEY_PAUSE,
173 [0x40] = KEY_CONTEXT_MENU,
174 [0x60] = KEY_FRAMEBACK,
175 [0x61] = KEY_FRAMEFORWARD,
176 [0x63] = KEY_SUBTITLE,
177 [0x64] = KEY_AUDIO,
178 [0x65] = KEY_ANGLE,
179 [0x70] = KEY_INFO,
180 [0x80] = KEY_BLUE,
181 [0x81] = KEY_RED,
182 [0x82] = KEY_GREEN,
183 [0x83] = KEY_YELLOW,
184};
185
186static const unsigned int buzz_keymap[] = {
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203 [ 1] = BTN_TRIGGER_HAPPY1,
204 [ 2] = BTN_TRIGGER_HAPPY2,
205 [ 3] = BTN_TRIGGER_HAPPY3,
206 [ 4] = BTN_TRIGGER_HAPPY4,
207 [ 5] = BTN_TRIGGER_HAPPY5,
208 [ 6] = BTN_TRIGGER_HAPPY6,
209 [ 7] = BTN_TRIGGER_HAPPY7,
210 [ 8] = BTN_TRIGGER_HAPPY8,
211 [ 9] = BTN_TRIGGER_HAPPY9,
212 [10] = BTN_TRIGGER_HAPPY10,
213 [11] = BTN_TRIGGER_HAPPY11,
214 [12] = BTN_TRIGGER_HAPPY12,
215 [13] = BTN_TRIGGER_HAPPY13,
216 [14] = BTN_TRIGGER_HAPPY14,
217 [15] = BTN_TRIGGER_HAPPY15,
218 [16] = BTN_TRIGGER_HAPPY16,
219 [17] = BTN_TRIGGER_HAPPY17,
220 [18] = BTN_TRIGGER_HAPPY18,
221 [19] = BTN_TRIGGER_HAPPY19,
222 [20] = BTN_TRIGGER_HAPPY20,
223};
224
225struct sony_sc {
226 unsigned long quirks;
227
228 void *extra;
229};
230
231struct buzz_extra {
232 int led_state;
233 struct led_classdev *leds[4];
234};
235
236static __u8 *ps3remote_fixup(struct hid_device *hdev, __u8 *rdesc,
237 unsigned int *rsize)
238{
239 *rsize = sizeof(ps3remote_rdesc);
240 return ps3remote_rdesc;
241}
242
243static int ps3remote_mapping(struct hid_device *hdev, struct hid_input *hi,
244 struct hid_field *field, struct hid_usage *usage,
245 unsigned long **bit, int *max)
246{
247 unsigned int key = usage->hid & HID_USAGE;
248
249 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_BUTTON)
250 return -1;
251
252 switch (usage->collection_index) {
253 case 1:
254 if (key >= ARRAY_SIZE(ps3remote_keymap_joypad_buttons))
255 return -1;
256
257 key = ps3remote_keymap_joypad_buttons[key];
258 if (!key)
259 return -1;
260 break;
261 case 2:
262 if (key >= ARRAY_SIZE(ps3remote_keymap_remote_buttons))
263 return -1;
264
265 key = ps3remote_keymap_remote_buttons[key];
266 if (!key)
267 return -1;
268 break;
269 default:
270 return -1;
271 }
272
273 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, key);
274 return 1;
275}
276
277
278
279static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
280 unsigned int *rsize)
281{
282 struct sony_sc *sc = hid_get_drvdata(hdev);
283
284
285
286
287
288 if ((sc->quirks & VAIO_RDESC_CONSTANT) && *rsize >= 56 &&
289
290
291
292 rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
293
294 rdesc[54] == 0x81 && rdesc[55] == 0x07) {
295 hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n");
296
297 rdesc[55] = 0x06;
298 }
299
300
301 if ((((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize == 148) ||
302 ((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
303 rdesc[83] == 0x75) {
304 hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n");
305 memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup,
306 sizeof(sixaxis_rdesc_fixup));
307 } else if (sc->quirks & SIXAXIS_CONTROLLER_USB &&
308 *rsize > sizeof(sixaxis_rdesc_fixup2)) {
309 hid_info(hdev, "Sony Sixaxis clone detected. Using original report descriptor (size: %d clone; %d new)\n",
310 *rsize, (int)sizeof(sixaxis_rdesc_fixup2));
311 *rsize = sizeof(sixaxis_rdesc_fixup2);
312 memcpy(rdesc, &sixaxis_rdesc_fixup2, *rsize);
313 }
314
315 if (sc->quirks & PS3REMOTE)
316 return ps3remote_fixup(hdev, rdesc, rsize);
317
318 return rdesc;
319}
320
321static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
322 __u8 *rd, int size)
323{
324 struct sony_sc *sc = hid_get_drvdata(hdev);
325
326
327
328
329 if ((sc->quirks & (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)) &&
330 rd[0] == 0x01 && size == 49) {
331 swap(rd[41], rd[42]);
332 swap(rd[43], rd[44]);
333 swap(rd[45], rd[46]);
334 swap(rd[47], rd[48]);
335 }
336
337 return 0;
338}
339
340static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
341 struct hid_field *field, struct hid_usage *usage,
342 unsigned long **bit, int *max)
343{
344 struct sony_sc *sc = hid_get_drvdata(hdev);
345
346 if (sc->quirks & BUZZ_CONTROLLER) {
347 unsigned int key = usage->hid & HID_USAGE;
348
349 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_BUTTON)
350 return -1;
351
352 switch (usage->collection_index) {
353 case 1:
354 if (key >= ARRAY_SIZE(buzz_keymap))
355 return -1;
356
357 key = buzz_keymap[key];
358 if (!key)
359 return -1;
360 break;
361 default:
362 return -1;
363 }
364
365 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, key);
366 return 1;
367 }
368
369 if (sc->quirks & PS3REMOTE)
370 return ps3remote_mapping(hdev, hi, field, usage, bit, max);
371
372
373 return 0;
374}
375
376
377
378
379
380
381
382
383
384
385
386static int sixaxis_usb_output_raw_report(struct hid_device *hid, __u8 *buf,
387 size_t count, unsigned char report_type)
388{
389 struct usb_interface *intf = to_usb_interface(hid->dev.parent);
390 struct usb_device *dev = interface_to_usbdev(intf);
391 struct usb_host_interface *interface = intf->cur_altsetting;
392 int report_id = buf[0];
393 int ret;
394
395 if (report_type == HID_OUTPUT_REPORT) {
396
397 buf++;
398 count--;
399 }
400
401 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
402 HID_REQ_SET_REPORT,
403 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
404 ((report_type + 1) << 8) | report_id,
405 interface->desc.bInterfaceNumber, buf, count,
406 USB_CTRL_SET_TIMEOUT);
407
408
409 if (ret > 0 && report_type == HID_OUTPUT_REPORT)
410 ret++;
411
412 return ret;
413}
414
415
416
417
418
419
420static int sixaxis_set_operational_usb(struct hid_device *hdev)
421{
422 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
423 struct usb_device *dev = interface_to_usbdev(intf);
424 __u16 ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
425 int ret;
426 char *buf = kmalloc(18, GFP_KERNEL);
427
428 if (!buf)
429 return -ENOMEM;
430
431 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
432 HID_REQ_GET_REPORT,
433 USB_DIR_IN | USB_TYPE_CLASS |
434 USB_RECIP_INTERFACE,
435 (3 << 8) | 0xf2, ifnum, buf, 17,
436 USB_CTRL_GET_TIMEOUT);
437 if (ret < 0)
438 hid_err(hdev, "can't set operational mode\n");
439
440 kfree(buf);
441
442 return ret;
443}
444
445static int sixaxis_set_operational_bt(struct hid_device *hdev)
446{
447 unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
448 return hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
449}
450
451static void buzz_set_leds(struct hid_device *hdev, int leds)
452{
453 struct list_head *report_list =
454 &hdev->report_enum[HID_OUTPUT_REPORT].report_list;
455 struct hid_report *report = list_entry(report_list->next,
456 struct hid_report, list);
457 __s32 *value = report->field[0]->value;
458
459 value[0] = 0x00;
460 value[1] = (leds & 1) ? 0xff : 0x00;
461 value[2] = (leds & 2) ? 0xff : 0x00;
462 value[3] = (leds & 4) ? 0xff : 0x00;
463 value[4] = (leds & 8) ? 0xff : 0x00;
464 value[5] = 0x00;
465 value[6] = 0x00;
466 hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
467}
468
469static void buzz_led_set_brightness(struct led_classdev *led,
470 enum led_brightness value)
471{
472 struct device *dev = led->dev->parent;
473 struct hid_device *hdev = container_of(dev, struct hid_device, dev);
474 struct sony_sc *drv_data;
475 struct buzz_extra *buzz;
476
477 int n;
478
479 drv_data = hid_get_drvdata(hdev);
480 if (!drv_data || !drv_data->extra) {
481 hid_err(hdev, "No device data\n");
482 return;
483 }
484 buzz = drv_data->extra;
485
486 for (n = 0; n < 4; n++) {
487 if (led == buzz->leds[n]) {
488 int on = !! (buzz->led_state & (1 << n));
489 if (value == LED_OFF && on) {
490 buzz->led_state &= ~(1 << n);
491 buzz_set_leds(hdev, buzz->led_state);
492 } else if (value != LED_OFF && !on) {
493 buzz->led_state |= (1 << n);
494 buzz_set_leds(hdev, buzz->led_state);
495 }
496 break;
497 }
498 }
499}
500
501static enum led_brightness buzz_led_get_brightness(struct led_classdev *led)
502{
503 struct device *dev = led->dev->parent;
504 struct hid_device *hdev = container_of(dev, struct hid_device, dev);
505 struct sony_sc *drv_data;
506 struct buzz_extra *buzz;
507
508 int n;
509 int on = 0;
510
511 drv_data = hid_get_drvdata(hdev);
512 if (!drv_data || !drv_data->extra) {
513 hid_err(hdev, "No device data\n");
514 return LED_OFF;
515 }
516 buzz = drv_data->extra;
517
518 for (n = 0; n < 4; n++) {
519 if (led == buzz->leds[n]) {
520 on = !! (buzz->led_state & (1 << n));
521 break;
522 }
523 }
524
525 return on ? LED_FULL : LED_OFF;
526}
527
528static int buzz_init(struct hid_device *hdev)
529{
530 struct sony_sc *drv_data;
531 struct buzz_extra *buzz;
532 int n, ret = 0;
533 struct led_classdev *led;
534 size_t name_sz;
535 char *name;
536
537 drv_data = hid_get_drvdata(hdev);
538 BUG_ON(!(drv_data->quirks & BUZZ_CONTROLLER));
539
540
541 if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 0, 0, 7))
542 return -ENODEV;
543
544 buzz = kzalloc(sizeof(*buzz), GFP_KERNEL);
545 if (!buzz) {
546 hid_err(hdev, "Insufficient memory, cannot allocate driver data\n");
547 return -ENOMEM;
548 }
549 drv_data->extra = buzz;
550
551
552
553
554 buzz_set_leds(hdev, 0x00);
555
556 name_sz = strlen(dev_name(&hdev->dev)) + strlen("::buzz#") + 1;
557
558 for (n = 0; n < 4; n++) {
559 led = kzalloc(sizeof(struct led_classdev) + name_sz, GFP_KERNEL);
560 if (!led) {
561 hid_err(hdev, "Couldn't allocate memory for LED %d\n", n);
562 goto error_leds;
563 }
564
565 name = (void *)(&led[1]);
566 snprintf(name, name_sz, "%s::buzz%d", dev_name(&hdev->dev), n + 1);
567 led->name = name;
568 led->brightness = 0;
569 led->max_brightness = 1;
570 led->brightness_get = buzz_led_get_brightness;
571 led->brightness_set = buzz_led_set_brightness;
572
573 if (led_classdev_register(&hdev->dev, led)) {
574 hid_err(hdev, "Failed to register LED %d\n", n);
575 kfree(led);
576 goto error_leds;
577 }
578
579 buzz->leds[n] = led;
580 }
581
582 return ret;
583
584error_leds:
585 for (n = 0; n < 4; n++) {
586 led = buzz->leds[n];
587 buzz->leds[n] = NULL;
588 if (!led)
589 continue;
590 led_classdev_unregister(led);
591 kfree(led);
592 }
593
594 kfree(drv_data->extra);
595 drv_data->extra = NULL;
596 return ret;
597}
598
599static void buzz_remove(struct hid_device *hdev)
600{
601 struct sony_sc *drv_data;
602 struct buzz_extra *buzz;
603 struct led_classdev *led;
604 int n;
605
606 drv_data = hid_get_drvdata(hdev);
607 BUG_ON(!(drv_data->quirks & BUZZ_CONTROLLER));
608
609 buzz = drv_data->extra;
610
611 for (n = 0; n < 4; n++) {
612 led = buzz->leds[n];
613 buzz->leds[n] = NULL;
614 if (!led)
615 continue;
616 led_classdev_unregister(led);
617 kfree(led);
618 }
619
620 kfree(drv_data->extra);
621 drv_data->extra = NULL;
622}
623
624static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
625{
626 int ret;
627 unsigned long quirks = id->driver_data;
628 struct sony_sc *sc;
629 unsigned int connect_mask = HID_CONNECT_DEFAULT;
630
631 sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL);
632 if (sc == NULL) {
633 hid_err(hdev, "can't alloc sony descriptor\n");
634 return -ENOMEM;
635 }
636
637 sc->quirks = quirks;
638 hid_set_drvdata(hdev, sc);
639
640 ret = hid_parse(hdev);
641 if (ret) {
642 hid_err(hdev, "parse failed\n");
643 return ret;
644 }
645
646 if (sc->quirks & VAIO_RDESC_CONSTANT)
647 connect_mask |= HID_CONNECT_HIDDEV_FORCE;
648 else if (sc->quirks & SIXAXIS_CONTROLLER_USB)
649 connect_mask |= HID_CONNECT_HIDDEV_FORCE;
650 else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
651 connect_mask |= HID_CONNECT_HIDDEV_FORCE;
652
653 ret = hid_hw_start(hdev, connect_mask);
654 if (ret) {
655 hid_err(hdev, "hw start failed\n");
656 return ret;
657 }
658
659 if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
660 hdev->hid_output_raw_report = sixaxis_usb_output_raw_report;
661 ret = sixaxis_set_operational_usb(hdev);
662 }
663 else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
664 ret = sixaxis_set_operational_bt(hdev);
665 else if (sc->quirks & BUZZ_CONTROLLER)
666 ret = buzz_init(hdev);
667 else
668 ret = 0;
669
670 if (ret < 0)
671 goto err_stop;
672
673 return 0;
674err_stop:
675 hid_hw_stop(hdev);
676 return ret;
677}
678
679static void sony_remove(struct hid_device *hdev)
680{
681 struct sony_sc *sc = hid_get_drvdata(hdev);
682
683 if (sc->quirks & BUZZ_CONTROLLER)
684 buzz_remove(hdev);
685
686 hid_hw_stop(hdev);
687}
688
689static const struct hid_device_id sony_devices[] = {
690 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
691 .driver_data = SIXAXIS_CONTROLLER_USB },
692 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER),
693 .driver_data = SIXAXIS_CONTROLLER_USB },
694 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
695 .driver_data = SIXAXIS_CONTROLLER_BT },
696 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
697 .driver_data = VAIO_RDESC_CONSTANT },
698 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE),
699 .driver_data = VAIO_RDESC_CONSTANT },
700
701
702 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER),
703 .driver_data = BUZZ_CONTROLLER },
704 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER),
705 .driver_data = BUZZ_CONTROLLER },
706
707 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE),
708 .driver_data = PS3REMOTE },
709
710 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3),
711 .driver_data = PS3REMOTE },
712 { }
713};
714MODULE_DEVICE_TABLE(hid, sony_devices);
715
716static struct hid_driver sony_driver = {
717 .name = "sony",
718 .id_table = sony_devices,
719 .input_mapping = sony_mapping,
720 .probe = sony_probe,
721 .remove = sony_remove,
722 .report_fixup = sony_report_fixup,
723 .raw_event = sony_raw_event
724};
725module_hid_driver(sony_driver);
726
727MODULE_LICENSE("GPL");
728