diff options
author | Sean Young <sean@mess.org> | 2011-08-14 15:42:05 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-08-15 17:36:43 -0400 |
commit | ad395ccadb6b2f0a4f9e004c9e6f2a8c22091ed0 (patch) | |
tree | 6c5f27a04a15392df8759efa56236a6130608a5f | |
parent | f6f554f09c5b831efdaf67c449e18ca06ee648fe (diff) |
IHD: Support force feedback on MP-8866
Support force feedback on the Dual USB Force Feedback Joypad (MP-8866).
Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-sjoy.c | 68 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 1 |
3 files changed, 38 insertions, 32 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 681387377ed3..d34eb34dbe25 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1517,6 +1517,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1517 | { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) }, | 1517 | { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) }, |
1518 | { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, | 1518 | { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, |
1519 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, | 1519 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, |
1520 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) }, | ||
1520 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) }, | 1521 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) }, |
1521 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, | 1522 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, |
1522 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, | 1523 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, |
diff --git a/drivers/hid/hid-sjoy.c b/drivers/hid/hid-sjoy.c index 16f7cafc9695..810425f2df58 100644 --- a/drivers/hid/hid-sjoy.c +++ b/drivers/hid/hid-sjoy.c | |||
@@ -65,8 +65,7 @@ static int sjoyff_init(struct hid_device *hid) | |||
65 | { | 65 | { |
66 | struct sjoyff_device *sjoyff; | 66 | struct sjoyff_device *sjoyff; |
67 | struct hid_report *report; | 67 | struct hid_report *report; |
68 | struct hid_input *hidinput = list_entry(hid->inputs.next, | 68 | struct hid_input *hidinput; |
69 | struct hid_input, list); | ||
70 | struct list_head *report_list = | 69 | struct list_head *report_list = |
71 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; | 70 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; |
72 | struct list_head *report_ptr = report_list; | 71 | struct list_head *report_ptr = report_list; |
@@ -78,43 +77,45 @@ static int sjoyff_init(struct hid_device *hid) | |||
78 | return -ENODEV; | 77 | return -ENODEV; |
79 | } | 78 | } |
80 | 79 | ||
81 | report_ptr = report_ptr->next; | 80 | list_for_each_entry(hidinput, &hid->inputs, list) { |
81 | report_ptr = report_ptr->next; | ||
82 | 82 | ||
83 | if (report_ptr == report_list) { | 83 | if (report_ptr == report_list) { |
84 | hid_err(hid, "required output report is missing\n"); | 84 | hid_err(hid, "required output report is missing\n"); |
85 | return -ENODEV; | 85 | return -ENODEV; |
86 | } | 86 | } |
87 | 87 | ||
88 | report = list_entry(report_ptr, struct hid_report, list); | 88 | report = list_entry(report_ptr, struct hid_report, list); |
89 | if (report->maxfield < 1) { | 89 | if (report->maxfield < 1) { |
90 | hid_err(hid, "no fields in the report\n"); | 90 | hid_err(hid, "no fields in the report\n"); |
91 | return -ENODEV; | 91 | return -ENODEV; |
92 | } | 92 | } |
93 | 93 | ||
94 | if (report->field[0]->report_count < 3) { | 94 | if (report->field[0]->report_count < 3) { |
95 | hid_err(hid, "not enough values in the field\n"); | 95 | hid_err(hid, "not enough values in the field\n"); |
96 | return -ENODEV; | 96 | return -ENODEV; |
97 | } | 97 | } |
98 | 98 | ||
99 | sjoyff = kzalloc(sizeof(struct sjoyff_device), GFP_KERNEL); | 99 | sjoyff = kzalloc(sizeof(struct sjoyff_device), GFP_KERNEL); |
100 | if (!sjoyff) | 100 | if (!sjoyff) |
101 | return -ENOMEM; | 101 | return -ENOMEM; |
102 | 102 | ||
103 | dev = hidinput->input; | 103 | dev = hidinput->input; |
104 | 104 | ||
105 | set_bit(FF_RUMBLE, dev->ffbit); | 105 | set_bit(FF_RUMBLE, dev->ffbit); |
106 | 106 | ||
107 | error = input_ff_create_memless(dev, sjoyff, hid_sjoyff_play); | 107 | error = input_ff_create_memless(dev, sjoyff, hid_sjoyff_play); |
108 | if (error) { | 108 | if (error) { |
109 | kfree(sjoyff); | 109 | kfree(sjoyff); |
110 | return error; | 110 | return error; |
111 | } | 111 | } |
112 | 112 | ||
113 | sjoyff->report = report; | 113 | sjoyff->report = report; |
114 | sjoyff->report->field[0]->value[0] = 0x01; | 114 | sjoyff->report->field[0]->value[0] = 0x01; |
115 | sjoyff->report->field[0]->value[1] = 0x00; | 115 | sjoyff->report->field[0]->value[1] = 0x00; |
116 | sjoyff->report->field[0]->value[2] = 0x00; | 116 | sjoyff->report->field[0]->value[2] = 0x00; |
117 | usbhid_submit_report(hid, sjoyff->report, USB_DIR_OUT); | 117 | usbhid_submit_report(hid, sjoyff->report, USB_DIR_OUT); |
118 | } | ||
118 | 119 | ||
119 | hid_info(hid, "Force feedback for SmartJoy PLUS PS2/USB adapter\n"); | 120 | hid_info(hid, "Force feedback for SmartJoy PLUS PS2/USB adapter\n"); |
120 | 121 | ||
@@ -131,6 +132,8 @@ static int sjoy_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
131 | { | 132 | { |
132 | int ret; | 133 | int ret; |
133 | 134 | ||
135 | hdev->quirks |= id->driver_data; | ||
136 | |||
134 | ret = hid_parse(hdev); | 137 | ret = hid_parse(hdev); |
135 | if (ret) { | 138 | if (ret) { |
136 | hid_err(hdev, "parse failed\n"); | 139 | hid_err(hdev, "parse failed\n"); |
@@ -152,6 +155,9 @@ err: | |||
152 | 155 | ||
153 | static const struct hid_device_id sjoy_devices[] = { | 156 | static const struct hid_device_id sjoy_devices[] = { |
154 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, | 157 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, |
158 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD), | ||
159 | .driver_data = HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET | | ||
160 | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | ||
155 | { } | 161 | { } |
156 | }; | 162 | }; |
157 | MODULE_DEVICE_TABLE(hid, sjoy_devices); | 163 | MODULE_DEVICE_TABLE(hid, sjoy_devices); |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 621959d5cc42..df618a3f951c 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -79,7 +79,6 @@ static const struct hid_blacklist { | |||
79 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U, HID_QUIRK_MULTI_INPUT }, | 79 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U, HID_QUIRK_MULTI_INPUT }, |
80 | { USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH, HID_QUIRK_MULTI_INPUT }, | 80 | { USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH, HID_QUIRK_MULTI_INPUT }, |
81 | { USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH, HID_QUIRK_MULTI_INPUT }, | 81 | { USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH, HID_QUIRK_MULTI_INPUT }, |
82 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | ||
83 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 82 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
84 | 83 | ||
85 | { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 84 | { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |