aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/hid/Kconfig70
-rw-r--r--drivers/hid/Makefile8
-rw-r--r--drivers/hid/hid-drff.c8
-rw-r--r--drivers/hid/hid-gaff.c8
-rw-r--r--drivers/hid/hid-tmff.c17
-rw-r--r--drivers/hid/hid-zpff.c7
6 files changed, 94 insertions, 24 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 4cdf846da62c..7831a0318d3c 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -116,9 +116,16 @@ config HID_CYPRESS
116 ---help--- 116 ---help---
117 Support for cypress mouse and barcode readers. 117 Support for cypress mouse and barcode readers.
118 118
119config DRAGONRISE_FF 119config HID_DRAGONRISE
120 tristate "DragonRise Inc. force feedback support" 120 tristate "DragonRise Inc. support" if EMBEDDED
121 depends on USB_HID 121 depends on USB_HID
122 default !EMBEDDED
123 ---help---
124 Say Y here if you have DragonRise Inc.game controllers.
125
126config DRAGONRISE_FF
127 bool "DragonRise Inc. force feedback support"
128 depends on HID_DRAGONRISE
122 select INPUT_FF_MEMLESS 129 select INPUT_FF_MEMLESS
123 ---help--- 130 ---help---
124 Say Y here if you want to enable force feedback support for DragonRise Inc. 131 Say Y here if you want to enable force feedback support for DragonRise Inc.
@@ -160,7 +167,7 @@ config HID_LOGITECH
160 Support for Logitech devices that are not fully compliant with HID standard. 167 Support for Logitech devices that are not fully compliant with HID standard.
161 168
162config LOGITECH_FF 169config LOGITECH_FF
163 bool "Logitech force feedback" 170 bool "Logitech force feedback support"
164 depends on HID_LOGITECH 171 depends on HID_LOGITECH
165 select INPUT_FF_MEMLESS 172 select INPUT_FF_MEMLESS
166 help 173 help
@@ -176,7 +183,7 @@ config LOGITECH_FF
176 force feedback. 183 force feedback.
177 184
178config LOGIRUMBLEPAD2_FF 185config LOGIRUMBLEPAD2_FF
179 bool "Logitech Rumblepad 2 force feedback" 186 bool "Logitech Rumblepad 2 force feedback support"
180 depends on HID_LOGITECH 187 depends on HID_LOGITECH
181 select INPUT_FF_MEMLESS 188 select INPUT_FF_MEMLESS
182 help 189 help
@@ -211,11 +218,19 @@ config HID_PANTHERLORD
211 ---help--- 218 ---help---
212 Support for PantherLord/GreenAsia based device support. 219 Support for PantherLord/GreenAsia based device support.
213 220
221config HID_PANTHERLORD
222 tristate "Pantherlord support" if EMBEDDED
223 depends on USB_HID
224 default !EMBEDDED
225 ---help---
226 Say Y here if you have a PantherLord/GreenAsia based game controller
227 or adapter.
228
214config PANTHERLORD_FF 229config PANTHERLORD_FF
215 bool "Pantherlord force feedback support" 230 bool "Pantherlord force feedback support"
216 depends on HID_PANTHERLORD 231 depends on HID_PANTHERLORD
217 select INPUT_FF_MEMLESS 232 select INPUT_FF_MEMLESS
218 help 233 ---help---
219 Say Y here if you have a PantherLord/GreenAsia based game controller 234 Say Y here if you have a PantherLord/GreenAsia based game controller
220 or adapter and want to enable force feedback support for it. 235 or adapter and want to enable force feedback support for it.
221 236
@@ -247,9 +262,17 @@ config HID_SUNPLUS
247 ---help--- 262 ---help---
248 Support for Sunplus wireless desktop. 263 Support for Sunplus wireless desktop.
249 264
250config GREENASIA_FF 265config HID_GREENASIA
251 tristate "GreenAsia (Product ID 0x12) force feedback support" 266 tristate "GreenAsia (Product ID 0x12) support" if EMBEDDED
252 depends on USB_HID 267 depends on USB_HID
268 default !EMBEDDED
269 ---help---
270 Say Y here if you have a GreenAsia (Product ID 0x12) based game
271 controller or adapter.
272
273config GREENASIA_FF
274 bool "GreenAsia (Product ID 0x12) force feedback support"
275 depends on HID_GREENASIA
253 select INPUT_FF_MEMLESS 276 select INPUT_FF_MEMLESS
254 ---help--- 277 ---help---
255 Say Y here if you have a GreenAsia (Product ID 0x12) based game controller 278 Say Y here if you have a GreenAsia (Product ID 0x12) based game controller
@@ -278,13 +301,22 @@ config HID_TOPSEED
278 ---help--- 301 ---help---
279 Say Y if you have a TopSeed Cyberlink remote control. 302 Say Y if you have a TopSeed Cyberlink remote control.
280 303
281config THRUSTMASTER_FF 304config HID_THRUSTMASTER
282 tristate "ThrustMaster devices support" 305 tristate "ThrustMaster devices support" if EMBEDDED
283 depends on USB_HID 306 depends on USB_HID
307 default !EMBEDDED
308 ---help---
309 Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
310 a THRUSTMASTER Ferrari GT Rumble Wheel.
311
312config THRUSTMASTER_FF
313 bool "ThrustMaster devices force feedback support"
314 depends on HID_THRUSTMASTER
284 select INPUT_FF_MEMLESS 315 select INPUT_FF_MEMLESS
285 help 316 ---help---
286 Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or 317 Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
287 a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel. 318 a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel and
319 want to enable force feedback support for it.
288 320
289config HID_WACOM 321config HID_WACOM
290 tristate "Wacom Bluetooth devices support" if EMBEDDED 322 tristate "Wacom Bluetooth devices support" if EMBEDDED
@@ -293,13 +325,21 @@ config HID_WACOM
293 ---help--- 325 ---help---
294 Support for Wacom Graphire Bluetooth tablet. 326 Support for Wacom Graphire Bluetooth tablet.
295 327
296config ZEROPLUS_FF 328config HID_ZEROPLUS
297 tristate "Zeroplus based game controller support" 329 tristate "Zeroplus based game controller support" if EMBEDDED
298 depends on USB_HID 330 depends on USB_HID
299 select INPUT_FF_MEMLESS 331 default !EMBEDDED
300 help 332 ---help---
301 Say Y here if you have a Zeroplus based game controller. 333 Say Y here if you have a Zeroplus based game controller.
302 334
335config ZEROPLUS_FF
336 bool "Zeroplus based game controller force feedback support"
337 depends on HID_ZEROPLUS
338 select INPUT_FF_MEMLESS
339 ---help---
340 Say Y here if you have a Zeroplus based game controller and want
341 to have force feedback support for it.
342
303endmenu 343endmenu
304 344
305endif # HID_SUPPORT 345endif # HID_SUPPORT
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index eddd5b633b63..db35151673b1 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
22obj-$(CONFIG_HID_CHERRY) += hid-cherry.o 22obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
23obj-$(CONFIG_HID_CHICONY) += hid-chicony.o 23obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
24obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o 24obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
25obj-$(CONFIG_DRAGONRISE_FF) += hid-drff.o 25obj-$(CONFIG_HID_DRAGONRISE) += hid-drff.o
26obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o 26obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
27obj-$(CONFIG_HID_GYRATION) += hid-gyration.o 27obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
28obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o 28obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
@@ -37,10 +37,10 @@ obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
37obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o 37obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
38obj-$(CONFIG_HID_SONY) += hid-sony.o 38obj-$(CONFIG_HID_SONY) += hid-sony.o
39obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o 39obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
40obj-$(CONFIG_GREENASIA_FF) += hid-gaff.o 40obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
41obj-$(CONFIG_THRUSTMASTER_FF) += hid-tmff.o 41obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
42obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o 42obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
43obj-$(CONFIG_ZEROPLUS_FF) += hid-zpff.o 43obj-$(CONFIG_HID_ZEROPLUS) += hid-zpff.o
44obj-$(CONFIG_HID_WACOM) += hid-wacom.o 44obj-$(CONFIG_HID_WACOM) += hid-wacom.o
45 45
46obj-$(CONFIG_USB_HID) += usbhid/ 46obj-$(CONFIG_USB_HID) += usbhid/
diff --git a/drivers/hid/hid-drff.c b/drivers/hid/hid-drff.c
index 34f3eb65100b..a239d20ad7a5 100644
--- a/drivers/hid/hid-drff.c
+++ b/drivers/hid/hid-drff.c
@@ -32,6 +32,8 @@
32#include <linux/hid.h> 32#include <linux/hid.h>
33 33
34#include "hid-ids.h" 34#include "hid-ids.h"
35
36#ifdef CONFIG_DRAGONRISE_FF
35#include "usbhid/usbhid.h" 37#include "usbhid/usbhid.h"
36 38
37struct drff_device { 39struct drff_device {
@@ -135,6 +137,12 @@ static int drff_init(struct hid_device *hid)
135 137
136 return 0; 138 return 0;
137} 139}
140#else
141static inline int drff_init(struct hid_device *hid)
142{
143 return 0;
144}
145#endif
138 146
139static int dr_probe(struct hid_device *hdev, const struct hid_device_id *id) 147static int dr_probe(struct hid_device *hdev, const struct hid_device_id *id)
140{ 148{
diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c
index 510ad3ab8d33..8a11ccddaf2e 100644
--- a/drivers/hid/hid-gaff.c
+++ b/drivers/hid/hid-gaff.c
@@ -31,6 +31,8 @@
31#include <linux/usb.h> 31#include <linux/usb.h>
32#include <linux/hid.h> 32#include <linux/hid.h>
33#include "hid-ids.h" 33#include "hid-ids.h"
34
35#ifdef CONFIG_GREENASIA_FF
34#include "usbhid/usbhid.h" 36#include "usbhid/usbhid.h"
35 37
36struct gaff_device { 38struct gaff_device {
@@ -130,6 +132,12 @@ static int gaff_init(struct hid_device *hid)
130 132
131 return 0; 133 return 0;
132} 134}
135#else
136static inline int gaff_init(struct hid_device *hdev)
137{
138 return 0;
139}
140#endif
133 141
134static int ga_probe(struct hid_device *hdev, const struct hid_device_id *id) 142static int ga_probe(struct hid_device *hdev, const struct hid_device_id *id)
135{ 143{
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{
diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c
index 85a198a18537..57f710757bf4 100644
--- a/drivers/hid/hid-zpff.c
+++ b/drivers/hid/hid-zpff.c
@@ -27,6 +27,7 @@
27 27
28#include "hid-ids.h" 28#include "hid-ids.h"
29 29
30#ifdef CONFIG_ZEROPLUS_FF
30#include "usbhid/usbhid.h" 31#include "usbhid/usbhid.h"
31 32
32struct zpff_device { 33struct zpff_device {
@@ -108,6 +109,12 @@ static int zpff_init(struct hid_device *hid)
108 109
109 return 0; 110 return 0;
110} 111}
112#else
113static inline int zpff_init(struct hid_device *hid)
114{
115 return 0;
116}
117#endif
111 118
112static int zp_probe(struct hid_device *hdev, const struct hid_device_id *id) 119static int zp_probe(struct hid_device *hdev, const struct hid_device_id *id)
113{ 120{