hid-sony.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /*
  2. * HID driver for some sony "special" devices
  3. *
  4. * Copyright (c) 1999 Andreas Gal
  5. * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
  6. * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
  7. * Copyright (c) 2008 Jiri Slaby
  8. * Copyright (c) 2006-2008 Jiri Kosina
  9. * Copyright (c) 2013 Colin Leitner <colin.leitner@gmail.com>
  10. */
  11. /*
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the Free
  14. * Software Foundation; either version 2 of the License, or (at your option)
  15. * any later version.
  16. */
  17. #include <linux/device.h>
  18. #include <linux/hid.h>
  19. #include <linux/module.h>
  20. #include <linux/slab.h>
  21. #include <linux/usb.h>
  22. #include "hid-ids.h"
  23. #define VAIO_RDESC_CONSTANT (1 << 0)
  24. #define SIXAXIS_CONTROLLER_USB (1 << 1)
  25. #define SIXAXIS_CONTROLLER_BT (1 << 2)
  26. #define BUZZ_CONTROLLER (1 << 3)
  27. static const u8 sixaxis_rdesc_fixup[] = {
  28. 0x95, 0x13, 0x09, 0x01, 0x81, 0x02, 0x95, 0x0C,
  29. 0x81, 0x01, 0x75, 0x10, 0x95, 0x04, 0x26, 0xFF,
  30. 0x03, 0x46, 0xFF, 0x03, 0x09, 0x01, 0x81, 0x02
  31. };
  32. static const u8 sixaxis_rdesc_fixup2[] = {
  33. 0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0xa1, 0x02,
  34. 0x85, 0x01, 0x75, 0x08, 0x95, 0x01, 0x15, 0x00,
  35. 0x26, 0xff, 0x00, 0x81, 0x03, 0x75, 0x01, 0x95,
  36. 0x13, 0x15, 0x00, 0x25, 0x01, 0x35, 0x00, 0x45,
  37. 0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x13, 0x81,
  38. 0x02, 0x75, 0x01, 0x95, 0x0d, 0x06, 0x00, 0xff,
  39. 0x81, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05,
  40. 0x01, 0x09, 0x01, 0xa1, 0x00, 0x75, 0x08, 0x95,
  41. 0x04, 0x35, 0x00, 0x46, 0xff, 0x00, 0x09, 0x30,
  42. 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x81, 0x02,
  43. 0xc0, 0x05, 0x01, 0x95, 0x13, 0x09, 0x01, 0x81,
  44. 0x02, 0x95, 0x0c, 0x81, 0x01, 0x75, 0x10, 0x95,
  45. 0x04, 0x26, 0xff, 0x03, 0x46, 0xff, 0x03, 0x09,
  46. 0x01, 0x81, 0x02, 0xc0, 0xa1, 0x02, 0x85, 0x02,
  47. 0x75, 0x08, 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02,
  48. 0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95,
  49. 0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02,
  50. 0x85, 0xef, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01,
  51. 0xb1, 0x02, 0xc0, 0xc0,
  52. };
  53. static const unsigned int buzz_keymap[] = {
  54. /* The controller has 4 remote buzzers, each with one LED and 5
  55. * buttons.
  56. *
  57. * We use the mapping chosen by the controller, which is:
  58. *
  59. * Key Offset
  60. * -------------------
  61. * Buzz 1
  62. * Blue 5
  63. * Orange 4
  64. * Green 3
  65. * Yellow 2
  66. *
  67. * So, for example, the orange button on the third buzzer is mapped to
  68. * BTN_TRIGGER_HAPPY14
  69. */
  70. [ 1] = BTN_TRIGGER_HAPPY1,
  71. [ 2] = BTN_TRIGGER_HAPPY2,
  72. [ 3] = BTN_TRIGGER_HAPPY3,
  73. [ 4] = BTN_TRIGGER_HAPPY4,
  74. [ 5] = BTN_TRIGGER_HAPPY5,
  75. [ 6] = BTN_TRIGGER_HAPPY6,
  76. [ 7] = BTN_TRIGGER_HAPPY7,
  77. [ 8] = BTN_TRIGGER_HAPPY8,
  78. [ 9] = BTN_TRIGGER_HAPPY9,
  79. [10] = BTN_TRIGGER_HAPPY10,
  80. [11] = BTN_TRIGGER_HAPPY11,
  81. [12] = BTN_TRIGGER_HAPPY12,
  82. [13] = BTN_TRIGGER_HAPPY13,
  83. [14] = BTN_TRIGGER_HAPPY14,
  84. [15] = BTN_TRIGGER_HAPPY15,
  85. [16] = BTN_TRIGGER_HAPPY16,
  86. [17] = BTN_TRIGGER_HAPPY17,
  87. [18] = BTN_TRIGGER_HAPPY18,
  88. [19] = BTN_TRIGGER_HAPPY19,
  89. [20] = BTN_TRIGGER_HAPPY20,
  90. };
  91. struct sony_sc {
  92. unsigned long quirks;
  93. void *extra;
  94. };
  95. struct buzz_extra {
  96. #ifdef CONFIG_LEDS_CLASS
  97. int led_state;
  98. struct led_classdev *leds[4];
  99. #endif
  100. };
  101. /* Sony Vaio VGX has wrongly mouse pointer declared as constant */
  102. static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  103. unsigned int *rsize)
  104. {
  105. struct sony_sc *sc = hid_get_drvdata(hdev);
  106. /*
  107. * Some Sony RF receivers wrongly declare the mouse pointer as a
  108. * a constant non-data variable.
  109. */
  110. if ((sc->quirks & VAIO_RDESC_CONSTANT) && *rsize >= 56 &&
  111. /* usage page: generic desktop controls */
  112. /* rdesc[0] == 0x05 && rdesc[1] == 0x01 && */
  113. /* usage: mouse */
  114. rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
  115. /* input (usage page for x,y axes): constant, variable, relative */
  116. rdesc[54] == 0x81 && rdesc[55] == 0x07) {
  117. hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n");
  118. /* input: data, variable, relative */
  119. rdesc[55] = 0x06;
  120. }
  121. /* The HID descriptor exposed over BT has a trailing zero byte */
  122. if ((((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize == 148) ||
  123. ((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
  124. rdesc[83] == 0x75) {
  125. hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n");
  126. memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup,
  127. sizeof(sixaxis_rdesc_fixup));
  128. } else if (sc->quirks & SIXAXIS_CONTROLLER_USB &&
  129. *rsize > sizeof(sixaxis_rdesc_fixup2)) {
  130. hid_info(hdev, "Sony Sixaxis clone detected. Using original report descriptor (size: %d clone; %d new)\n",
  131. *rsize, (int)sizeof(sixaxis_rdesc_fixup2));
  132. *rsize = sizeof(sixaxis_rdesc_fixup2);
  133. memcpy(rdesc, &sixaxis_rdesc_fixup2, *rsize);
  134. }
  135. return rdesc;
  136. }
  137. static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
  138. __u8 *rd, int size)
  139. {
  140. struct sony_sc *sc = hid_get_drvdata(hdev);
  141. /* Sixaxis HID report has acclerometers/gyro with MSByte first, this
  142. * has to be BYTE_SWAPPED before passing up to joystick interface
  143. */
  144. if ((sc->quirks & (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)) &&
  145. rd[0] == 0x01 && size == 49) {
  146. swap(rd[41], rd[42]);
  147. swap(rd[43], rd[44]);
  148. swap(rd[45], rd[46]);
  149. swap(rd[47], rd[48]);
  150. }
  151. return 0;
  152. }
  153. static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
  154. struct hid_field *field, struct hid_usage *usage,
  155. unsigned long **bit, int *max)
  156. {
  157. struct sony_sc *sc = hid_get_drvdata(hdev);
  158. if (sc->quirks & BUZZ_CONTROLLER) {
  159. unsigned int key = usage->hid & HID_USAGE;
  160. if ((usage->hid & HID_USAGE_PAGE) != HID_UP_BUTTON)
  161. return -1;
  162. switch (usage->collection_index) {
  163. case 1:
  164. if (key >= ARRAY_SIZE(buzz_keymap))
  165. return -1;
  166. key = buzz_keymap[key];
  167. if (!key)
  168. return -1;
  169. break;
  170. default:
  171. return -1;
  172. }
  173. hid_map_usage_clear(hi, usage, bit, max, EV_KEY, key);
  174. return 1;
  175. }
  176. return -1;
  177. }
  178. /*
  179. * The Sony Sixaxis does not handle HID Output Reports on the Interrupt EP
  180. * like it should according to usbhid/hid-core.c::usbhid_output_raw_report()
  181. * so we need to override that forcing HID Output Reports on the Control EP.
  182. *
  183. * There is also another issue about HID Output Reports via USB, the Sixaxis
  184. * does not want the report_id as part of the data packet, so we have to
  185. * discard buf[0] when sending the actual control message, even for numbered
  186. * reports, humpf!
  187. */
  188. static int sixaxis_usb_output_raw_report(struct hid_device *hid, __u8 *buf,
  189. size_t count, unsigned char report_type)
  190. {
  191. struct usb_interface *intf = to_usb_interface(hid->dev.parent);
  192. struct usb_device *dev = interface_to_usbdev(intf);
  193. struct usb_host_interface *interface = intf->cur_altsetting;
  194. int report_id = buf[0];
  195. int ret;
  196. if (report_type == HID_OUTPUT_REPORT) {
  197. /* Don't send the Report ID */
  198. buf++;
  199. count--;
  200. }
  201. ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
  202. HID_REQ_SET_REPORT,
  203. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
  204. ((report_type + 1) << 8) | report_id,
  205. interface->desc.bInterfaceNumber, buf, count,
  206. USB_CTRL_SET_TIMEOUT);
  207. /* Count also the Report ID, in case of an Output report. */
  208. if (ret > 0 && report_type == HID_OUTPUT_REPORT)
  209. ret++;
  210. return ret;
  211. }
  212. /*
  213. * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller
  214. * to "operational". Without this, the ps3 controller will not report any
  215. * events.
  216. */
  217. static int sixaxis_set_operational_usb(struct hid_device *hdev)
  218. {
  219. struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
  220. struct usb_device *dev = interface_to_usbdev(intf);
  221. __u16 ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
  222. int ret;
  223. char *buf = kmalloc(18, GFP_KERNEL);
  224. if (!buf)
  225. return -ENOMEM;
  226. ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
  227. HID_REQ_GET_REPORT,
  228. USB_DIR_IN | USB_TYPE_CLASS |
  229. USB_RECIP_INTERFACE,
  230. (3 << 8) | 0xf2, ifnum, buf, 17,
  231. USB_CTRL_GET_TIMEOUT);
  232. if (ret < 0)
  233. hid_err(hdev, "can't set operational mode\n");
  234. kfree(buf);
  235. return ret;
  236. }
  237. static int sixaxis_set_operational_bt(struct hid_device *hdev)
  238. {
  239. unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
  240. return hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
  241. }
  242. #ifdef CONFIG_LEDS_CLASS
  243. static void buzz_set_leds(struct hid_device *hdev, int leds)
  244. {
  245. struct list_head *report_list =
  246. &hdev->report_enum[HID_OUTPUT_REPORT].report_list;
  247. struct hid_report *report = list_entry(report_list->next,
  248. struct hid_report, list);
  249. __s32 *value = report->field[0]->value;
  250. value[0] = 0x00;
  251. value[1] = (leds & 1) ? 0xff : 0x00;
  252. value[2] = (leds & 2) ? 0xff : 0x00;
  253. value[3] = (leds & 4) ? 0xff : 0x00;
  254. value[4] = (leds & 8) ? 0xff : 0x00;
  255. value[5] = 0x00;
  256. value[6] = 0x00;
  257. hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
  258. }
  259. static void buzz_led_set_brightness(struct led_classdev *led,
  260. enum led_brightness value)
  261. {
  262. struct device *dev = led->dev->parent;
  263. struct hid_device *hdev = container_of(dev, struct hid_device, dev);
  264. struct sony_sc *drv_data;
  265. struct buzz_extra *buzz;
  266. int n;
  267. drv_data = hid_get_drvdata(hdev);
  268. if (!drv_data || !drv_data->extra) {
  269. hid_err(hdev, "No device data\n");
  270. return;
  271. }
  272. buzz = drv_data->extra;
  273. for (n = 0; n < 4; n++) {
  274. if (led == buzz->leds[n]) {
  275. int on = !! (buzz->led_state & (1 << n));
  276. if (value == LED_OFF && on) {
  277. buzz->led_state &= ~(1 << n);
  278. buzz_set_leds(hdev, buzz->led_state);
  279. } else if (value != LED_OFF && !on) {
  280. buzz->led_state |= (1 << n);
  281. buzz_set_leds(hdev, buzz->led_state);
  282. }
  283. break;
  284. }
  285. }
  286. }
  287. static enum led_brightness buzz_led_get_brightness(struct led_classdev *led)
  288. {
  289. struct device *dev = led->dev->parent;
  290. struct hid_device *hdev = container_of(dev, struct hid_device, dev);
  291. struct sony_sc *drv_data;
  292. struct buzz_extra *buzz;
  293. int n;
  294. int on = 0;
  295. drv_data = hid_get_drvdata(hdev);
  296. if (!drv_data || !drv_data->extra) {
  297. hid_err(hdev, "No device data\n");
  298. return LED_OFF;
  299. }
  300. buzz = drv_data->extra;
  301. for (n = 0; n < 4; n++) {
  302. if (led == buzz->leds[n]) {
  303. on = !! (buzz->led_state & (1 << n));
  304. break;
  305. }
  306. }
  307. return on ? LED_FULL : LED_OFF;
  308. }
  309. #endif
  310. static int buzz_init(struct hid_device *hdev)
  311. {
  312. struct sony_sc *drv_data;
  313. struct buzz_extra *buzz;
  314. int ret = 0;
  315. drv_data = hid_get_drvdata(hdev);
  316. BUG_ON(!(drv_data->quirks & BUZZ_CONTROLLER));
  317. buzz = kzalloc(sizeof(*buzz), GFP_KERNEL);
  318. if (!buzz) {
  319. hid_err(hdev, "Insufficient memory, cannot allocate driver data\n");
  320. return -ENOMEM;
  321. }
  322. drv_data->extra = buzz;
  323. /* Clear LEDs as we have no way of reading their initial state. This is
  324. * only relevant if the driver is loaded after somebody actively set the
  325. * LEDs to on */
  326. buzz_set_leds(hdev, 0x00);
  327. #ifdef CONFIG_LEDS_CLASS
  328. {
  329. int n;
  330. struct led_classdev *led;
  331. size_t name_sz;
  332. char *name;
  333. name_sz = strlen(dev_name(&hdev->dev)) + strlen("::buzz#") + 1;
  334. for (n = 0; n < 4; n++) {
  335. led = kzalloc(sizeof(struct led_classdev) + name_sz, GFP_KERNEL);
  336. if (!led) {
  337. hid_err(hdev, "Couldn't allocate memory for LED %d\n", n);
  338. goto error_leds;
  339. }
  340. name = (void *)(&led[1]);
  341. snprintf(name, name_sz, "%s::buzz%d", dev_name(&hdev->dev), n + 1);
  342. led->name = name;
  343. led->brightness = 0;
  344. led->max_brightness = 1;
  345. led->brightness_get = buzz_led_get_brightness;
  346. led->brightness_set = buzz_led_set_brightness;
  347. if (led_classdev_register(&hdev->dev, led)) {
  348. hid_err(hdev, "Failed to register LED %d\n", n);
  349. kfree(led);
  350. goto error_leds;
  351. }
  352. buzz->leds[n] = led;
  353. }
  354. }
  355. #endif
  356. return ret;
  357. #ifdef CONFIG_LEDS_CLASS
  358. error_leds:
  359. {
  360. int n;
  361. struct led_classdev *led;
  362. for (n = 0; n < 4; n++) {
  363. led = buzz->leds[n];
  364. buzz->leds[n] = NULL;
  365. if (!led)
  366. continue;
  367. led_classdev_unregister(led);
  368. kfree(led);
  369. }
  370. }
  371. kfree(drv_data->extra);
  372. drv_data->extra = NULL;
  373. return ret;
  374. #endif
  375. }
  376. static void buzz_remove(struct hid_device *hdev)
  377. {
  378. struct sony_sc *drv_data;
  379. struct buzz_extra *buzz;
  380. drv_data = hid_get_drvdata(hdev);
  381. BUG_ON(!(drv_data->quirks & BUZZ_CONTROLLER));
  382. buzz = drv_data->extra;
  383. #ifdef CONFIG_LEDS_CLASS
  384. {
  385. int n;
  386. struct led_classdev *led;
  387. for (n = 0; n < 4; n++) {
  388. led = buzz->leds[n];
  389. buzz->leds[n] = NULL;
  390. if (!led)
  391. continue;
  392. led_classdev_unregister(led);
  393. kfree(led);
  394. }
  395. }
  396. #endif
  397. kfree(drv_data->extra);
  398. drv_data->extra = NULL;
  399. }
  400. static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
  401. {
  402. int ret;
  403. unsigned long quirks = id->driver_data;
  404. struct sony_sc *sc;
  405. unsigned int connect_mask = HID_CONNECT_DEFAULT;
  406. sc = kzalloc(sizeof(*sc), GFP_KERNEL);
  407. if (sc == NULL) {
  408. hid_err(hdev, "can't alloc sony descriptor\n");
  409. return -ENOMEM;
  410. }
  411. sc->quirks = quirks;
  412. hid_set_drvdata(hdev, sc);
  413. ret = hid_parse(hdev);
  414. if (ret) {
  415. hid_err(hdev, "parse failed\n");
  416. goto err_free;
  417. }
  418. if (sc->quirks & VAIO_RDESC_CONSTANT)
  419. connect_mask |= HID_CONNECT_HIDDEV_FORCE;
  420. else if (sc->quirks & SIXAXIS_CONTROLLER_USB)
  421. connect_mask |= HID_CONNECT_HIDDEV_FORCE;
  422. else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
  423. connect_mask |= HID_CONNECT_HIDDEV_FORCE;
  424. ret = hid_hw_start(hdev, connect_mask);
  425. if (ret) {
  426. hid_err(hdev, "hw start failed\n");
  427. goto err_free;
  428. }
  429. if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
  430. hdev->hid_output_raw_report = sixaxis_usb_output_raw_report;
  431. ret = sixaxis_set_operational_usb(hdev);
  432. }
  433. else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
  434. ret = sixaxis_set_operational_bt(hdev);
  435. else if (sc->quirks & BUZZ_CONTROLLER)
  436. ret = buzz_init(hdev);
  437. else
  438. ret = 0;
  439. if (ret < 0)
  440. goto err_stop;
  441. return 0;
  442. err_stop:
  443. hid_hw_stop(hdev);
  444. err_free:
  445. kfree(sc);
  446. return ret;
  447. }
  448. static void sony_remove(struct hid_device *hdev)
  449. {
  450. struct sony_sc *sc = hid_get_drvdata(hdev);
  451. if (sc->quirks & BUZZ_CONTROLLER)
  452. buzz_remove(hdev);
  453. hid_hw_stop(hdev);
  454. kfree(sc);
  455. }
  456. static const struct hid_device_id sony_devices[] = {
  457. { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
  458. .driver_data = SIXAXIS_CONTROLLER_USB },
  459. { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER),
  460. .driver_data = SIXAXIS_CONTROLLER_USB },
  461. { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
  462. .driver_data = SIXAXIS_CONTROLLER_BT },
  463. { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
  464. .driver_data = VAIO_RDESC_CONSTANT },
  465. { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE),
  466. .driver_data = VAIO_RDESC_CONSTANT },
  467. /* Wired Buzz Controller. Reported as Sony Hub from its USB ID and as
  468. * Logitech joystick from the device descriptor. */
  469. { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER),
  470. .driver_data = BUZZ_CONTROLLER },
  471. { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER),
  472. .driver_data = BUZZ_CONTROLLER },
  473. { }
  474. };
  475. MODULE_DEVICE_TABLE(hid, sony_devices);
  476. static struct hid_driver sony_driver = {
  477. .name = "sony",
  478. .id_table = sony_devices,
  479. .input_mapping = sony_mapping,
  480. .probe = sony_probe,
  481. .remove = sony_remove,
  482. .report_fixup = sony_report_fixup,
  483. .raw_event = sony_raw_event
  484. };
  485. module_hid_driver(sony_driver);
  486. MODULE_LICENSE("GPL");