Skip to contentSkip to conversation

HID: nintendo: Don't fail on setting baud rate

PATCH Superseded Max Staudt 1 participant 2 messages Jan 15, 2024 – Feb 20, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Max Staudt

author
#0 lore raw

PATCH 1/1 HID: nintendo: Don't fail on setting baud rate

Some third-party controllers can't change the baud rate.

We can still use the gamepad as-is, so let's do that.

---
 drivers/hid/hid-nintendo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hid/hid-nintendo.c +4 -1
index 997c3a1adaca..8cba0612c3ae 100644
@@ -2164,8 +2164,11 @@ static int joycon_init(struct hid_device *hdev)
 		/* set baudrate for improved latency */
 		ret = joycon_send_usb(ctlr, JC_USB_CMD_BAUDRATE_3M, HZ);
 		if (ret) {
+			/*
+			 * We can function with the default baudrate.
+			 * Provide a warning, and continue on.
+			 */
 			hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret);
-			goto out_unlock;
 		}
 		/* handshake */
 		ret = joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ);
Signature · 1 line
2.39.2
author
#1 lore raw

Ping :)

Do you think this patch could be upstreamed to widen the controller support?

Thank you for looking at this!

Max

Quoted 26 lines · Max Staudt

Some third-party controllers can't change the baud rate.

We can still use the gamepad as-is, so let's do that.

---
  drivers/hid/hid-nintendo.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hid/hid-nintendo.c +4 -1
index 997c3a1adaca..8cba0612c3ae 100644
@@ -2164,8 +2164,11 @@ static int joycon_init(struct hid_device *hdev)
  		/* set baudrate for improved latency */
  		ret = joycon_send_usb(ctlr, JC_USB_CMD_BAUDRATE_3M, HZ);
  		if (ret) {
+			/*
+			 * We can function with the default baudrate.
+			 * Provide a warning, and continue on.
+			 */
  			hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret);
-			goto out_unlock;
  		}
  		/* handshake */
  		ret = joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ);