Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hid-aureal.c
Go to the documentation of this file.
1 /*
2  * HID driver for Aureal Cy se W-01RN USB_V3.1 devices
3  *
4  * Copyright (c) 2010 Franco Catrin <[email protected]>
5  * Copyright (c) 2010 Ben Cropley <[email protected]>
6  *
7  * Based on HID sunplus driver by
8  * Copyright (c) 1999 Andreas Gal
9  * Copyright (c) 2000-2005 Vojtech Pavlik <[email protected]>
10  * Copyright (c) 2005 Michael Haboustak <[email protected]> for Concept2, Inc
11  * Copyright (c) 2006-2007 Jiri Kosina
12  * Copyright (c) 2008 Jiri Slaby
13  */
14 #include <linux/device.h>
15 #include <linux/hid.h>
16 #include <linux/module.h>
17 
18 #include "hid-ids.h"
19 
20 static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc,
21  unsigned int *rsize)
22 {
23  if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
24  dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 report descriptor.\n");
25  rdesc[53] = 0x65;
26  } return rdesc;
27 }
28 
29 static const struct hid_device_id aureal_devices[] = {
31  { }
32 };
33 MODULE_DEVICE_TABLE(hid, aureal_devices);
34 
35 static struct hid_driver aureal_driver = {
36  .name = "aureal",
37  .id_table = aureal_devices,
38  .report_fixup = aureal_report_fixup,
39 };
40 
41 static int __init aureal_init(void)
42 {
43  return hid_register_driver(&aureal_driver);
44 }
45 
46 static void __exit aureal_exit(void)
47 {
48  hid_unregister_driver(&aureal_driver);
49 }
50 
51 module_init(aureal_init);
52 module_exit(aureal_exit);
53 MODULE_LICENSE("GPL");