blob: 161917c91ca843d1810d1533ead7687b4d478fe8 [file] [log] [blame]
Simon Wood75dbb952013-01-31 08:07:07 -07001/*
2 * HID driver for Steelseries SRW-S1
3 *
4 * Copyright (c) 2013 Simon Wood
5 */
6
7/*
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 */
13
14#include <linux/device.h>
15#include <linux/hid.h>
16#include <linux/module.h>
17
18#include "hid-ids.h"
19
20static __u8 *steelseries_srws1_report_fixup(struct hid_device *hdev, __u8 *rdesc,
21 unsigned int *rsize)
22{
23 if (*rsize >= 115 && rdesc[11] == 0x02 && rdesc[13] == 0xc8
24 && rdesc[29] == 0xbb && rdesc[40] == 0xc5) {
25 hid_info(hdev, "Fixing up Steelseries SRW-S1 report descriptor\n");
26 rdesc[11] = 0x01;
27 rdesc[13] = 0x30;
28 rdesc[29] = 0x31;
29 rdesc[40] = 0x32;
30 }
31 return rdesc;
32}
33
34static const struct hid_device_id steelseries_srws1_devices[] = {
35 { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
36 { }
37};
38MODULE_DEVICE_TABLE(hid, steelseries_srws1_devices);
39
40static struct hid_driver steelseries_srws1_driver = {
41 .name = "steelseries_srws1",
42 .id_table = steelseries_srws1_devices,
43 .report_fixup = steelseries_srws1_report_fixup
44};
45
46static int __init steelseries_srws1_init(void)
47{
48 return hid_register_driver(&steelseries_srws1_driver);
49}
50
51static void __exit steelseries_srws1_exit(void)
52{
53 hid_unregister_driver(&steelseries_srws1_driver);
54}
55
56module_init(steelseries_srws1_init);
57module_exit(steelseries_srws1_exit);
58MODULE_LICENSE("GPL");