diff options
author | Simon Wood <simon@mungewell.org> | 2013-01-31 10:07:07 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-31 10:39:30 -0500 |
commit | 75dbb9530f73da521b871ba3c4bd32f301a62635 (patch) | |
tree | 048decb76c76becc1c77c3b35b98da8248a70043 /drivers | |
parent | fd62c5450324af7f6cc12897b09b77285cd48a92 (diff) |
USB: HID: SRW-S1 Gaming Wheel Driver
Add support the SRW-S1 by patching HID descriptor to read axis
as Generic Desktop X, Y and Z (rather than Usage page being
'Simulation').
Signed-off-by: Simon Wood <simon@mungewell.org>
Tested-by: John Murphy <rosegardener@freeode.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/Kconfig | 6 | ||||
-rw-r--r-- | drivers/hid/Makefile | 1 | ||||
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
-rw-r--r-- | drivers/hid/hid-steelseries-srws1.c | 58 |
5 files changed, 69 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index e7d6a13ec6a6..37df92ffba50 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -596,6 +596,12 @@ config HID_SPEEDLINK | |||
596 | ---help--- | 596 | ---help--- |
597 | Support for Speedlink Vicious and Divine Cezanne mouse. | 597 | Support for Speedlink Vicious and Divine Cezanne mouse. |
598 | 598 | ||
599 | config HID_STEELSERIES_SRWS1 | ||
600 | tristate "Steelseries SRW-S1 steering wheel support" | ||
601 | depends on USB_HID | ||
602 | ---help--- | ||
603 | Support for Steelseries SRW-S1 steering wheel | ||
604 | |||
599 | config HID_SUNPLUS | 605 | config HID_SUNPLUS |
600 | tristate "Sunplus wireless desktop" | 606 | tristate "Sunplus wireless desktop" |
601 | depends on USB_HID | 607 | depends on USB_HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index b62215716b2f..bbebe0a49798 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -101,6 +101,7 @@ obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o | |||
101 | obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o | 101 | obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o |
102 | obj-$(CONFIG_HID_SONY) += hid-sony.o | 102 | obj-$(CONFIG_HID_SONY) += hid-sony.o |
103 | obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o | 103 | obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o |
104 | obj-$(CONFIG_HID_STEELSERIES_SRWS1) += hid-steelseries-srws1.o | ||
104 | obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o | 105 | obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o |
105 | obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o | 106 | obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o |
106 | obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o | 107 | obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index eb2ee11b6412..65cda7f95822 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1697,6 +1697,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1697 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) }, | 1697 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) }, |
1698 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, | 1698 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, |
1699 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, | 1699 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, |
1700 | { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) }, | ||
1700 | { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, | 1701 | { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, |
1701 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) }, | 1702 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) }, |
1702 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) }, | 1703 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 4dfa605e2d14..f5976f380e1f 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -723,6 +723,9 @@ | |||
723 | #define USB_VENDOR_ID_STANTUM_SITRONIX 0x1403 | 723 | #define USB_VENDOR_ID_STANTUM_SITRONIX 0x1403 |
724 | #define USB_DEVICE_ID_MTP_SITRONIX 0x5001 | 724 | #define USB_DEVICE_ID_MTP_SITRONIX 0x5001 |
725 | 725 | ||
726 | #define USB_VENDOR_ID_STEELSERIES 0x1038 | ||
727 | #define USB_DEVICE_ID_STEELSERIES_SRWS1 0x1410 | ||
728 | |||
726 | #define USB_VENDOR_ID_SUN 0x0430 | 729 | #define USB_VENDOR_ID_SUN 0x0430 |
727 | #define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab | 730 | #define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab |
728 | 731 | ||
diff --git a/drivers/hid/hid-steelseries-srws1.c b/drivers/hid/hid-steelseries-srws1.c new file mode 100644 index 000000000000..161917c91ca8 --- /dev/null +++ b/drivers/hid/hid-steelseries-srws1.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
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 | |||
20 | static __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 | |||
34 | static const struct hid_device_id steelseries_srws1_devices[] = { | ||
35 | { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) }, | ||
36 | { } | ||
37 | }; | ||
38 | MODULE_DEVICE_TABLE(hid, steelseries_srws1_devices); | ||
39 | |||
40 | static 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 | |||
46 | static int __init steelseries_srws1_init(void) | ||
47 | { | ||
48 | return hid_register_driver(&steelseries_srws1_driver); | ||
49 | } | ||
50 | |||
51 | static void __exit steelseries_srws1_exit(void) | ||
52 | { | ||
53 | hid_unregister_driver(&steelseries_srws1_driver); | ||
54 | } | ||
55 | |||
56 | module_init(steelseries_srws1_init); | ||
57 | module_exit(steelseries_srws1_exit); | ||
58 | MODULE_LICENSE("GPL"); | ||