diff options
author | Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de> | 2013-01-17 05:06:09 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-17 05:06:09 -0500 |
commit | aaca9cc0165f06a037a1e07770f6b379ff496288 (patch) | |
tree | e2ed0e6dca0fe7a3bf31159f9163ae201071a981 /drivers/hid | |
parent | fee5dfecb0c74c9eab475a2a20d7a5ababe2f8e6 (diff) |
HID: Support Jess/Saitek Color Rumble Pad
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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
-rw-r--r-- | drivers/hid/hid-pl.c | 13 |
3 files changed, 15 insertions, 2 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index eb2ee11b6412..aad262727300 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[] = { | |||
1599 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) }, | 1599 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) }, |
1600 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) }, | 1600 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) }, |
1601 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, | 1601 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, |
1602 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, | ||
1602 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, | 1603 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, |
1603 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | 1604 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, |
1604 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, | 1605 | { 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 4dfa605e2d14..3a493345ded0 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -442,6 +442,9 @@ | |||
442 | #define USB_VENDOR_ID_JESS 0x0c45 | 442 | #define USB_VENDOR_ID_JESS 0x0c45 |
443 | #define USB_DEVICE_ID_JESS_YUREX 0x1010 | 443 | #define USB_DEVICE_ID_JESS_YUREX 0x1010 |
444 | 444 | ||
445 | #define USB_VENDOR_ID_JESS2 0x0f30 | ||
446 | #define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111 | ||
447 | |||
445 | #define USB_VENDOR_ID_KBGEAR 0x084e | 448 | #define USB_VENDOR_ID_KBGEAR 0x084e |
446 | #define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001 | 449 | #define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001 |
447 | 450 | ||
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c index 123977e5aeee..b0199d27787b 100644 --- a/drivers/hid/hid-pl.c +++ b/drivers/hid/hid-pl.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * 0e8f:0003 "GASIA USB Gamepad" | 14 | * 0e8f:0003 "GASIA USB Gamepad" |
15 | * - another version of the König gamepad | 15 | * - another version of the König gamepad |
16 | * | 16 | * |
17 | * 0f30:0111 "Saitek Color Rumble Pad" | ||
18 | * | ||
17 | * Copyright (c) 2007, 2009 Anssi Hannula <anssi.hannula@gmail.com> | 19 | * Copyright (c) 2007, 2009 Anssi Hannula <anssi.hannula@gmail.com> |
18 | */ | 20 | */ |
19 | 21 | ||
@@ -51,6 +53,7 @@ | |||
51 | 53 | ||
52 | struct plff_device { | 54 | struct plff_device { |
53 | struct hid_report *report; | 55 | struct hid_report *report; |
56 | s32 maxval; | ||
54 | s32 *strong; | 57 | s32 *strong; |
55 | s32 *weak; | 58 | s32 *weak; |
56 | }; | 59 | }; |
@@ -66,8 +69,8 @@ static int hid_plff_play(struct input_dev *dev, void *data, | |||
66 | right = effect->u.rumble.weak_magnitude; | 69 | right = effect->u.rumble.weak_magnitude; |
67 | debug("called with 0x%04x 0x%04x", left, right); | 70 | debug("called with 0x%04x 0x%04x", left, right); |
68 | 71 | ||
69 | left = left * 0x7f / 0xffff; | 72 | left = left * plff->maxval / 0xffff; |
70 | right = right * 0x7f / 0xffff; | 73 | right = right * plff->maxval / 0xffff; |
71 | 74 | ||
72 | *plff->strong = left; | 75 | *plff->strong = left; |
73 | *plff->weak = right; | 76 | *plff->weak = right; |
@@ -87,6 +90,7 @@ static int plff_init(struct hid_device *hid) | |||
87 | struct list_head *report_ptr = report_list; | 90 | struct list_head *report_ptr = report_list; |
88 | struct input_dev *dev; | 91 | struct input_dev *dev; |
89 | int error; | 92 | int error; |
93 | s32 maxval; | ||
90 | s32 *strong; | 94 | s32 *strong; |
91 | s32 *weak; | 95 | s32 *weak; |
92 | 96 | ||
@@ -123,6 +127,7 @@ static int plff_init(struct hid_device *hid) | |||
123 | return -ENODEV; | 127 | return -ENODEV; |
124 | } | 128 | } |
125 | 129 | ||
130 | maxval = 0x7f; | ||
126 | if (report->field[0]->report_count >= 4) { | 131 | if (report->field[0]->report_count >= 4) { |
127 | report->field[0]->value[0] = 0x00; | 132 | report->field[0]->value[0] = 0x00; |
128 | report->field[0]->value[1] = 0x00; | 133 | report->field[0]->value[1] = 0x00; |
@@ -135,6 +140,8 @@ static int plff_init(struct hid_device *hid) | |||
135 | report->field[1]->value[0] = 0x00; | 140 | report->field[1]->value[0] = 0x00; |
136 | strong = &report->field[2]->value[0]; | 141 | strong = &report->field[2]->value[0]; |
137 | weak = &report->field[3]->value[0]; | 142 | weak = &report->field[3]->value[0]; |
143 | if (hid->vendor == USB_VENDOR_ID_JESS2) | ||
144 | maxval = 0xff; | ||
138 | debug("detected 4-field device"); | 145 | debug("detected 4-field device"); |
139 | } else { | 146 | } else { |
140 | hid_err(hid, "not enough fields or values\n"); | 147 | hid_err(hid, "not enough fields or values\n"); |
@@ -158,6 +165,7 @@ static int plff_init(struct hid_device *hid) | |||
158 | plff->report = report; | 165 | plff->report = report; |
159 | plff->strong = strong; | 166 | plff->strong = strong; |
160 | plff->weak = weak; | 167 | plff->weak = weak; |
168 | plff->maxval = maxval; | ||
161 | 169 | ||
162 | *strong = 0x00; | 170 | *strong = 0x00; |
163 | *weak = 0x00; | 171 | *weak = 0x00; |
@@ -207,6 +215,7 @@ static const struct hid_device_id pl_devices[] = { | |||
207 | { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR), | 215 | { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR), |
208 | .driver_data = 1 }, /* Twin USB Joystick */ | 216 | .driver_data = 1 }, /* Twin USB Joystick */ |
209 | { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003), }, | 217 | { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003), }, |
218 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD), }, | ||
210 | { } | 219 | { } |
211 | }; | 220 | }; |
212 | MODULE_DEVICE_TABLE(hid, pl_devices); | 221 | MODULE_DEVICE_TABLE(hid, pl_devices); |