[PATCH 1/1] R.A.T.5 also works with hid-saitek

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sorry for the old kernel. tell me if it failed to apply.

and I have a question, since I know nothing of linux-programming:
in include/linux/hidraw.h there is a struct hidraw defined.
obviously one of these is assigned to each device.
also hid-saitek.c uses that and stores its data inside.
more exactly in ->hid->dev->mode is a value I'd like to read.
what is the proper way to do that? is it possible from userspace?
hid-saitek module removes information on what colour the mode-LED has.
that information is stored in the mode variable of struct saitec_sc.
since that struct is only defined in the c-sources, I have a problem?
would it be sufficient to move that definition into include/?
any suggestions on where to?

P
Signed-off-by: Piotr Sawuk <piotr5@xxxxxxxxxxxx>
---
add support for mad catz r.a.t.5

diff -rup linux-4.2.6-gentoo/drivers/hid/hid-core.c linux-4.2.6-gentoo-rat5/drivers/hid/hid-core.c
--- linux-4.2.6-gentoo/drivers/hid/hid-core.c	2015-08-30 20:34:09.000000000 +0200
+++ linux-4.2.6-gentoo-rat5/drivers/hid/hid-core.c	2015-12-30 12:09:14.340841552 +0100
@@ -1959,6 +1959,7 @@ static const struct hid_device_id hid_ha
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT5) },
 #endif
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
diff -rup linux-4.2.6-gentoo/drivers/hid/hid-ids.h linux-4.2.6-gentoo-rat5/drivers/hid/hid-ids.h
--- linux-4.2.6-gentoo/drivers/hid/hid-ids.h	2015-08-30 20:34:09.000000000 +0200
+++ linux-4.2.6-gentoo-rat5/drivers/hid/hid-ids.h	2015-12-29 18:47:36.756225217 +0100
@@ -634,6 +634,7 @@
 
 #define USB_VENDOR_ID_MADCATZ		0x0738
 #define USB_DEVICE_ID_MADCATZ_BEATPAD	0x4540
+#define USB_DEVICE_ID_MADCATZ_RAT5	0x1705
 #define USB_DEVICE_ID_MADCATZ_RAT9	0x1709
 
 #define USB_VENDOR_ID_MCC		0x09db
diff -rup linux-4.2.6-gentoo/drivers/hid/hid-saitek.c linux-4.2.6-gentoo-rat5/drivers/hid/hid-saitek.c
--- linux-4.2.6-gentoo/drivers/hid/hid-saitek.c	2015-08-30 20:34:09.000000000 +0200
+++ linux-4.2.6-gentoo-rat5/drivers/hid/hid-saitek.c	2015-12-30 12:11:59.264802539 +0100
@@ -181,6 +181,8 @@ static const struct hid_device_id saitek
 		.driver_data = SAITEK_RELEASE_MODE_RAT7 },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7),
 		.driver_data = SAITEK_RELEASE_MODE_RAT7 },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT5),
+		.driver_data = SAITEK_RELEASE_MODE_RAT7 },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9),
 		.driver_data = SAITEK_RELEASE_MODE_RAT7 },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7),
diff -rup linux-4.2.6-gentoo/drivers/hid/Kconfig linux-4.2.6-gentoo-rat5/drivers/hid/Kconfig
--- linux-4.2.6-gentoo/drivers/hid/Kconfig	2015-08-30 20:34:09.000000000 +0200
+++ linux-4.2.6-gentoo-rat5/drivers/hid/Kconfig	2015-12-30 12:14:49.228404039 +0100
@@ -665,6 +665,7 @@ config HID_SAITEK
 
 	Supported devices:
 	- PS1000 Dual Analog Pad
+	- R.A.T.5 Gaming Mouse
 	- R.A.T.9 Gaming Mouse
 	- R.A.T.7 Gaming Mouse
 	- M.M.O.7 Gaming Mouse
-- 

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux