aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/xpad.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-20USB: rename usb_buffer_alloc() and usb_buffer_free() usersDaniel Mack1-8/+8
For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-01-24Input: xpad - add rumble support for original xbox controllerBenjamin Valentin1-16/+37
Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-01-21Merge commit 'v2.6.33-rc5' into nextDmitry Torokhov1-2/+2
2010-01-09Input: xbox - do not use GFP_KERNEL under spinlockDmitry Torokhov1-2/+2
xbox_play_effect() is called while holding dev->event_lock with interrupts disabled and thus may not use GFP_KERNEL when submitting urbs. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-29Input: xpad - allow using triggers as buttons rather than axesNicolas Léveillé1-79/+121
Certain devices implement triggers as buttons rather than axes. In particular, arcade sticks such as the HORI Real Arcade Pro.EX do not have analog buttons. These devices are now setup to present buttons rather than axes for triggers. User-space applications often also have problems with axes-as-buttons. Activating MAP_TRIGGERS_TO_BUTTONS for a device removes the artificial difference between buttons and triggers. Signed-off-by: Nicolas Léveillé <nicolas@uucidl.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-11-29Input: xpad - add two new Xbox 360 devicesNicolas Léveillé1-0/+3
Added two new Xbox 360 devices: - HORI Real Arcade Pro.EX - Mad Catz SFIV Fightpad Signed-off-by: Nicolas Léveillé <nicolas@uucidl.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-10-05Input: xpad - add BigBen Interactive XBOX 360 ControllerThomas Gruber1-0/+2
Add BigBen Interactive XBOX 360 Controller (146b:0601) to xpad driver. Signed-off-by: Thomas Gruber <kerneldev@tuxpower.org> Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-08-20Input: xpad - add USB ID for the drumkit controller from Rock BandCorbin Simpson1-0/+2
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-12Input: xpad - don't resend successfully sent outgoing requestsMichael Gruber1-13/+13
This avoids an infinite loop. Signed-off-by: Michael Gruber <lists.mg@googlemail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-10-17USB: remove info() macro from usb input driversGreg Kroah-Hartman1-1/+1
USB should not be having it's own printk macros, so remove info() and use the system-wide standard of dev_info() wherever possible. Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-16misc: replace __FUNCTION__ with __func__Harvey Harrison1-2/+2
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-31Input: xpad - add Pelican Eclipse D-Pad to the list of devicesHarley Laue1-0/+1
Signed-off-by: Harley Laue <losinggeneration@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-05-16Input: replace remaining __FUNCTION__ occurrencesHarvey Harrison1-6/+6
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-27Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-17/+17
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: xpad - fix build failure
2008-04-27Input: xpad - fix build failureDmitry Torokhov1-17/+17
If both CONFIG_JOYSTICK_XPAD_FF and CONFIG_JOYSTICK_XPAD_LEDS are unset xpad_bulk_out is not defined and build fails. Move it out of the #ifdef block so it is always defined. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds1-8/+12
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (120 commits) usb: don't update devnum for wusb devices wusb: make ep0_reinit available for modules wusb: devices dont use a set address wusb: teach choose_address() about wireless devices wusb: add link wusb-usb device wusb: add authenticathed bit to usb_dev USB: remove unnecessary type casting of urb->context usb serial: more fixes and groundwork for tty changes USB: replace remaining __FUNCTION__ occurrences USB: usbfs: export the URB_NO_INTERRUPT flag to userspace USB: fix compile problems in ehci-hcd USB: ehci: qh_completions cleanup and bugfix USB: cdc-acm: signedness fix USB: add documentation about callbacks USB: don't explicitly reenable root-hub status interrupts USB: OHCI: turn off RD when remote wakeup is disabled USB: HCDs use the do_remote_wakeup flag USB: g_file_storage: ignore bulk-out data after invalid CBW USB: serial: remove endpoints setting checks from core and header USB: serial: remove unneeded number endpoints settings ...
2008-04-24USB: convert away from urb->status in xpad driverOliver Neukum1-8/+12
USB is moving to transfering status as a parameter. To ease the transition urb->status is to be touched only once in a function. The xpad driver has been overlooked. Dmitry wants this to go through the USB tree. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-15Input: xpad - set proper buffer length for outgoing requestsMichael Gruber1-0/+2
The messages for led/rumble are exactly 3 and 8 bytes respectively. Hence set up the transfer_buffer_length accordingly. Signed-off-by: Michael Gruber <lists.mg@googlemail.com> Acked-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - don't use GFP_ATOMICOliver Neukum1-2/+2
GFP_ATOMIC should not be used when GFP_KERNEL can be used. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - add support for wireless xbox360 controllersBrian Magnuson1-16/+148
Signed-off-by: Brian Magnuson <bdmagnuson@gmail.com> Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - drop obsolete driver versioningAnssi Hannula1-3/+4
The driver version numbers and changelog have not been updated in a long while to reflect actual changes. Remove the version number and add a notice that later changes can be tracked in SCM. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - enable force feedback on xbox 360 controllers onlyAnssi Hannula1-0/+3
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>
2008-04-03Input: xpad - do not report nonexistent buttons for xbox360Anssi Hannula1-4/+14
The buttons BTN_C and BTN_Z are only used in the original xbox controller, not in xbox360 controller. Therefore only add them to keybit when the controller is a non-360 one. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - add more xbox 360 controller idsAnssi Hannula1-0/+6
Add Mad Catz and 0x0e6f xbox360 controllers which are already found in xpad_device[] table in xpad.c into the vendor id list. Also add Logitech into the vendor list for Logitech Chillstream gamepads. Also add the RedOctane Guitar Hero X-plorer. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - fix inverted Y and RY axesAnssi Hannula1-4/+4
The commit ae91d10aab2762f81733e9194cb56eff99c8d808 inverted Y and RY axes on xbox360 so that up is positive and down is negative. This is wrong, as axes on game controllers have up as negative per convention. Also, even xpad itself reports HAT0X with up as negative. Fix that by inverting them again. Also, according to http://bugzilla.kernel.org/show_bug.cgi?id=10337 the original xbox controllers also have the Y and RY axes inverted. Fix that by inverting them as well. Cc: Brian Magnuson <bdmagnuson@gmail.com> Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-03Input: xpad - fix dpad handling of unknown devicesAnssi Hannula1-2/+2
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-03Input: xpad - match xbox 360 devices with interface infoAnssi Hannula1-5/+16
Match Xbox 360 controllers using the interface info, i.e. interface class 255 (Vendor specific), subclass 93 and protocol 1, instead of specifying the device ids individually. As the class is vendor-specific, we have to still match against vendor id as well, though. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-21Input: drop redundant includes of moduleparam.hJulia Lawall1-1/+0
Drop #include <linux/moduleparam.h> in files that also include linux/module.h, since module.h includes moduleparam.h already. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-10-27Input: xpad - add more USB IDsJoshua J Bowman1-0/+2
Add USB IDs of Mad Catz Wired Xbox 360 Controller and Pelican 'TSZ' Wired Xbox 360 Controller. Signed-off-by: Joshua J Bowman <bowmanj@augsburg.edu> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-10-19get rid of input BIT* duplicate definesJiri Slaby1-1/+1
get rid of input BIT* duplicate defines use newly global defined macros for input layer. Also remove includes of input.h from non-input sources only for BIT macro definiton. Define the macro temporarily in local manner, all those local definitons will be removed further in this patchset (to not break bisecting). BIT macro will be globally defined (1<<x) Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: <dtor@mail.ru> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: <lenb@kernel.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: <perex@suse.cz> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <vernux@us.ibm.com> Cc: <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-18Input: xpad - use le16_to_cpup when parsing data streamDmitry Torokhov1-19/+36
Use avaliable functions instead of doing it all manually. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-18Input: xpad - add support for leds on xbox 360 padJan Kratochvil1-42/+148
Export LEDs on Xbox360 pad via led subsystem as a single device in /sys/class/leds/xpad[0-9]+. Xbox360 pad has four leds, which form a circle. Unfortunately the leds can't be controlled independently and can only display a predefined set of patterns (for example one is turned on wile others are off or a rotating pattern - 1-2-3-4). To activate a pattern one needs to send a specific command to the device (see http://www.free60.org/wiki/Gamepad). Led subsystem allows us to set brightness, but there is nothing like brightness on this device. So brightness is actually interpreted as the command (only values between 0 and 14 are accepted). Signed-off-by: Jan Kratochvil <honza@jikos.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: xpad - fix report for dpad and inverted Y and RY axes on xbox 360Dmitry Torokhov1-20/+20
Make the driver report Y/RY up as positive value and down as negative. Also make DPAD mapping the same as classic xpad. Reported-by: Brian Magnuson <bdmagnuson@gmail.com> Tested-by: Jan Kratochvil <honza@jikos.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: xpad - make xpad_play_effect() staticAdrian Bunk1-1/+2
xpad_play_effect() does not need to be global. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: xpad - fix check for succesful usb_buffer_allocJan Kratochvil1-1/+1
Signed-off-by: Jan Kratochvil <honza@jikos.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: xpad - add Xbox360 gamepad rumble supportJan Kratochvil1-4/+121
Implementation is using force feedback support for memoryless devices. Signed-off-by: Jan Kratochvil <honza@jikos.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: xpad - add support for Xbox 360 gamepadJan Kratochvil1-34/+117
Xbox 360 gamepad is slightly different then the previous model so it has its own version of process_packet method. Detection of this new device relies on USB_DEVICE_INTERFACE_PROTOCOL macro. This device got vendor specific subclass so it can't be matched with USB_INTERFACE_INFO and we need only one interface protocol from four availaible. It means USB_DEVICE can't be used either. Added xpad360_btn structure with additional buttons for x360 gamepad. Added xtype into xpad_device structure to distinguish between different types of xbox devices. Signed-off-by: Jan Kratochvil <honza@jikos.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-05-08Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-0/+433
* master.kernel.org:/pub/scm/linux/kernel/git/dtor/input: Input: move USB miscellaneous devices under drivers/input/misc Input: move USB mice under drivers/input/mouse Input: move USB gamepads under drivers/input/joystick Input: move USB touchscreens under drivers/input/touchscreen Input: move USB tablets under drivers/input/tablet Input: i8042 - fix AUX port detection with some chips Input: aaed2000_kbd - convert to use polldev library Input: drivers/usb/input - usb_buffer_free() cleanup Input: synaptics - don't complain about failed resets Input: pull input.h into uinpit.h Input: drivers/usb/input - fix sparse warnings (signedness) Input: evdev - fix some sparse warnings (signedness, shadowing) Input: drivers/joystick - fix various sparse warnings Input: force feedback - make sure effect is present before playing
2007-05-08Input: move USB gamepads under drivers/input/joystickDmitry Torokhov1-0/+434
This will allow concentrating all input devices in one place in {menu|x|q}config. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>