[Bug][Patch] /dev/input/jsX absent for Nintendo Switch Pro controller

From: Tom Benham
Date: Sat Aug 16 2025 - 14:24:26 EST


First and foremost, apologies if this report is not properly done or formatted or whatever regarding the kernel development process. Feel free to correct me if I did something wrong.

Distribution: ArchLinux

$ cat /proc/version
Linux version 6.16-arch2-1 (linux@archlinux) (gcc (GCC) 15.2.1 20250813, GNU ld (GNU Binutils) 2.45.0) #3 SMP PREEMPT_DYNAMIC Sat, 16 Aug 2025 16:19:12 +0000

Problem description:
When plugging a Nintendo Switch Pro controller, the /dev/input/js0 file does not get created.

Problem analysis:
I think I have pinpointed the bug in the hid-nintendo.c driver.

I attached the simple patch that works for me.

Would it also make sense to move the rumble config before the call to input_register_device ? It was moved after the IMU device creation in the same commit, although I am not sure if it NEEDS to be. Let me know what you think of that.

Unrelated to the bug but I noticed during my testing that when first plugging the controller, when the hid_nintendo module is not loaded, hid-generic handles it but then it gets disconnected right after and hid_nintendo takes over. I'm very new to kernel debugging so I don't know if this behavior is normal but I guess it is. What's funny is that because hid-generic doesn't have the same bug, the /dev/input/js0 device gets created and then immediately removed. You can see it if you ls continuously the /dev/input folder. This was very confusing at first !

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index fb4985988615..a21618b42c38 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -2138,10 +2138,6 @@ static int joycon_input_create(struct joycon_ctlr *ctlr)
ctlr->input->phys = hdev->phys;
input_set_drvdata(ctlr->input, ctlr);

- ret = input_register_device(ctlr->input);
- if (ret)
- return ret;
-
if (joycon_type_is_right_joycon(ctlr)) {
joycon_config_right_stick(ctlr->input);
joycon_config_buttons(ctlr->input, right_joycon_button_mappings);
@@ -2172,6 +2168,10 @@ static int joycon_input_create(struct joycon_ctlr *ctlr)
joycon_config_buttons(ctlr->input, n64con_button_mappings);
}

+ ret = input_register_device(ctlr->input);
+ if (ret)
+ return ret;
+
if (joycon_has_imu(ctlr)) {
ret = joycon_imu_input_create(ctlr);
if (ret)