From 3774b1dd8cbce8dd75dd677fd68c5a2dc70860c6 Mon Sep 17 00:00:00 2001 From: Aiman Najjar Date: Sat, 15 Aug 2026 14:58:01 -0400 Subject: [PATCH] HID: nintendo: add support for PDP Afterglow controller Add support for the PDP Afterglow (0e6f:018c), a licensed pro controller. Commit 9146038120a6 ("HID: nintendo: add support for HORI Wireless Switch Pad") applied X/Y button swap to all Licensed Pro controllers which caused the North/West buttons to come up swapped for PDP Afterflow. The swapped layout seems to be specific to HORI, so restrict the quirk to HORI devices and use the standard mapping for all other licensed pro controllers. Fixes: 9146038120a6 ("HID: nintendo: add support for HORI Wireless Switch Pad") Link: https://lore.kernel.org/all/20260527-hori-support-v2-1-195c2f832112@hectorzelaya.dev/ Signed-off-by: Aiman Najjar Signed-off-by: Jiri Kosina --- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-nintendo.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index b3aca5aa9176..7f6c786535ea 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -1167,6 +1167,7 @@ #define USB_DEVICE_ID_PDP_PS4_JAGUAR 0x0173 #define USB_DEVICE_ID_PDP_PS4_RIFFMASTER 0x024a #define USB_DEVICE_ID_PDP_PS5_RIFFMASTER 0x0249 +#define USB_DEVICE_ID_PDP_SWITCH_AFTERGLOW 0x018c #define USB_VENDOR_ID_PLANTRONICS 0x047f #define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3210_SERIES 0xc055 diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index 43e0f2aaea3b..b1fcf3e5767b 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -434,8 +434,8 @@ static const struct joycon_ctlr_button_mapping procon_button_mappings[] = { { /* sentinel */ }, }; -/* Licensed Pro Controllers (e.g. HORI) swap X/Y bits in the report */ -static const struct joycon_ctlr_button_mapping lic_procon_button_mappings[] = { +/* HORI Licensed Pro Controllers swap X/Y bits in the report */ +static const struct joycon_ctlr_button_mapping lic_hori_procon_button_mappings[] = { { BTN_EAST, JC_BTN_A, }, { BTN_SOUTH, JC_BTN_B, }, { BTN_NORTH, JC_BTN_Y, }, @@ -1767,8 +1767,8 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr, joycon_report_left_stick(ctlr, rep); joycon_report_right_stick(ctlr, rep); joycon_report_dpad(ctlr, rep); - if (ctlr->ctlr_type == JOYCON_CTLR_TYPE_LIC_PRO) - joycon_report_buttons(ctlr, rep, lic_procon_button_mappings); + if (ctlr->hdev->vendor == USB_VENDOR_ID_HORI) + joycon_report_buttons(ctlr, rep, lic_hori_procon_button_mappings); else joycon_report_buttons(ctlr, rep, procon_button_mappings); } else if (joycon_type_is_any_nescon(ctlr)) { @@ -2212,8 +2212,8 @@ static int joycon_input_create(struct joycon_ctlr *ctlr) joycon_config_left_stick(ctlr->input); joycon_config_right_stick(ctlr->input); joycon_config_dpad(ctlr->input); - if (ctlr->ctlr_type == JOYCON_CTLR_TYPE_LIC_PRO) - joycon_config_buttons(ctlr->input, lic_procon_button_mappings); + if (ctlr->hdev->vendor == USB_VENDOR_ID_HORI) + joycon_config_buttons(ctlr->input, lic_hori_procon_button_mappings); else joycon_config_buttons(ctlr->input, procon_button_mappings); } else if (joycon_type_is_any_nescon(ctlr)) { @@ -2905,6 +2905,8 @@ static const struct hid_device_id nintendo_hid_devices[] = { USB_DEVICE_ID_NINTENDO_N64CON) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_HORI, USB_DEVICE_ID_HORI_WIRELESS_SWITCH_PAD) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_PDP, + USB_DEVICE_ID_PDP_SWITCH_AFTERGLOW) }, { } }; MODULE_DEVICE_TABLE(hid, nintendo_hid_devices);