aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-tmff.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-05-15 09:46:44 -0400
committerJiri Kosina <jkosina@suse.cz>2009-05-15 09:51:36 -0400
commit0f6f4319a72a2b32d19643ff811f25633d8b0207 (patch)
treec9b482414ff2d974736a7e829d22aaf50b94d82b /drivers/hid/hid-tmff.c
parentfac733f029251a393c42a8313432f2d9fe43bb83 (diff)
HID: fix hid-ff drivers so that devices work even without ff support
Currently, the hid-*ff force feedback drivers, which claim the blacklisted device on a HID bus, are only compiled in if the user selects force feedback support. However we want the device to be supported even when the kernel is configured without force feedback. This patch fixes the drivers in a way that they get compiled even if force feedback is turned off; all the force feedback support code is compiled out in such case, and the driver works as a usual driver on HID bus, claiming and initializing the device, making it operational without FF effects. Reported-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-tmff.c')
-rw-r--r--drivers/hid/hid-tmff.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c
index 7c1f7b50330c..fcd6ccd02fee 100644
--- a/drivers/hid/hid-tmff.c
+++ b/drivers/hid/hid-tmff.c
@@ -33,11 +33,6 @@
33 33
34#include "hid-ids.h" 34#include "hid-ids.h"
35 35
36#include "usbhid/usbhid.h"
37
38/* Usages for thrustmaster devices I know about */
39#define THRUSTMASTER_USAGE_FF (HID_UP_GENDESK | 0xbb)
40
41static const signed short ff_rumble[] = { 36static const signed short ff_rumble[] = {
42 FF_RUMBLE, 37 FF_RUMBLE,
43 -1 38 -1
@@ -48,6 +43,12 @@ static const signed short ff_joystick[] = {
48 -1 43 -1
49}; 44};
50 45
46#ifdef CONFIG_THRUSTMASTER_FF
47#include "usbhid/usbhid.h"
48
49/* Usages for thrustmaster devices I know about */
50#define THRUSTMASTER_USAGE_FF (HID_UP_GENDESK | 0xbb)
51
51struct tmff_device { 52struct tmff_device {
52 struct hid_report *report; 53 struct hid_report *report;
53 struct hid_field *ff_field; 54 struct hid_field *ff_field;
@@ -209,6 +210,12 @@ fail:
209 kfree(tmff); 210 kfree(tmff);
210 return error; 211 return error;
211} 212}
213#else
214static inline int tmff_init(struct hid_device *hid, const signed short *ff_bits)
215{
216 return 0;
217}
218#endif
212 219
213static int tm_probe(struct hid_device *hdev, const struct hid_device_id *id) 220static int tm_probe(struct hid_device *hdev, const struct hid_device_id *id)
214{ 221{