Skip to content

Commit f45aaae

Browse files
nate-yocomdtor
authored andcommitted
Input: xpad - add X-Box Adaptive XBox button
Adaptive controller sets 0x02 bit for this button, all others set 0x01 so presence of either is used for BTN_MODE. Signed-off-by: Nate Yocom <nate@yocom.org> Tested-by: Bastien Nocera <hadess@hadess.net> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com Link: https://lore.kernel.org/r/20220908173930.28940-3-nate@yocom.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent d218fe0 commit f45aaae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/input/joystick/xpad.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,8 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
969969
if (data[1] == (GIP_OPT_ACK | GIP_OPT_INTERNAL))
970970
xpadone_ack_mode_report(xpad, data[2]);
971971

972-
input_report_key(dev, BTN_MODE, data[4] & BIT(0));
972+
input_report_key(dev, BTN_MODE, data[4] & GENMASK(1, 0));
973+
input_sync(dev);
973974

974975
do_sync = true;
975976
} else if (data[0] == GIP_CMD_FIRMWARE) {

0 commit comments

Comments
 (0)