* Rumble support for Jess/Saitek "color rumble pad"
@ 2012-12-18 0:48 Michael Karcher
2013-01-03 9:44 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: Michael Karcher @ 2012-12-18 0:48 UTC (permalink / raw)
To: linux-input
Cc: Jiri Kosina, linux-kernel, Pantelis Koukousoulas, Anssi Hannula
[-- Attachment #1: Type: text/plain, Size: 750 bytes --]
Hello developers (and testers)
The attached pad adds supports for another gamepad to the hid-pl driver.
The "color rumble pad P580" marketed using the "Saitek" brand in
Germany, and using a USB Vendor ID attributed to "Jess" seems to be
electronically identical to the 4-field variant of the "Green Asia"
gamepad.
The pad has been tested to support rumble strengths up to 255, not just
127. Currently the patch discriminates the pads by an if on the vendor
ID, a bit in the driver_data field with definitely do better, but I
recommend the owners of the 4-field green asia pad to verify whether the
maximum rumble strength is indeed only 127, otherwise the condition
should be removed entirely and 255 used in all cases.
Regards,
Michael Karcher
[-- Attachment #2: 0001-Support-Jess-Saitek-Color-Rumble-Pad.patch --]
[-- Type: text/x-patch, Size: 3011 bytes --]
>From 935b0e9f08bf7b4d271eab3356eacc1b7c47eb73 Mon Sep 17 00:00:00 2001
From: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Date: Mon, 17 Dec 2012 08:41:37 +0100
Subject: [PATCH] Support Jess/Saitek Color Rumble Pad
---
drivers/hid/hid-ids.h | 3 +++
drivers/hid/hid-pl.c | 13 +++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 3203923..9267188 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -419,6 +419,9 @@
#define USB_VENDOR_ID_JESS 0x0c45
#define USB_DEVICE_ID_JESS_YUREX 0x1010
+#define USB_VENDOR_ID_JESS2 0x0f30
+#define USB_DEVICE_ID_JESS_COLOR_RUMBLE_PAD 0x0111
+
#define USB_VENDOR_ID_KBGEAR 0x084e
#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c
index 47ed74c..825d102 100644
--- a/drivers/hid/hid-pl.c
+++ b/drivers/hid/hid-pl.c
@@ -14,6 +14,8 @@
* 0e8f:0003 "GASIA USB Gamepad"
* - another version of the König gamepad
*
+ * 0f30:0111 "Saitek Color Rumble Pad"
+ *
* Copyright (c) 2007, 2009 Anssi Hannula <anssi.hannula@gmail.com>
*/
@@ -51,6 +53,7 @@
struct plff_device {
struct hid_report *report;
+ s32 maxval;
s32 *strong;
s32 *weak;
};
@@ -66,8 +69,8 @@ static int hid_plff_play(struct input_dev *dev, void *data,
right = effect->u.rumble.weak_magnitude;
debug("called with 0x%04x 0x%04x", left, right);
- left = left * 0x7f / 0xffff;
- right = right * 0x7f / 0xffff;
+ left = left * plff->maxval / 0xffff;
+ right = right * plff->maxval / 0xffff;
*plff->strong = left;
*plff->weak = right;
@@ -87,6 +90,7 @@ static int plff_init(struct hid_device *hid)
struct list_head *report_ptr = report_list;
struct input_dev *dev;
int error;
+ s32 maxval;
s32 *strong;
s32 *weak;
@@ -123,6 +127,7 @@ static int plff_init(struct hid_device *hid)
return -ENODEV;
}
+ maxval = 0x7f;
if (report->field[0]->report_count >= 4) {
report->field[0]->value[0] = 0x00;
report->field[0]->value[1] = 0x00;
@@ -135,6 +140,8 @@ static int plff_init(struct hid_device *hid)
report->field[1]->value[0] = 0x00;
strong = &report->field[2]->value[0];
weak = &report->field[3]->value[0];
+ if (hid->vendor == USB_VENDOR_ID_JESS2)
+ maxval = 0xff;
debug("detected 4-field device");
} else {
hid_err(hid, "not enough fields or values\n");
@@ -158,6 +165,7 @@ static int plff_init(struct hid_device *hid)
plff->report = report;
plff->strong = strong;
plff->weak = weak;
+ plff->maxval = maxval;
*strong = 0x00;
*weak = 0x00;
@@ -207,6 +215,7 @@ static const struct hid_device_id pl_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR),
.driver_data = 1 }, /* Twin USB Joystick */
{ HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003), },
+ { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS_COLOR_RUMBLE_PAD), },
{ }
};
MODULE_DEVICE_TABLE(hid, pl_devices);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Rumble support for Jess/Saitek "color rumble pad"
2012-12-18 0:48 Rumble support for Jess/Saitek "color rumble pad" Michael Karcher
@ 2013-01-03 9:44 ` Jiri Kosina
2013-01-15 17:57 ` [PATCH] Support Jess/Saitek Color Rumble Pad Michael Karcher
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2013-01-03 9:44 UTC (permalink / raw)
To: Michael Karcher
Cc: linux-input, linux-kernel, Pantelis Koukousoulas, Anssi Hannula
On Tue, 18 Dec 2012, Michael Karcher wrote:
> Hello developers (and testers)
>
> The attached pad adds supports for another gamepad to the hid-pl driver.
> The "color rumble pad P580" marketed using the "Saitek" brand in
> Germany, and using a USB Vendor ID attributed to "Jess" seems to be
> electronically identical to the 4-field variant of the "Green Asia"
> gamepad.
>
> The pad has been tested to support rumble strengths up to 255, not just
> 127. Currently the patch discriminates the pads by an if on the vendor
> ID, a bit in the driver_data field with definitely do better, but I
> recommend the owners of the 4-field green asia pad to verify whether the
> maximum rumble strength is indeed only 127, otherwise the condition
> should be removed entirely and 255 used in all cases.
Hi Michael,
thanks for the patch. A couple of requests before I can apply it:
- please provide the patch in-line in the e-mail body if your client
doesn't corrupt patches. It's eaiser to review it that way
- please add your Signed-off-by: line as described in
Documentation/SubmittingPatches
- don't forget to add the VID/PID to hid_ignore_list[], otherwise the
device <-> driver binding will not work properly
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Support Jess/Saitek Color Rumble Pad
2013-01-03 9:44 ` Jiri Kosina
@ 2013-01-15 17:57 ` Michael Karcher
2013-01-17 10:08 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: Michael Karcher @ 2013-01-15 17:57 UTC (permalink / raw)
To: Jiri Kosina, linux-input, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 582 bytes --]
Add support for another gamepad to the hid-pl driver.
The "color rumble pad P580" marketed using the "Saitek" brand in
Germany, and using a USB Vendor ID attributed to "Jess" seems to be
electronically identical to the 4-field variant of the "Green Asia"
gamepad.
The pad has been tested to support rumble strengths up to 255, not
just 127.
Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
---
drivers/hid/hid-core.c | 1 +
drivers/hid/hid-ids.h | 3 +++
drivers/hid/hid-pl.c | 13 +++++++++++--
3 files changed, 15 insertions(+), 2 deletions(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Support-Jess-Saitek-Color-Rumble-Pad.patch --]
[-- Type: text/x-patch; name="0001-Support-Jess-Saitek-Color-Rumble-Pad.patch", Size: 3415 bytes --]
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index eb2ee11..aad2627 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1599,6 +1599,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 4dfa605..3a49334 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -442,6 +442,9 @@
#define USB_VENDOR_ID_JESS 0x0c45
#define USB_DEVICE_ID_JESS_YUREX 0x1010
+#define USB_VENDOR_ID_JESS2 0x0f30
+#define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
+
#define USB_VENDOR_ID_KBGEAR 0x084e
#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c
index 47ed74c..1768414 100644
--- a/drivers/hid/hid-pl.c
+++ b/drivers/hid/hid-pl.c
@@ -14,6 +14,8 @@
* 0e8f:0003 "GASIA USB Gamepad"
* - another version of the König gamepad
*
+ * 0f30:0111 "Saitek Color Rumble Pad"
+ *
* Copyright (c) 2007, 2009 Anssi Hannula <anssi.hannula@gmail.com>
*/
@@ -51,6 +53,7 @@
struct plff_device {
struct hid_report *report;
+ s32 maxval;
s32 *strong;
s32 *weak;
};
@@ -66,8 +69,8 @@ static int hid_plff_play(struct input_dev *dev, void *data,
right = effect->u.rumble.weak_magnitude;
debug("called with 0x%04x 0x%04x", left, right);
- left = left * 0x7f / 0xffff;
- right = right * 0x7f / 0xffff;
+ left = left * plff->maxval / 0xffff;
+ right = right * plff->maxval / 0xffff;
*plff->strong = left;
*plff->weak = right;
@@ -87,6 +90,7 @@ static int plff_init(struct hid_device *hid)
struct list_head *report_ptr = report_list;
struct input_dev *dev;
int error;
+ s32 maxval;
s32 *strong;
s32 *weak;
@@ -123,6 +127,7 @@ static int plff_init(struct hid_device *hid)
return -ENODEV;
}
+ maxval = 0x7f;
if (report->field[0]->report_count >= 4) {
report->field[0]->value[0] = 0x00;
report->field[0]->value[1] = 0x00;
@@ -135,6 +140,8 @@ static int plff_init(struct hid_device *hid)
report->field[1]->value[0] = 0x00;
strong = &report->field[2]->value[0];
weak = &report->field[3]->value[0];
+ if (hid->vendor == USB_VENDOR_ID_JESS2)
+ maxval = 0xff;
debug("detected 4-field device");
} else {
hid_err(hid, "not enough fields or values\n");
@@ -158,6 +165,7 @@ static int plff_init(struct hid_device *hid)
plff->report = report;
plff->strong = strong;
plff->weak = weak;
+ plff->maxval = maxval;
*strong = 0x00;
*weak = 0x00;
@@ -207,6 +215,7 @@ static const struct hid_device_id pl_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR),
.driver_data = 1 }, /* Twin USB Joystick */
{ HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003), },
+ { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD), },
{ }
};
MODULE_DEVICE_TABLE(hid, pl_devices);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Support Jess/Saitek Color Rumble Pad
2013-01-15 17:57 ` [PATCH] Support Jess/Saitek Color Rumble Pad Michael Karcher
@ 2013-01-17 10:08 ` Jiri Kosina
0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2013-01-17 10:08 UTC (permalink / raw)
To: Michael Karcher; +Cc: linux-input, linux-kernel
On Tue, 15 Jan 2013, Michael Karcher wrote:
>
> Add support for another gamepad to the hid-pl driver.
> The "color rumble pad P580" marketed using the "Saitek" brand in
> Germany, and using a USB Vendor ID attributed to "Jess" seems to be
> electronically identical to the 4-field variant of the "Green Asia"
> gamepad.
>
> The pad has been tested to support rumble strengths up to 255, not
> just 127.
>
> Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-17 10:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 0:48 Rumble support for Jess/Saitek "color rumble pad" Michael Karcher
2013-01-03 9:44 ` Jiri Kosina
2013-01-15 17:57 ` [PATCH] Support Jess/Saitek Color Rumble Pad Michael Karcher
2013-01-17 10:08 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).