* [PATCH v2] HID: nintendo: add support for md/gen 6B controller
@ 2025-01-11 6:35 Ryan McClelland
0 siblings, 0 replies; 2+ messages in thread
From: Ryan McClelland @ 2025-01-11 6:35 UTC (permalink / raw)
To: linux-input
Cc: djogorchock, benjamin.tissoires, jikos, linux, Ryan McClelland
The NSO MD/GEN 6B was a Japan-only controller released which has
6 buttons on the face of the controller. This adds support for this
controller. It still enumerates just like the 3B controller, but
will use extra bits in it's report for the 3 extra buttons. This
also changes the events to match the proper position. The VID/PID
it reports is the same as the 3B controller.
This also removes a comment on the N64 Controllers which didn't
mean anything.
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
---
drivers/hid/Kconfig | 2 +-
drivers/hid/hid-nintendo.c | 18 +++++++-----------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index f8a56d631242..5b1156f4e9bc 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -775,7 +775,7 @@ config HID_NINTENDO
Adds support for the Nintendo Switch Joy-Cons, NSO, Pro Controller.
All controllers support bluetooth, and the Pro Controller also supports
its USB mode. This also includes support for the Nintendo Switch Online
- Controllers which include the Genesis, SNES, and N64 controllers.
+ Controllers which include the NES, Genesis, SNES, and N64 controllers.
To compile this driver as a module, choose M here: the
module will be called hid-nintendo.
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 55153a2f7988..839d5bcd72b1 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -456,24 +456,20 @@ static const struct joycon_ctlr_button_mapping snescon_button_mappings[] = {
{ /* sentinel */ },
};
-/*
- * "A", "B", and "C" are mapped positionally, rather than by label (e.g., "A"
- * gets assigned to BTN_EAST instead of BTN_A).
- */
static const struct joycon_ctlr_button_mapping gencon_button_mappings[] = {
- { BTN_SOUTH, JC_BTN_A, },
- { BTN_EAST, JC_BTN_B, },
- { BTN_WEST, JC_BTN_R, },
- { BTN_SELECT, JC_BTN_ZR, },
+ { BTN_WEST, JC_BTN_A, }, /* A */
+ { BTN_SOUTH, JC_BTN_B, }, /* B */
+ { BTN_EAST, JC_BTN_R, }, /* C */
+ { BTN_TL, JC_BTN_X, }, /* X MD/GEN 6B Only */
+ { BTN_NORTH, JC_BTN_Y, }, /* Y MD/GEN 6B Only */
+ { BTN_TR, JC_BTN_L, }, /* Z MD/GEN 6B Only */
+ { BTN_SELECT, JC_BTN_ZR, }, /* Mode */
{ BTN_START, JC_BTN_PLUS, },
{ BTN_MODE, JC_BTN_HOME, },
{ BTN_Z, JC_BTN_CAP, },
{ /* sentinel */ },
};
-/*
- * N64's C buttons get assigned to d-pad directions and registered as buttons.
- */
static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = {
{ BTN_A, JC_BTN_A, },
{ BTN_B, JC_BTN_B, },
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2] HID: nintendo: add support for md/gen 6B controller
@ 2025-01-11 6:36 Ryan McClelland
0 siblings, 0 replies; 2+ messages in thread
From: Ryan McClelland @ 2025-01-11 6:36 UTC (permalink / raw)
To: linux-input
Cc: djogorchock, benjamin.tissoires, jikos, linux, Ryan McClelland
The NSO MD/GEN 6B was a Japan-only controller released which has
6 buttons on the face of the controller. This adds support for this
controller. It still enumerates just like the 3B controller, but
will use extra bits in it's report for the 3 extra buttons. This
also changes the events to match the proper position. The VID/PID
it reports is the same as the 3B controller.
This also removes a comment on the N64 Controllers which didn't
mean anything.
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
---
V1 -> V2: fix button events for genesis with redundant Z and correct layout
drivers/hid/Kconfig | 2 +-
drivers/hid/hid-nintendo.c | 18 +++++++-----------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index f8a56d631242..5b1156f4e9bc 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -775,7 +775,7 @@ config HID_NINTENDO
Adds support for the Nintendo Switch Joy-Cons, NSO, Pro Controller.
All controllers support bluetooth, and the Pro Controller also supports
its USB mode. This also includes support for the Nintendo Switch Online
- Controllers which include the Genesis, SNES, and N64 controllers.
+ Controllers which include the NES, Genesis, SNES, and N64 controllers.
To compile this driver as a module, choose M here: the
module will be called hid-nintendo.
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 55153a2f7988..839d5bcd72b1 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -456,24 +456,20 @@ static const struct joycon_ctlr_button_mapping snescon_button_mappings[] = {
{ /* sentinel */ },
};
-/*
- * "A", "B", and "C" are mapped positionally, rather than by label (e.g., "A"
- * gets assigned to BTN_EAST instead of BTN_A).
- */
static const struct joycon_ctlr_button_mapping gencon_button_mappings[] = {
- { BTN_SOUTH, JC_BTN_A, },
- { BTN_EAST, JC_BTN_B, },
- { BTN_WEST, JC_BTN_R, },
- { BTN_SELECT, JC_BTN_ZR, },
+ { BTN_WEST, JC_BTN_A, }, /* A */
+ { BTN_SOUTH, JC_BTN_B, }, /* B */
+ { BTN_EAST, JC_BTN_R, }, /* C */
+ { BTN_TL, JC_BTN_X, }, /* X MD/GEN 6B Only */
+ { BTN_NORTH, JC_BTN_Y, }, /* Y MD/GEN 6B Only */
+ { BTN_TR, JC_BTN_L, }, /* Z MD/GEN 6B Only */
+ { BTN_SELECT, JC_BTN_ZR, }, /* Mode */
{ BTN_START, JC_BTN_PLUS, },
{ BTN_MODE, JC_BTN_HOME, },
{ BTN_Z, JC_BTN_CAP, },
{ /* sentinel */ },
};
-/*
- * N64's C buttons get assigned to d-pad directions and registered as buttons.
- */
static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = {
{ BTN_A, JC_BTN_A, },
{ BTN_B, JC_BTN_B, },
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-11 6:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-11 6:35 [PATCH v2] HID: nintendo: add support for md/gen 6B controller Ryan McClelland
-- strict thread matches above, loose matches on Subject: below --
2025-01-11 6:36 Ryan McClelland
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 NNTP newsgroup(s).