Thread (3 messages) 3 messages, 2 authors, 2021-01-25

Re: [PATCH 1/3 v7] input: Add N64 controller driver

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2021-01-25 05:15:24
Also in: linux-mips

Hi Lauri,

On Fri, Jan 15, 2021 at 01:34:08PM +0200, Lauri Kasanen wrote:
quoted hunk ↗ jump to hunk
This adds support for the four built-in controller
ports on the Nintendo 64 console. The N64 controller
includes an analog stick, a d-pad, and several buttons.

No module support as the target has only 8mb ram.

Signed-off-by: Lauri Kasanen <redacted>
---

v7: use devm_platform_ioremap_resource

 drivers/input/joystick/Kconfig  |   6 +
 drivers/input/joystick/Makefile |   2 +-
 drivers/input/joystick/n64joy.c | 343 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 350 insertions(+), 1 deletion(-)
 create mode 100644 drivers/input/joystick/n64joy.c
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index b080f0c..e1a8128 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -382,4 +382,10 @@ config JOYSTICK_FSIA6B
 	  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
+	  Support for the four N64 controllers.
I expanded this help section with wording from your CL description.
+
+			dev->name = "N64 controller";
+			dev->phys = n64joy_phys[i];
+			dev->id.bustype = BUS_HOST;
+			dev->id.vendor = 0;
+			dev->id.product = data[i].data >> 16;
+			dev->id.version = 0;
I added

			dev->dev.parent = &pdev->dev;

so that controllers are parented properly, and applied.


-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help