Skip to contentSkip to conversation

input: pxrc: new driver for PhoenixRC Flight Controller Adapter

PATCH Superseded Marcus Folkesson 2 participants 2 messages Dec 31, 2017

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Marcus Folkesson

author maintainer
#0 lore raw

PATCH 1/1 input: pxrc: new driver for PhoenixRC Flight Controller Adapter

This driver let you plug in your RC controller to the adapter and use it as input device in various RC simulators.

---

Happy New Year!

 Documentation/input/devices/pxrc.rst |  57 ++++++++
 drivers/input/joystick/Kconfig       |   9 ++
 drivers/input/joystick/Makefile      |   1 +
 drivers/input/joystick/pxrc.c        | 254 +++++++++++++++++++++++++++++++++++
 4 files changed, 321 insertions(+)
 create mode 100644 Documentation/input/devices/pxrc.rst
 create mode 100644 drivers/input/joystick/pxrc.c
Documentation/input/devices/pxrc.rst new file +57 -0
new file mode 100644
index 000000000000..0ec466c58958
@@ -0,0 +1,57 @@
+=======================================================
+pxrc - PhoenixRC Flight Controller Adapter
+=======================================================
+
+:Author: Marcus Folkesson <[email protected]>
+
+This driver let you use your own RC controller plugged into the
+adapter that comes with PhoenixRC [1]_ or other compatible adapters.
+
+The adapter supports 7 analog channels and 1 digital input switch.
+
+Notes
+=====
+
+Many RC controllers is able to configure which stick goes to which channel.
+This is also configurable in most simulators, so a matching is not necessary.
+
+The driver is generating the following input event for analog channels:
+
++---------+----------------+
+| Channel |      Event     |
++=========+================+
+|     1   |  ABS_X         |
++---------+----------------+
+|     2   |  ABS_Y         |
++---------+----------------+
+|     3   |  ABS_RX        |
++---------+----------------+
+|     4   |  ABS_RY        |
++---------+----------------+
+|     5   |  ABS_TILT_X    |
++---------+----------------+
+|     6   |  ABS_TILT_Y    |
++---------+----------------+
+|     7   |  ABS_THROTTLE  |
++---------+----------------+
+
+The digital input switch is generated as an `BTN_A` event.
+
+Manual Testing
+==============
+
+To test this driver's functionality you may use `input-event` which is part of
+the `input layer utilities` suite [2]_.
+
+For example::
+
+    > modprobe pxrc
+    > input-events <devnr>
+
+To print all input events from input `devnr`.
+
+References
+==========
+
+.. [1] http://www.phoenix-sim.com/
+.. [2] https://www.kraxel.org/cgit/input/
drivers/input/joystick/Kconfig +9 -0
index f3c2f6ea8b44..18ab6dafff41 100644
@@ -351,4 +351,13 @@ config JOYSTICK_PSXPAD_SPI_FF
 
 	  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.
 endif
drivers/input/joystick/Makefile +1 -0
index 67651efda2e1..dd0492ebbed7 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_JOYSTICK_JOYDUMP)		+= joydump.o
 obj-$(CONFIG_JOYSTICK_MAGELLAN)		+= magellan.o
 obj-$(CONFIG_JOYSTICK_MAPLE)		+= maplecontrol.o
 obj-$(CONFIG_JOYSTICK_PSXPAD_SPI)	+= psxpad-spi.o
+obj-$(CONFIG_JOYSTICK_PXRC)			+= pxrc.o
 obj-$(CONFIG_JOYSTICK_SIDEWINDER)	+= sidewinder.o
 obj-$(CONFIG_JOYSTICK_SPACEBALL)	+= spaceball.o
 obj-$(CONFIG_JOYSTICK_SPACEORB)		+= spaceorb.o
drivers/input/joystick/pxrc.c new file +254 -0

254 lines not on this page · raw message

Signature · 1 line
2.15.1
#1 lore raw

Markus,

Quoted 4 lines · Marcus Folkesson

This driver let you plug in your RC controller to the adapter and use it as input device in various RC simulators.

<snip>

Quoted 4 lines
drivers/input/joystick/pxrc.c new file +1 -0
@@ -0,0 +1,254 @@
+// SPDX-License-Identifier: GPL-2.0

<snip>

Quoted 1 line

+MODULE_LICENSE("GPL");

This MODULE_LICENSE means GPL 2.0 or later per module.h and this does not match your top level SPDX tag which means GPL 2.0 only. Could you make sure they are in sync?

Signature · 2 lines
Cordially
Philippe Ombredanne