diff mbox series

[v6,2/5] Input: joystick: xpad: Add X-Box Adaptive XBox button

Message ID 20220908173930.28940-3-nate@yocom.org (mailing list archive)
State Accepted
Commit f45aaae6204d1c7b0200ce043102ec84d805ac34
Headers show
Series Input: joystick: xpad: Add X-Box Adaptive Controller support | expand

Commit Message

Nate Yocom Sept. 8, 2022, 5:39 p.m. UTC
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>
---
 drivers/input/joystick/xpad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mattijs Korpershoek Sept. 28, 2022, 7:21 a.m. UTC | #1
Hi Nate,

On Thu, Sep 08, 2022 at 10:39, Nate Yocom <nate@yocom.org> wrote:

> 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>

This does not applies properly anymore on dtor/next [1] because of
90c9978959da ("Input: xpad - refactor using BIT() macro") and
e23c69e33248 ("Input: xpad - add support for XBOX One Elite paddles")

With that, please add:

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com

> ---
>  drivers/input/joystick/xpad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index c8b38bb73d34..dff0d099d416 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -858,7 +858,7 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
>  		if (data[1] == 0x30)
>  			xpadone_ack_mode_report(xpad, data[2]);
>  
> -		input_report_key(dev, BTN_MODE, data[4] & 0x01);
> +		input_report_key(dev, BTN_MODE, data[4] & 0x03);
>  		input_sync(dev);
>  		return;
>  	}
> -- 
> 2.30.2
diff mbox series

Patch

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index c8b38bb73d34..dff0d099d416 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -858,7 +858,7 @@  static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
 		if (data[1] == 0x30)
 			xpadone_ack_mode_report(xpad, data[2]);
 
-		input_report_key(dev, BTN_MODE, data[4] & 0x01);
+		input_report_key(dev, BTN_MODE, data[4] & 0x03);
 		input_sync(dev);
 		return;
 	}