xref: /openbmc/linux/drivers/hid/hid-aureal.c (revision 33a03aad)
1 /*
2  *  HID driver for Aureal Cy se W-01RN USB_V3.1 devices
3  *
4  *  Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com>
5  *  Copyright (c) 2010 Ben Cropley <bcropley@internode.on.net>
6  *
7  *  Based on HID sunplus driver by
8  *  Copyright (c) 1999 Andreas Gal
9  *  Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
10  *  Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
11  *  Copyright (c) 2006-2007 Jiri Kosina
12  *  Copyright (c) 2007 Paul Walmsley
13  *  Copyright (c) 2008 Jiri Slaby
14  */
15 #include <linux/device.h>
16 #include <linux/hid.h>
17 #include <linux/module.h>
18 
19 #include "hid-ids.h"
20 
21 static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc,
22 		unsigned int *rsize)
23 {
24 	if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
25 		dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 report descriptor.\n");
26 		rdesc[53] = 0x65;
27 	} return rdesc;
28 }
29 
30 static const struct hid_device_id aureal_devices[] = {
31 	{ HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
32 	{ }
33 };
34 MODULE_DEVICE_TABLE(hid, aureal_devices);
35 
36 static struct hid_driver aureal_driver = {
37 	.name = "aureal",
38 	.id_table = aureal_devices,
39 	.report_fixup = aureal_report_fixup,
40 };
41 
42 static int __init aureal_init(void)
43 {
44 	return hid_register_driver(&aureal_driver);
45 }
46 
47 static void __exit aureal_exit(void)
48 {
49 	hid_unregister_driver(&aureal_driver);
50 }
51 
52 module_init(aureal_init);
53 module_exit(aureal_exit);
54 MODULE_LICENSE("GPL");
55