Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Simon Wood and committed by
Jiri Kosina
75dbb953 fd62c545

+69
+6
drivers/hid/Kconfig
··· 596 596 ---help--- 597 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 605 config HID_SUNPLUS 600 606 tristate "Sunplus wireless desktop" 601 607 depends on USB_HID
+1
drivers/hid/Makefile
··· 101 101 obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o 102 102 obj-$(CONFIG_HID_SONY) += hid-sony.o 103 103 obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o 104 + obj-$(CONFIG_HID_STEELSERIES_SRWS1) += hid-steelseries-srws1.o 104 105 obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o 105 106 obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o 106 107 obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
+1
drivers/hid/hid-core.c
··· 1697 1697 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) }, 1698 1698 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, 1699 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 1701 { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, 1701 1702 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) }, 1702 1703 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
+3
drivers/hid/hid-ids.h
··· 723 723 #define USB_VENDOR_ID_STANTUM_SITRONIX 0x1403 724 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 729 #define USB_VENDOR_ID_SUN 0x0430 727 730 #define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab 728 731
+58
drivers/hid/hid-steelseries-srws1.c
··· 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");