mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
HID: nintendo: add support for PDP Afterglow controller
Add support for the PDP Afterglow (0e6f:018c), a licensed pro controller. Commit9146038120("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:9146038120("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 <aiman.najjar@hurranet.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
986c24e0fe
commit
3774b1dd8c
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user