linux/drivers/input/joystick
Anssi Hannula a0979923d7 Input: xpad - fix dpad handling of unknown devices
For devices not specifically listed in xpad.c, xpad->dpad_mapping
is initially set to MAP_DPAD_UNKNOWN. In xpad_probe() it gets changed
to either MAP_DPAD_TO_BUTTONS or MAP_DPAD_TO_AXES, depending on the
module parameter dpad_to_buttons.

However, MAP_DPAD_UNKNOWN is defined as -1, while the field is u8.
This results in actual value of 255, causing the MAP_DPAD_UNKNOWN
check in xpad_probe() to fail.
Fix that by defining MAP_DPAD_UNKNOWN as 2 instead.

Also, setting module parameter dpad_to_buttons to 1 should obviously
map dpad to buttons, while the default behaviour (0) should be to map
dpad to axes. However, dpad_to_buttons is directly assigned to
xpad->dpad_mapping, and as MAP_DPAD_TO_BUTTONS is 0, the actual
behaviour is reversed.
Fix that by negating dpad_to_buttons in assignment.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03 16:18:10 -04:00
..
iforce Input: iforce - don't access input_dev->private directly 2008-01-21 01:11:07 -05:00
a3d.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
adi.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
amijoy.c Input: drop redundant includes of moduleparam.h 2008-01-21 01:11:07 -05:00
analog.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
cobra.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
db9.c Input: drop redundant includes of moduleparam.h 2008-01-21 01:11:07 -05:00
gamecon.c Input: drop redundant includes of moduleparam.h 2008-01-21 01:11:07 -05:00
gf2k.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
grip_mp.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
grip.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
guillemot.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
interact.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
joydump.c [PATCH] fix missing includes 2005-10-30 17:37:32 -08:00
Kconfig Input: xpad - fix dependancy on LEDS class 2007-09-28 15:38:12 -07:00
magellan.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
Makefile Input: move USB gamepads under drivers/input/joystick 2007-05-08 01:41:29 -04:00
sidewinder.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
spaceball.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
spaceorb.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
stinger.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
tmdc.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
turbografx.c Input: drop redundant includes of moduleparam.h 2008-01-21 01:11:07 -05:00
twidjoy.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
warrior.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
xpad.c Input: xpad - fix dpad handling of unknown devices 2008-04-03 16:18:10 -04:00