Input: xpad - enable force feedback on xbox 360 controllers only
authorAnssi Hannula <anssi.hannula@gmail.com>
Thu, 3 Apr 2008 20:18:57 +0000 (16:18 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 3 Apr 2008 20:18:57 +0000 (16:18 -0400)
Commit 4994cd8dadcf9d484ab3ec19f3c7c7a4e5353c1c introduced a
regression which causes xpad to report force feedback cababilities
for non-360 controllers too, even while there is no actual support
for those.

Fix that by adding a check for XTYPE_XBOX360 to xpad_init_ff().

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/joystick/xpad.c

index b48f7051bf3060256e286bb9809afec16148ae24..fd801135eebbc7c2f6691b497c9d802633baa49a 100644 (file)
@@ -499,6 +499,9 @@ static int xpad_play_effect(struct input_dev *dev, void *data,
 
 static int xpad_init_ff(struct usb_xpad *xpad)
 {
+       if (xpad->xtype != XTYPE_XBOX360)
+               return 0;
+
        input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);
 
        return input_ff_create_memless(xpad->dev, NULL, xpad_play_effect);