Linux Input/HID development
 help / color / mirror / Atom feed
From: Vicki Pfau <vi@endrift.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	linux-input@vger.kernel.org
Cc: Vicki Pfau <vi@endrift.com>, Silvan Jegen <s.jegen@gmail.com>
Subject: [PATCH v15 4/4] HID: nintendo: Patch NYXI Hyperion 3 descriptor
Date: Thu,  1 Oct 2026 17:29:26 -0700	[thread overview]
Message-ID: <20261002002929.1578115-5-vi@endrift.com> (raw)
In-Reply-To: <20261002002929.1578115-1-vi@endrift.com>

The HID report descriptor for the third-party NYXI Hyperion 3's right
Joy-Con erroneously reports it as using the report ID for the left Joy-Con.
Since it does actually send the report ID for the right Joy-Con, the HID
subsystem rejects it as unknown. Here we patch it to properly report as the
right Joy-Con report ID to ensure the HID subsystem passes it through
properly.

Signed-off-by: Vicki Pfau <vi@endrift.com>
---
 drivers/hid/hid-nintendo.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 533a2560bfb9..d114cc389aac 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -4500,6 +4500,21 @@ static int nintendo_hid_event(struct hid_device *hdev,
 		return joycon_event(hdev, report, raw_data, size);
 }
 
+static const __u8 *nintendo_hid_report_fixup(struct hid_device *hdev,
+			    __u8 *rdesc, unsigned int *rsize)
+{
+	if (hdev->vendor == USB_VENDOR_ID_NINTENDO &&
+		hdev->product == USB_DEVICE_ID_NINTENDO_NS2_JOYCONR &&
+		*rsize == 100 && rdesc[24] == NS2_REPORT_JCL)
+		/*
+		 * The NYXI Hyperion 3 right Joy-Con accidentally reports as the
+		 * left one. Since the HID subsystem rejects report IDs that
+		 * aren't listed in the descriptor, we need to patch it.
+		 */
+		rdesc[24] = NS2_REPORT_JCR;
+	return rdesc;
+}
+
 static int nintendo_hid_probe(struct hid_device *hdev,
 			    const struct hid_device_id *id)
 {
@@ -4528,6 +4543,7 @@ static int nintendo_hid_suspend(struct hid_device *hdev, pm_message_t message)
 static struct hid_driver nintendo_hid_driver = {
 	.name		= "nintendo",
 	.id_table	= nintendo_hid_devices,
+	.report_fixup	= nintendo_hid_report_fixup,
 	.probe		= nintendo_hid_probe,
 	.remove		= nintendo_hid_remove,
 	.raw_event	= nintendo_hid_event,
-- 
2.54.0


      parent reply	other threads:[~2026-10-02  0:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02  0:29 [PATCH v15 0/4] HID: nintendo: Add preliminary Switch 2 controller driver Vicki Pfau
2026-10-02  0:29 ` [PATCH v15 1/4] " Vicki Pfau
2026-10-02  9:14   ` sashiko-bot
2026-10-02  0:29 ` [PATCH v15 2/4] HID: nintendo: Add rumble support for Switch 2 controllers Vicki Pfau
2026-10-02  9:14   ` sashiko-bot
2026-10-02  0:29 ` [PATCH v15 3/4] HID: nintendo: Add unified report format support Vicki Pfau
2026-10-02  0:29 ` Vicki Pfau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002002929.1578115-5-vi@endrift.com \
    --to=vi@endrift.com \
    --cc=bentiss@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=s.jegen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox