* [PATCH v2] HID: nintendo: Don't fail on setting baud rate
@ 2024-03-15 16:57 Max Staudt
2024-04-03 11:39 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Max Staudt @ 2024-03-15 16:57 UTC (permalink / raw)
To: Daniel J . Ogorchock, Jiri Kosina, Benjamin Tissoires
Cc: linux-input, linux-kernel, max
Some third-party controllers can't change the baud rate.
We can still use the gamepad as-is, so let's do that.
Signed-off-by: Max Staudt <max@enpas.org>
---
Changes in v2:
- Made hid_err() a hid_warn() since it's not a fatal failure.
---
drivers/hid/hid-nintendo.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 997c3a1adaca..395ed6b5ef59 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -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) {
- hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret);
- goto out_unlock;
+ /*
+ * We can function with the default baudrate.
+ * Provide a warning, and continue on.
+ */
+ hid_warn(hdev, "Failed to set baudrate (ret=%d), continuing anyway\n", ret);
}
/* handshake */
ret = joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ);
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] HID: nintendo: Don't fail on setting baud rate
2024-03-15 16:57 [PATCH v2] HID: nintendo: Don't fail on setting baud rate Max Staudt
@ 2024-04-03 11:39 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2024-04-03 11:39 UTC (permalink / raw)
To: Max Staudt
Cc: Daniel J . Ogorchock, Benjamin Tissoires, linux-input,
linux-kernel
On Sat, 16 Mar 2024, Max Staudt wrote:
> Some third-party controllers can't change the baud rate.
>
> We can still use the gamepad as-is, so let's do that.
>
> Signed-off-by: Max Staudt <max@enpas.org>
> ---
> Changes in v2:
> - Made hid_err() a hid_warn() since it's not a fatal failure.
> ---
> drivers/hid/hid-nintendo.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index 997c3a1adaca..395ed6b5ef59 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -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) {
> - hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret);
> - goto out_unlock;
> + /*
> + * We can function with the default baudrate.
> + * Provide a warning, and continue on.
> + */
> + hid_warn(hdev, "Failed to set baudrate (ret=%d), continuing anyway\n", ret);
Applied, thank you.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-03 11:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 16:57 [PATCH v2] HID: nintendo: Don't fail on setting baud rate Max Staudt
2024-04-03 11:39 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox