Stable Archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Nuno Pereira <nf.pereira@outlook.pt>,
	Jiri Kosina <jkosina@suse.com>, Sasha Levin <sashal@kernel.org>,
	djogorchock@gmail.com, jikos@kernel.org, bentiss@kernel.org,
	linux-input@vger.kernel.org
Subject: [PATCH AUTOSEL 6.8 01/23] HID: nintendo: Fix N64 controller being identified as mouse
Date: Tue,  7 May 2024 18:56:27 -0400	[thread overview]
Message-ID: <20240507225725.390306-1-sashal@kernel.org> (raw)

From: Nuno Pereira <nf.pereira@outlook.pt>

[ Upstream commit 8db8c77059e75a0f418b10ede39dd82a9eb031fa ]

This patch is regarding the recent addition of support for the NSO
controllers to hid-nintendo. All controllers are working correctly with the
exception of the N64 controller, which is being identified as a mouse by
udev. This results in the joystick controlling the mouse cursor and the
controller not being detected by games.

The reason for this is because the N64's C buttons have been attributed to
BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
attributed to mice.

This patch changes those buttons to controller buttons, making the
controller be correctly identified as such.

Signed-off-by: Nuno Pereira <nf.pereira@outlook.pt>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/hid/hid-nintendo.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index ccc4032fb2b03..4b2c81b49b80e 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -481,10 +481,10 @@ static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = {
 	{ BTN_TR,		JC_BTN_R,	},
 	{ BTN_TR2,		JC_BTN_LSTICK,	}, /* ZR */
 	{ BTN_START,		JC_BTN_PLUS,	},
-	{ BTN_FORWARD,		JC_BTN_Y,	}, /* C UP */
-	{ BTN_BACK,		JC_BTN_ZR,	}, /* C DOWN */
-	{ BTN_LEFT,		JC_BTN_X,	}, /* C LEFT */
-	{ BTN_RIGHT,		JC_BTN_MINUS,	}, /* C RIGHT */
+	{ BTN_SELECT,		JC_BTN_Y,	}, /* C UP */
+	{ BTN_X,		JC_BTN_ZR,	}, /* C DOWN */
+	{ BTN_Y,		JC_BTN_X,	}, /* C LEFT */
+	{ BTN_C,		JC_BTN_MINUS,	}, /* C RIGHT */
 	{ BTN_MODE,		JC_BTN_HOME,	},
 	{ BTN_Z,		JC_BTN_CAP,	},
 	{ /* sentinel */ },
-- 
2.43.0


             reply	other threads:[~2024-05-07 22:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 22:56 Sasha Levin [this message]
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 02/23] dmaengine: xilinx: xdma: Clarify kdoc in XDMA driver Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 03/23] wifi: mac80211: don't use rate mask for scanning Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 04/23] wifi: mac80211: ensure beacon is non-S1G prior to extracting the beacon timestamp field Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 05/23] wifi: cfg80211: fix the order of arguments for trace events of the tx_rx_evt class Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 06/23] dt-bindings: rockchip: grf: Add missing type to 'pcie-phy' node Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 07/23] HID: mcp-2221: cancel delayed_work only when CONFIG_IIO is enabled Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 08/23] net: usb: qmi_wwan: add Telit FN920C04 compositions Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 09/23] drm/amd/display: Set color_mgmt_changed to true on unsuspend Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 10/23] drm/amdgpu: Update BO eviction priorities Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 11/23] drm/amd/pm: Restore config space after reset Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 12/23] drm/amdkfd: Add VRAM accounting for SVM migration Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 13/23] drm/amdgpu: Fix the ring buffer size for queue VM flush Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 14/23] drm/amdgpu/mes: fix use-after-free issue Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 15/23] Revert "net: txgbe: fix i2c dev name cannot match clkdev" Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 16/23] Revert "net: txgbe: fix clk_name exceed MAX_DEV_ID limits" Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 17/23] cpu: Ignore "mitigations" kernel parameter if CPU_MITIGATIONS=n Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 18/23] LoongArch: Lately init pmu after smp is online Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 19/23] drm/etnaviv: fix tx clock gating on some GC7000 variants Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 20/23] selftests: sud_test: return correct emulated syscall value on RISC-V Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 21/23] riscv: thead: Rename T-Head PBMT to MAE Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 22/23] riscv: T-Head: Test availability bit before enabling MAE errata Sasha Levin
2024-05-07 22:56 ` [PATCH AUTOSEL 6.8 23/23] sched/isolation: Fix boot crash when maxcpus < first housekeeping CPU Sasha Levin

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=20240507225725.390306-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=bentiss@kernel.org \
    --cc=djogorchock@gmail.com \
    --cc=jikos@kernel.org \
    --cc=jkosina@suse.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nf.pereira@outlook.pt \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).