From f45aaae6204d1c7b0200ce043102ec84d805ac34 Mon Sep 17 00:00:00 2001 From: Nate Yocom Date: Wed, 28 Sep 2022 18:18:54 -0700 Subject: 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 Tested-by: Bastien Nocera Reviewed-by: Mattijs Korpershoek --- drivers/input/joystick/xpad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/input') diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 1058ed28be49..c66ae73523d2 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -969,7 +969,8 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char if (data[1] == (GIP_OPT_ACK | GIP_OPT_INTERNAL)) xpadone_ack_mode_report(xpad, data[2]); - input_report_key(dev, BTN_MODE, data[4] & BIT(0)); + input_report_key(dev, BTN_MODE, data[4] & GENMASK(1, 0)); + input_sync(dev); do_sync = true; } else if (data[0] == GIP_CMD_FIRMWARE) { -- cgit v1.2.3-59-g8ed1b