All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] HID: nintendo: fix face button mappings
@ 2022-05-12  0:14 Max Fletcher
  2022-05-12  0:15 ` [PATCH 2/2] HID: nintendo: add parameter to swap face buttons Max Fletcher
  2022-05-13 19:58 ` [PATCH 1/2] HID: nintendo: fix face button mappings Roderick Colenbrander
  0 siblings, 2 replies; 8+ messages in thread
From: Max Fletcher @ 2022-05-12  0:14 UTC (permalink / raw)
  To: djogorchock, jikos, benjamin.tissoires, linux-input, linux-kernel
  Cc: Max Fletcher

Previously, A and B would match the Xbox layout, but X and Y were incorrectly swapped. This corrects it so that X and Y match the Xbox layout.

Signed-off-by: Max Fletcher <fletcher0max@gmail.com>
---
 drivers/hid/hid-nintendo.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 2204de889739..7735971ede3f 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -1351,10 +1351,10 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr,
 		input_report_key(dev, BTN_START, btns & JC_BTN_PLUS);
 		input_report_key(dev, BTN_THUMBR, btns & JC_BTN_RSTICK);
 		input_report_key(dev, BTN_MODE, btns & JC_BTN_HOME);
-		input_report_key(dev, BTN_WEST, btns & JC_BTN_Y);
-		input_report_key(dev, BTN_NORTH, btns & JC_BTN_X);
-		input_report_key(dev, BTN_EAST, btns & JC_BTN_A);
-		input_report_key(dev, BTN_SOUTH, btns & JC_BTN_B);
+		input_report_key(dev, BTN_X, btns & JC_BTN_Y);
+		input_report_key(dev, BTN_Y, btns & JC_BTN_X);
+		input_report_key(dev, BTN_B, btns & JC_BTN_A);
+		input_report_key(dev, BTN_A, btns & JC_BTN_B);
 	}
 
 	input_sync(dev);
@@ -1578,7 +1578,7 @@ static const unsigned int joycon_button_inputs_l[] = {
 
 static const unsigned int joycon_button_inputs_r[] = {
 	BTN_START, BTN_MODE, BTN_THUMBR,
-	BTN_SOUTH, BTN_EAST, BTN_NORTH, BTN_WEST,
+	BTN_A, BTN_B, BTN_Y, BTN_X,
 	BTN_TR, BTN_TR2,
 	0 /* 0 signals end of array */
 };
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-04 13:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12  0:14 [PATCH 1/2] HID: nintendo: fix face button mappings Max Fletcher
2022-05-12  0:15 ` [PATCH 2/2] HID: nintendo: add parameter to swap face buttons Max Fletcher
2022-05-13 19:58 ` [PATCH 1/2] HID: nintendo: fix face button mappings Roderick Colenbrander
     [not found]   ` <CAKcX28WpKoP=HVq3zCvBh9knKFEdR0_+NmATpt9D6rFmprkFDA@mail.gmail.com>
2022-05-15  3:33     ` Roderick Colenbrander
2022-05-26 20:07       ` Maxwell Fletcher
2022-05-31 15:19   ` Martino Fontana
2022-05-31 15:31     ` Roderick Colenbrander
2022-06-04 13:11       ` Martino Fontana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.