All of lore.kernel.org
 help / color / mirror / Atom feed
From: Piotr Sawuk <piotr5@users.sf.net>
To: linux-input@vger.kernel.org
Subject: [PATCH 1/1] R.A.T.5 also works with hid-saitek
Date: Wed, 30 Dec 2015 18:34:17 +0100	[thread overview]
Message-ID: <56841599.5050800@users.sf.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 723 bytes --]

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

[-- Attachment #2: RAT5.patch --]
[-- Type: text/x-patch, Size: 2622 bytes --]

Signed-off-by: Piotr Sawuk <piotr5@users.sf.net>
---
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
-- 

             reply	other threads:[~2015-12-30 17:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 17:34 Piotr Sawuk [this message]
2016-01-03 10:45 ` [PATCH 1/1] R.A.T.5 also works with hid-saitek Clément Vuchener
2016-01-09 12:36   ` Piotr Sawuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56841599.5050800@users.sf.net \
    --to=piotr5@users.sf.net \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.