Re: [RESEND PATCH v5] input: pxrc: new driver for PhoenixRC Flight Controller Adapter

2018-03-17 Thread Dmitry Torokhov
On Sun, Feb 18, 2018 at 05:17:46PM +0100, Marcus Folkesson wrote:
> This driver let you plug in your RC controller to the adapter and
> use it as input device in various RC simulators.
> 
> Signed-off-by: Marcus Folkesson 

Applied, thank you.

> ---
> 
> v5:
>   - Drop autosuspend support
>   - Use pm_mutex instead of input_dev->mutex
>   - Use pxrc->is_open instead of input_dev->users
> v4:
>   - Add call to usb_mark_last_busy() in irq
>   - Move code from pxrc_resume() to pxrc_reset_resume()
> v3:
>   - Use RUDDER and MISC instead of TILT_X and TILT_Y
>   - Drop kref and anchor
>   - Rework URB handling
>   - Add PM support
> v2:
>   - Change module license to GPLv2 to match SPDX tag
> 
> 
>  Documentation/input/devices/pxrc.rst |  57 +++
>  drivers/input/joystick/Kconfig   |   9 ++
>  drivers/input/joystick/Makefile  |   1 +
>  drivers/input/joystick/pxrc.c| 303 
> +++
>  4 files changed, 370 insertions(+)
>  create mode 100644 Documentation/input/devices/pxrc.rst
>  create mode 100644 drivers/input/joystick/pxrc.c
> 
> diff --git a/Documentation/input/devices/pxrc.rst 
> b/Documentation/input/devices/pxrc.rst
> new file mode 100644
> index ..ca11f646bae8
> --- /dev/null
> +++ b/Documentation/input/devices/pxrc.rst
> @@ -0,0 +1,57 @@
> +===
> +pxrc - PhoenixRC Flight Controller Adapter
> +===
> +
> +:Author: Marcus Folkesson 
> +
> +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_RUDDER|
> ++-++
> +| 6   |  ABS_THROTTLE  |
> ++-++
> +| 7   |  ABS_MISC  |
> ++-++
> +
> +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 
> +
> +To print all input events from input `devnr`.
> +
> +References
> +==
> +
> +.. [1] http://www.phoenix-sim.com/
> +.. [2] https://www.kraxel.org/cgit/input/
> diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
> index f3c2f6ea8b44..332c0cc1b2ab 100644
> --- a/drivers/input/joystick/Kconfig
> +++ b/drivers/input/joystick/Kconfig
> @@ -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
> + depends on 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
> diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
> index 67651efda2e1..dd0492ebbed7 100644
> --- a/drivers/input/joystick/Makefile
> +++ b/drivers/input/joystick/Makefile
> @@ -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
> diff --git a/drivers/input/joystick/pxrc.c b/drivers/input/joystick/pxrc.c
> new file mode 100644
> index ..07a0dbd3ced2
> --- /dev/null
> +++ b/drivers/input/joystick/pxrc.c
> @@ -0,0 +1,303 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for Phoenix RC Flight Controller Adapter
> + *
> + * Copyright (C) 2018 Marcus Folkesson 
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

Re: [RESEND PATCH v5] input: pxrc: new driver for PhoenixRC Flight Controller Adapter

2018-03-16 Thread Marcus Folkesson
ping.

I do not want to nag, but would someone please have a look at this?

Thanks,
Marcus Folkesson

On Sun, Feb 18, 2018 at 05:17:46PM +0100, Marcus Folkesson wrote:
> This driver let you plug in your RC controller to the adapter and
> use it as input device in various RC simulators.
> 
> Signed-off-by: Marcus Folkesson 
> ---
> 
> v5:
>   - Drop autosuspend support
>   - Use pm_mutex instead of input_dev->mutex
>   - Use pxrc->is_open instead of input_dev->users
> v4:
>   - Add call to usb_mark_last_busy() in irq
>   - Move code from pxrc_resume() to pxrc_reset_resume()
> v3:
>   - Use RUDDER and MISC instead of TILT_X and TILT_Y
>   - Drop kref and anchor
>   - Rework URB handling
>   - Add PM support
> v2:
>   - Change module license to GPLv2 to match SPDX tag
> 
> 
>  Documentation/input/devices/pxrc.rst |  57 +++
>  drivers/input/joystick/Kconfig   |   9 ++
>  drivers/input/joystick/Makefile  |   1 +
>  drivers/input/joystick/pxrc.c| 303 
> +++
>  4 files changed, 370 insertions(+)
>  create mode 100644 Documentation/input/devices/pxrc.rst
>  create mode 100644 drivers/input/joystick/pxrc.c
> 
> diff --git a/Documentation/input/devices/pxrc.rst 
> b/Documentation/input/devices/pxrc.rst
> new file mode 100644
> index ..ca11f646bae8
> --- /dev/null
> +++ b/Documentation/input/devices/pxrc.rst
> @@ -0,0 +1,57 @@
> +===
> +pxrc - PhoenixRC Flight Controller Adapter
> +===
> +
> +:Author: Marcus Folkesson 
> +
> +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_RUDDER|
> ++-++
> +| 6   |  ABS_THROTTLE  |
> ++-++
> +| 7   |  ABS_MISC  |
> ++-++
> +
> +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 
> +
> +To print all input events from input `devnr`.
> +
> +References
> +==
> +
> +.. [1] http://www.phoenix-sim.com/
> +.. [2] https://www.kraxel.org/cgit/input/
> diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
> index f3c2f6ea8b44..332c0cc1b2ab 100644
> --- a/drivers/input/joystick/Kconfig
> +++ b/drivers/input/joystick/Kconfig
> @@ -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
> + depends on 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
> diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
> index 67651efda2e1..dd0492ebbed7 100644
> --- a/drivers/input/joystick/Makefile
> +++ b/drivers/input/joystick/Makefile
> @@ -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
> diff --git a/drivers/input/joystick/pxrc.c b/drivers/input/joystick/pxrc.c
> new file mode 100644
> index ..07a0dbd3ced2
> --- /dev/null
> +++ b/drivers/input/joystick/pxrc.c
> @@ -0,0 +1,303 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for Phoenix RC Flight Controller Adapter
> + *
> + * Copyright (C) 2018 Marcus Folkesson 
> + *
> + */
> +
> +#include 
> +#include 

[RESEND PATCH v5] input: pxrc: new driver for PhoenixRC Flight Controller Adapter

2018-02-18 Thread Marcus Folkesson
This driver let you plug in your RC controller to the adapter and
use it as input device in various RC simulators.

Signed-off-by: Marcus Folkesson 
---

v5:
- Drop autosuspend support
- Use pm_mutex instead of input_dev->mutex
- Use pxrc->is_open instead of input_dev->users
v4:
- Add call to usb_mark_last_busy() in irq
- Move code from pxrc_resume() to pxrc_reset_resume()
v3:
- Use RUDDER and MISC instead of TILT_X and TILT_Y
- Drop kref and anchor
- Rework URB handling
- Add PM support
v2:
- Change module license to GPLv2 to match SPDX tag


 Documentation/input/devices/pxrc.rst |  57 +++
 drivers/input/joystick/Kconfig   |   9 ++
 drivers/input/joystick/Makefile  |   1 +
 drivers/input/joystick/pxrc.c| 303 +++
 4 files changed, 370 insertions(+)
 create mode 100644 Documentation/input/devices/pxrc.rst
 create mode 100644 drivers/input/joystick/pxrc.c

diff --git a/Documentation/input/devices/pxrc.rst 
b/Documentation/input/devices/pxrc.rst
new file mode 100644
index ..ca11f646bae8
--- /dev/null
+++ b/Documentation/input/devices/pxrc.rst
@@ -0,0 +1,57 @@
+===
+pxrc - PhoenixRC Flight Controller Adapter
+===
+
+:Author: Marcus Folkesson 
+
+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_RUDDER|
++-++
+| 6   |  ABS_THROTTLE  |
++-++
+| 7   |  ABS_MISC  |
++-++
+
+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 
+
+To print all input events from input `devnr`.
+
+References
+==
+
+.. [1] http://www.phoenix-sim.com/
+.. [2] https://www.kraxel.org/cgit/input/
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index f3c2f6ea8b44..332c0cc1b2ab 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -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
+   depends on 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
diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
index 67651efda2e1..dd0492ebbed7 100644
--- a/drivers/input/joystick/Makefile
+++ b/drivers/input/joystick/Makefile
@@ -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
diff --git a/drivers/input/joystick/pxrc.c b/drivers/input/joystick/pxrc.c
new file mode 100644
index ..07a0dbd3ced2
--- /dev/null
+++ b/drivers/input/joystick/pxrc.c
@@ -0,0 +1,303 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Driver for Phoenix RC Flight Controller Adapter
+ *
+ * Copyright (C) 2018 Marcus Folkesson 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PXRC_VENDOR_ID (0x1781)
+#define PXRC_PRODUCT_ID(0x0898)
+
+static const struct usb_device_id pxrc_table[] = {
+   { USB_DEVICE(PXRC_VENDOR_ID, PXRC_PRODUCT_ID) },
+   { }
+};
+MODULE_DEVICE_TABLE(usb, pxrc_table);
+
+struct pxrc {
+   struct input_dev*input;
+   struct 

Re: [PATCH v5] input: pxrc: new driver for PhoenixRC Flight Controller Adapter

2018-01-30 Thread Marcus Folkesson
Hello Dmitry,

Do you mind have a look at v5?

Thanks!


On Sat, Jan 20, 2018 at 09:58:40PM +0100, Marcus Folkesson wrote:
> This driver let you plug in your RC controller to the adapter and
> use it as input device in various RC simulators.
> 
> Signed-off-by: Marcus Folkesson 
> ---
> 
> v5:
>   - Drop autosuspend support
>   - Use pm_mutex instead of input_dev->mutex
>   - Use pxrc->is_open instead of input_dev->users
> v4:
>   - Add call to usb_mark_last_busy() in irq
>   - Move code from pxrc_resume() to pxrc_reset_resume()
> v3:
>   - Use RUDDER and MISC instead of TILT_X and TILT_Y
>   - Drop kref and anchor
>   - Rework URB handling
>   - Add PM support
> v2:
>   - Change module license to GPLv2 to match SPDX tag
> 
> 
>  Documentation/input/devices/pxrc.rst |  57 +++
>  drivers/input/joystick/Kconfig   |   9 ++
>  drivers/input/joystick/Makefile  |   1 +
>  drivers/input/joystick/pxrc.c| 303 
> +++
>  4 files changed, 370 insertions(+)
>  create mode 100644 Documentation/input/devices/pxrc.rst
>  create mode 100644 drivers/input/joystick/pxrc.c
> 
> diff --git a/Documentation/input/devices/pxrc.rst 
> b/Documentation/input/devices/pxrc.rst
> new file mode 100644
> index ..ca11f646bae8
> --- /dev/null
> +++ b/Documentation/input/devices/pxrc.rst
> @@ -0,0 +1,57 @@
> +===
> +pxrc - PhoenixRC Flight Controller Adapter
> +===
> +
> +:Author: Marcus Folkesson 
> +
> +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_RUDDER|
> ++-++
> +| 6   |  ABS_THROTTLE  |
> ++-++
> +| 7   |  ABS_MISC  |
> ++-++
> +
> +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 
> +
> +To print all input events from input `devnr`.
> +
> +References
> +==
> +
> +.. [1] http://www.phoenix-sim.com/
> +.. [2] https://www.kraxel.org/cgit/input/
> diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
> index f3c2f6ea8b44..332c0cc1b2ab 100644
> --- a/drivers/input/joystick/Kconfig
> +++ b/drivers/input/joystick/Kconfig
> @@ -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
> + depends on 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
> diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
> index 67651efda2e1..dd0492ebbed7 100644
> --- a/drivers/input/joystick/Makefile
> +++ b/drivers/input/joystick/Makefile
> @@ -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
> diff --git a/drivers/input/joystick/pxrc.c b/drivers/input/joystick/pxrc.c
> new file mode 100644
> index ..07a0dbd3ced2
> --- /dev/null
> +++ b/drivers/input/joystick/pxrc.c
> @@ -0,0 +1,303 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for Phoenix RC Flight Controller Adapter
> + *
> + * Copyright (C) 2018 Marcus Folkesson 
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> 

[PATCH v5] input: pxrc: new driver for PhoenixRC Flight Controller Adapter

2018-01-20 Thread Marcus Folkesson
This driver let you plug in your RC controller to the adapter and
use it as input device in various RC simulators.

Signed-off-by: Marcus Folkesson 
---

v5:
- Drop autosuspend support
- Use pm_mutex instead of input_dev->mutex
- Use pxrc->is_open instead of input_dev->users
v4:
- Add call to usb_mark_last_busy() in irq
- Move code from pxrc_resume() to pxrc_reset_resume()
v3:
- Use RUDDER and MISC instead of TILT_X and TILT_Y
- Drop kref and anchor
- Rework URB handling
- Add PM support
v2:
- Change module license to GPLv2 to match SPDX tag


 Documentation/input/devices/pxrc.rst |  57 +++
 drivers/input/joystick/Kconfig   |   9 ++
 drivers/input/joystick/Makefile  |   1 +
 drivers/input/joystick/pxrc.c| 303 +++
 4 files changed, 370 insertions(+)
 create mode 100644 Documentation/input/devices/pxrc.rst
 create mode 100644 drivers/input/joystick/pxrc.c

diff --git a/Documentation/input/devices/pxrc.rst 
b/Documentation/input/devices/pxrc.rst
new file mode 100644
index ..ca11f646bae8
--- /dev/null
+++ b/Documentation/input/devices/pxrc.rst
@@ -0,0 +1,57 @@
+===
+pxrc - PhoenixRC Flight Controller Adapter
+===
+
+:Author: Marcus Folkesson 
+
+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_RUDDER|
++-++
+| 6   |  ABS_THROTTLE  |
++-++
+| 7   |  ABS_MISC  |
++-++
+
+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 
+
+To print all input events from input `devnr`.
+
+References
+==
+
+.. [1] http://www.phoenix-sim.com/
+.. [2] https://www.kraxel.org/cgit/input/
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index f3c2f6ea8b44..332c0cc1b2ab 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -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
+   depends on 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
diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
index 67651efda2e1..dd0492ebbed7 100644
--- a/drivers/input/joystick/Makefile
+++ b/drivers/input/joystick/Makefile
@@ -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
diff --git a/drivers/input/joystick/pxrc.c b/drivers/input/joystick/pxrc.c
new file mode 100644
index ..07a0dbd3ced2
--- /dev/null
+++ b/drivers/input/joystick/pxrc.c
@@ -0,0 +1,303 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Driver for Phoenix RC Flight Controller Adapter
+ *
+ * Copyright (C) 2018 Marcus Folkesson 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PXRC_VENDOR_ID (0x1781)
+#define PXRC_PRODUCT_ID(0x0898)
+
+static const struct usb_device_id pxrc_table[] = {
+   { USB_DEVICE(PXRC_VENDOR_ID, PXRC_PRODUCT_ID) },
+   { }
+};
+MODULE_DEVICE_TABLE(usb, pxrc_table);
+
+struct pxrc {
+   struct input_dev*input;
+   struct