mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
52c4e5985a
Adds a driver for a mini gamepad that communicates over i2c, the gamepad has bidirectional thumb stick input and six buttons. The gamepad chip utilizes the open framework from Adafruit called 'Seesaw' to transmit the ADC data for the joystick and digital pin state for the buttons. I have only implemented the functionality required to receive the thumb stick and button state. Steps in reading the gamepad state over i2c: 1. Reset the registers 2. Set the pin mode of the pins specified by the `BUTTON_MASK` to input `BUTTON_MASK`: A bit-map for the six digital pins internally connected to the joystick buttons. 3. Enable internal pullup resistors for the `BUTTON_MASK` 4. Bulk set the pin state HIGH for `BUTTON_MASK` 5. Poll the device for button and joystick state done by: `seesaw_read_data(struct i2c_client *client, struct seesaw_data *data)` Product page: https://www.adafruit.com/product/5743 Arduino driver: https://github.com/adafruit/Adafruit_Seesaw Driver tested on RPi Zero 2W Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Anshul Dalal <anshulusr@gmail.com> Link: https://lore.kernel.org/r/20240106015111.882325-2-anshulusr@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
426 lines
13 KiB
Plaintext
426 lines
13 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Joystick driver configuration
|
|
#
|
|
menuconfig INPUT_JOYSTICK
|
|
bool "Joysticks/Gamepads"
|
|
depends on !UML
|
|
help
|
|
If you have a joystick, 6dof controller, gamepad, steering wheel,
|
|
weapon control system or something like that you can say Y here
|
|
and the list of supported devices will be displayed. This option
|
|
doesn't affect the kernel.
|
|
|
|
Please read the file <file:Documentation/input/joydev/joystick.rst> which
|
|
contains more information.
|
|
|
|
if INPUT_JOYSTICK
|
|
|
|
config JOYSTICK_ANALOG
|
|
tristate "Classic PC analog joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a joystick that connects to the PC
|
|
gameport. In addition to the usual PC analog joystick, this driver
|
|
supports many extensions, including joysticks with throttle control,
|
|
with rudders, additional hats and buttons compatible with CH
|
|
Flightstick Pro, ThrustMaster FCS, 6 and 8 button gamepads, or
|
|
Saitek Cyborg joysticks.
|
|
|
|
Please read the file <file:Documentation/input/joydev/joystick.rst> which
|
|
contains more information.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called analog.
|
|
|
|
config JOYSTICK_A3D
|
|
tristate "Assassin 3D and MadCatz Panther devices"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have an FPGaming or MadCatz controller using the
|
|
A3D protocol over the PC gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called a3d.
|
|
|
|
config JOYSTICK_ADC
|
|
tristate "Simple joystick connected over ADC"
|
|
depends on IIO
|
|
select IIO_BUFFER
|
|
select IIO_BUFFER_CB
|
|
help
|
|
Say Y here if you have a simple joystick connected over ADC.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called adc-joystick.
|
|
|
|
config JOYSTICK_ADI
|
|
tristate "Logitech ADI digital joysticks and gamepads"
|
|
select GAMEPORT
|
|
depends on ADI!=m # avoid module name conflict
|
|
help
|
|
Say Y here if you have a Logitech controller using the ADI
|
|
protocol over the PC gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called adi.
|
|
|
|
config JOYSTICK_COBRA
|
|
tristate "Creative Labs Blaster Cobra gamepad"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a Creative Labs Blaster Cobra gamepad.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called cobra.
|
|
|
|
config JOYSTICK_GF2K
|
|
tristate "Genius Flight2000 Digital joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a Genius Flight2000 or MaxFighter digitally
|
|
communicating joystick or gamepad.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called gf2k.
|
|
|
|
config JOYSTICK_GRIP
|
|
tristate "Gravis GrIP joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a Gravis controller using the GrIP protocol
|
|
over the PC gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called grip.
|
|
|
|
config JOYSTICK_GRIP_MP
|
|
tristate "Gravis GrIP MultiPort"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have the original Gravis GrIP MultiPort, a hub
|
|
that connects to the gameport and you connect gamepads to it.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called grip_mp.
|
|
|
|
config JOYSTICK_GUILLEMOT
|
|
tristate "Guillemot joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a Guillemot joystick using a digital
|
|
protocol over the PC gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called guillemot.
|
|
|
|
config JOYSTICK_INTERACT
|
|
tristate "InterAct digital joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have an InterAct gameport or joystick
|
|
communicating digitally over the gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called interact.
|
|
|
|
config JOYSTICK_SIDEWINDER
|
|
tristate "Microsoft SideWinder digital joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a Microsoft controller using the Digital
|
|
Overdrive protocol over PC gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called sidewinder.
|
|
|
|
config JOYSTICK_TMDC
|
|
tristate "ThrustMaster DirectConnect joysticks and gamepads"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you have a ThrustMaster controller using the
|
|
DirectConnect (BSP) protocol over the PC gameport.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called tmdc.
|
|
|
|
source "drivers/input/joystick/iforce/Kconfig"
|
|
|
|
config JOYSTICK_WARRIOR
|
|
tristate "Logitech WingMan Warrior joystick"
|
|
select SERIO
|
|
help
|
|
Say Y here if you have a Logitech WingMan Warrior joystick connected
|
|
to your computer's serial port.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called warrior.
|
|
|
|
config JOYSTICK_MAGELLAN
|
|
tristate "LogiCad3d Magellan/SpaceMouse 6dof controllers"
|
|
select SERIO
|
|
help
|
|
Say Y here if you have a Magellan or Space Mouse 6DOF controller
|
|
connected to your computer's serial port.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called magellan.
|
|
|
|
config JOYSTICK_SPACEORB
|
|
tristate "SpaceTec SpaceOrb/Avenger 6dof controllers"
|
|
select SERIO
|
|
help
|
|
Say Y here if you have a SpaceOrb 360 or SpaceBall Avenger 6DOF
|
|
controller connected to your computer's serial port.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called spaceorb.
|
|
|
|
config JOYSTICK_SPACEBALL
|
|
tristate "SpaceTec SpaceBall 6dof controllers"
|
|
select SERIO
|
|
help
|
|
Say Y here if you have a SpaceTec SpaceBall 2003/3003/4000 FLX
|
|
controller connected to your computer's serial port. For the
|
|
SpaceBall 4000 USB model, use the USB HID driver.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called spaceball.
|
|
|
|
config JOYSTICK_STINGER
|
|
tristate "Gravis Stinger gamepad"
|
|
select SERIO
|
|
help
|
|
Say Y here if you have a Gravis Stinger connected to one of your
|
|
serial ports.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called stinger.
|
|
|
|
config JOYSTICK_TWIDJOY
|
|
tristate "Twiddler as a joystick"
|
|
select SERIO
|
|
help
|
|
Say Y here if you have a Handykey Twiddler connected to your
|
|
computer's serial port and want to use it as a joystick.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called twidjoy.
|
|
|
|
config JOYSTICK_ZHENHUA
|
|
tristate "5-byte Zhenhua RC transmitter"
|
|
select SERIO
|
|
select BITREVERSE
|
|
help
|
|
Say Y here if you have a Zhen Hua PPM-4CH transmitter which is
|
|
supplied with a ready to fly micro electric indoor helicopters
|
|
such as EasyCopter, Lama, MiniCopter, DragonFly or Jabo and want
|
|
to use it via serial cable as a joystick.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called zhenhua.
|
|
|
|
config JOYSTICK_DB9
|
|
tristate "Multisystem, Sega Genesis, Saturn joysticks and gamepads"
|
|
depends on PARPORT
|
|
help
|
|
Say Y here if you have a Sega Master System gamepad, Sega Genesis
|
|
gamepad, Sega Saturn gamepad, or a Multisystem -- Atari, Amiga,
|
|
Commodore, Amstrad CPC joystick connected to your parallel port.
|
|
For more information on how to use the driver please read
|
|
<file:Documentation/input/devices/joystick-parport.rst>.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called db9.
|
|
|
|
config JOYSTICK_GAMECON
|
|
tristate "Multisystem, NES, SNES, N64, PSX joysticks and gamepads"
|
|
depends on PARPORT
|
|
select INPUT_FF_MEMLESS
|
|
help
|
|
Say Y here if you have a Nintendo Entertainment System gamepad,
|
|
Super Nintendo Entertainment System gamepad, Nintendo 64 gamepad,
|
|
Sony PlayStation gamepad or a Multisystem -- Atari, Amiga,
|
|
Commodore, Amstrad CPC joystick connected to your parallel port.
|
|
For more information on how to use the driver please read
|
|
<file:Documentation/input/devices/joystick-parport.rst>.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called gamecon.
|
|
|
|
config JOYSTICK_TURBOGRAFX
|
|
tristate "Multisystem joysticks via TurboGraFX device"
|
|
depends on PARPORT
|
|
help
|
|
Say Y here if you have the TurboGraFX interface by Steffen Schwenke,
|
|
and want to use it with Multisystem -- Atari, Amiga, Commodore,
|
|
Amstrad CPC joystick. For more information on how to use the driver
|
|
please read <file:Documentation/input/devices/joystick-parport.rst>.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called turbografx.
|
|
|
|
config JOYSTICK_AMIGA
|
|
tristate "Amiga joysticks"
|
|
depends on AMIGA
|
|
help
|
|
Say Y here if you have an Amiga with a digital joystick connected
|
|
to it.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called amijoy.
|
|
|
|
config JOYSTICK_AS5011
|
|
tristate "Austria Microsystem AS5011 joystick"
|
|
depends on I2C
|
|
help
|
|
Say Y here if you have an AS5011 digital joystick connected to your
|
|
system.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called as5011.
|
|
|
|
config JOYSTICK_JOYDUMP
|
|
tristate "Gameport data dumper"
|
|
select GAMEPORT
|
|
help
|
|
Say Y here if you want to dump data from your joystick into the system
|
|
log for debugging purposes. Say N if you are making a production
|
|
configuration or aren't sure.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called joydump.
|
|
|
|
config JOYSTICK_XPAD
|
|
tristate "Xbox gamepad support"
|
|
depends on USB_ARCH_HAS_HCD
|
|
select USB
|
|
help
|
|
Say Y here if you want to use Xbox pads with your computer.
|
|
Make sure to say Y to "Joystick support" (CONFIG_INPUT_JOYDEV)
|
|
and/or "Event interface support" (CONFIG_INPUT_EVDEV) as well.
|
|
|
|
For information about how to connect the Xbox pad to USB, see
|
|
<file:Documentation/input/devices/xpad.rst>.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called xpad.
|
|
|
|
config JOYSTICK_XPAD_FF
|
|
bool "Xbox gamepad rumble support"
|
|
depends on JOYSTICK_XPAD && INPUT
|
|
select INPUT_FF_MEMLESS
|
|
help
|
|
Say Y here if you want to take advantage of Xbox 360 rumble features.
|
|
|
|
config JOYSTICK_XPAD_LEDS
|
|
bool "LED Support for the Xbox 360 controller Guide button"
|
|
depends on JOYSTICK_XPAD && (LEDS_CLASS=y || LEDS_CLASS=JOYSTICK_XPAD)
|
|
help
|
|
This option enables support for the LED which surrounds the Big X on
|
|
Xbox 360 controllers.
|
|
|
|
config JOYSTICK_WALKERA0701
|
|
tristate "Walkera WK-0701 RC transmitter"
|
|
depends on HIGH_RES_TIMERS && PARPORT
|
|
help
|
|
Say Y or M here if you have a Walkera WK-0701 transmitter which is
|
|
supplied with a ready to fly Walkera helicopters such as HM36,
|
|
HM37, HM60 and want to use it via parport as a joystick. More
|
|
information is available: <file:Documentation/input/devices/walkera0701.rst>
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called walkera0701.
|
|
|
|
config JOYSTICK_MAPLE
|
|
tristate "Dreamcast control pad"
|
|
depends on MAPLE
|
|
help
|
|
Say Y here if you have a SEGA Dreamcast and want to use your
|
|
controller as a joystick.
|
|
|
|
Most Dreamcast users will say Y.
|
|
|
|
To compile this as a module choose M here: the module will be called
|
|
maplecontrol.
|
|
|
|
config JOYSTICK_PSXPAD_SPI
|
|
tristate "PlayStation 1/2 joypads via SPI interface"
|
|
depends on SPI
|
|
help
|
|
Say Y here if you wish to connect PlayStation 1/2 joypads
|
|
via SPI interface.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called psxpad-spi.
|
|
|
|
config JOYSTICK_PSXPAD_SPI_FF
|
|
bool "PlayStation 1/2 joypads force feedback (rumble) support"
|
|
depends on JOYSTICK_PSXPAD_SPI
|
|
select INPUT_FF_MEMLESS
|
|
help
|
|
Say Y here if you want to take advantage of PlayStation 1/2
|
|
joypads rumble features.
|
|
|
|
To drive rumble motor a dedicated power supply is required.
|
|
|
|
config JOYSTICK_PXRC
|
|
tristate "PhoenixRC Flight Controller Adapter"
|
|
depends on USB_ARCH_HAS_HCD
|
|
select USB
|
|
help
|
|
Say Y here if you want to use the PhoenixRC Flight Controller Adapter.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called pxrc.
|
|
|
|
config JOYSTICK_QWIIC
|
|
tristate "SparkFun Qwiic Joystick"
|
|
depends on I2C
|
|
help
|
|
Say Y here if you want to use the SparkFun Qwiic Joystick.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called qwiic-joystick.
|
|
|
|
config JOYSTICK_FSIA6B
|
|
tristate "FlySky FS-iA6B RC Receiver"
|
|
select SERIO
|
|
help
|
|
Say Y here if you use a FlySky FS-i6 RC remote control along with the
|
|
FS-iA6B RC receiver as a joystick input device.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called fsia6b.
|
|
|
|
config JOYSTICK_N64
|
|
bool "N64 controller"
|
|
depends on MACH_NINTENDO64
|
|
help
|
|
Say Y here if you want enable support for the four
|
|
built-in controller ports on the Nintendo 64 console.
|
|
|
|
config JOYSTICK_SENSEHAT
|
|
tristate "Raspberry Pi Sense HAT joystick"
|
|
depends on INPUT && I2C
|
|
depends on HAS_IOMEM
|
|
select MFD_SIMPLE_MFD_I2C
|
|
help
|
|
Say Y here if you want to enable the driver for the
|
|
the Raspberry Pi Sense HAT.
|
|
|
|
To compile this driver as a module, choose M here: the
|
|
module will be called sensehat_joystick.
|
|
|
|
config JOYSTICK_SEESAW
|
|
tristate "Adafruit Mini I2C Gamepad with Seesaw"
|
|
depends on I2C
|
|
select INPUT_SPARSEKMAP
|
|
help
|
|
Say Y here if you want to use the Adafruit Mini I2C Gamepad.
|
|
|
|
To compile this driver as a module, choose M here: the module will be
|
|
called adafruit-seesaw.
|
|
|
|
endif
|