linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] Input: joystick: xpad: Add X-Box Adaptive Controller support
@ 2022-08-25 22:24 Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 1/4] " Nate Yocom
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Nate Yocom @ 2022-08-25 22:24 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: nate, linux-input, linux-kernel, hadess, benjamin.tissoires

Adds support for the X-Box Adaptive Controller, which is protocol
compatible with the XTYPE_XBOXONE support in the driver with two deltas:

 - The X-Box button sets 0x02 as its activation ID, where others set
   0x01
 - The controller has an additional Profile button with 4 active states,
   which this change maps to an Axis control with 4 possible values

Patch series adds device to the supported table, adds support for the
Profile button, and adds support for the X-Box button as distinct
changes.

Signed-off-by: Nate Yocom <nate@yocom.org>

Nate Yocom (4):
  Input: joystick: xpad: Add X-Box Adaptive Controller support
  Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  Input: joystick: xpad: Add X-Box Adaptive Controller Profile button
  Input: joystick: xpad: Add X-Box Adaptive Controller XBox button

 v2: Fix warning Reported-by: kernel test robot <lkp@intel.com>
 v3: Break into multi-part and remove VID/PID check for XBox button
 v4: Rename Layer -> Profile as suggested by Bastien Nocera
 v5: Add new ABS_PROFILE axis to uapi and use it for the profile button
<hadess@hadess.net>

 drivers/input/joystick/xpad.c          | 15 ++++++++++++++-
 include/uapi/linux/input-event-codes.h |  1 +
 2 files changed, 15 insertions(+), 1 deletion(-)


base-commit: 15205c2829ca2cbb5ece5ceaafe1171a8470e62b
-- 
2.30.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v5 1/4] Input: joystick: xpad: Add X-Box Adaptive Controller support
  2022-08-25 22:24 [PATCH v5 0/4] Input: joystick: xpad: Add X-Box Adaptive Controller support Nate Yocom
@ 2022-08-25 22:24 ` Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi Nate Yocom
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Nate Yocom @ 2022-08-25 22:24 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: nate, linux-input, linux-kernel, hadess, benjamin.tissoires

Adds correct VID/PID for this XTYPE_XBOXONE compatible controller to
xpad_device[] table.

Signed-off-by: Nate Yocom <nate@yocom.org>
Tested-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 18190b529bca..c8b38bb73d34 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -131,6 +131,7 @@ static const struct xpad_device {
 	{ 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 0, XTYPE_XBOXONE },
 	{ 0x045e, 0x02ea, "Microsoft X-Box One S pad", 0, XTYPE_XBOXONE },
 	{ 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
+	{ 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", 0, XTYPE_XBOXONE },
 	{ 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE },
 	{ 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 },
 	{ 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 },
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-08-25 22:24 [PATCH v5 0/4] Input: joystick: xpad: Add X-Box Adaptive Controller support Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 1/4] " Nate Yocom
@ 2022-08-25 22:24 ` Nate Yocom
  2022-08-27 10:40   ` Bastien Nocera
  2022-08-25 22:24 ` [PATCH v5 3/4] Input: joystick: xpad: Add X-Box Adaptive Controller Profile button Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 4/4] Input: joystick: xpad: Add X-Box Adaptive Controller XBox button Nate Yocom
  3 siblings, 1 reply; 12+ messages in thread
From: Nate Yocom @ 2022-08-25 22:24 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: nate, linux-input, linux-kernel, hadess, benjamin.tissoires

Add an ABS_PROFILE axis for input devices which need it, e.g. X-Box
Adaptive Controller and X-Box Elite 2.
---
 include/uapi/linux/input-event-codes.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index dff8e7f17074..7ad931a32970 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -862,6 +862,7 @@
 #define ABS_TOOL_WIDTH		0x1c
 
 #define ABS_VOLUME		0x20
+#define ABS_PROFILE		0x21
 
 #define ABS_MISC		0x28
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v5 3/4] Input: joystick: xpad: Add X-Box Adaptive Controller Profile button
  2022-08-25 22:24 [PATCH v5 0/4] Input: joystick: xpad: Add X-Box Adaptive Controller support Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 1/4] " Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi Nate Yocom
@ 2022-08-25 22:24 ` Nate Yocom
  2022-08-25 22:24 ` [PATCH v5 4/4] Input: joystick: xpad: Add X-Box Adaptive Controller XBox button Nate Yocom
  3 siblings, 0 replies; 12+ messages in thread
From: Nate Yocom @ 2022-08-25 22:24 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: nate, linux-input, linux-kernel, hadess, benjamin.tissoires

Adds a new quirk for controllers that have a Profile button which has 4
states, reflected as an ABS_PROFILE axis with 4 values.

Signed-off-by: Nate Yocom <nate@yocom.org>
Tested-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/input/joystick/xpad.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index c8b38bb73d34..9557e4768f14 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -80,6 +80,7 @@
 #define MAP_TRIGGERS_TO_BUTTONS		(1 << 1)
 #define MAP_STICKS_TO_NULL		(1 << 2)
 #define MAP_SELECT_BUTTON		(1 << 3)
+#define MAP_PROFILE_BUTTON		(1 << 4)
 #define DANCEPAD_MAP_CONFIG	(MAP_DPAD_TO_BUTTONS |			\
 				MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL)
 
@@ -131,7 +132,7 @@ static const struct xpad_device {
 	{ 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 0, XTYPE_XBOXONE },
 	{ 0x045e, 0x02ea, "Microsoft X-Box One S pad", 0, XTYPE_XBOXONE },
 	{ 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
-	{ 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", 0, XTYPE_XBOXONE },
+	{ 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", MAP_PROFILE_BUTTON, XTYPE_XBOXONE },
 	{ 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE },
 	{ 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 },
 	{ 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 },
@@ -927,6 +928,10 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
 				 (__u16) le16_to_cpup((__le16 *)(data + 8)));
 	}
 
+	/* Profile button has a value of 0-3, so it is reported as an axis */
+	if (xpad->mapping & MAP_PROFILE_BUTTON)
+		input_report_abs(dev, ABS_PROFILE, data[34]);
+
 	input_sync(dev);
 }
 
@@ -1623,6 +1628,9 @@ static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs)
 	case ABS_HAT0Y:	/* the d-pad (only if dpad is mapped to axes */
 		input_set_abs_params(input_dev, abs, -1, 1, 0, 0);
 		break;
+	case ABS_PROFILE: /* 4 value profile button (such as on XAC) */
+		input_set_abs_params(input_dev, abs, 0, 4, 0, 0);
+		break;
 	default:
 		input_set_abs_params(input_dev, abs, 0, 0, 0, 0);
 		break;
@@ -1715,6 +1723,10 @@ static int xpad_init_input(struct usb_xpad *xpad)
 			xpad_set_up_abs(input_dev, xpad_abs_triggers[i]);
 	}
 
+	/* setup profile button as an axis with 4 possible values */
+	if (xpad->mapping & MAP_PROFILE_BUTTON)
+		xpad_set_up_abs(input_dev, ABS_PROFILE);
+
 	error = xpad_init_ff(xpad);
 	if (error)
 		goto err_free_input;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v5 4/4] Input: joystick: xpad: Add X-Box Adaptive Controller XBox button
  2022-08-25 22:24 [PATCH v5 0/4] Input: joystick: xpad: Add X-Box Adaptive Controller support Nate Yocom
                   ` (2 preceding siblings ...)
  2022-08-25 22:24 ` [PATCH v5 3/4] Input: joystick: xpad: Add X-Box Adaptive Controller Profile button Nate Yocom
@ 2022-08-25 22:24 ` Nate Yocom
  3 siblings, 0 replies; 12+ messages in thread
From: Nate Yocom @ 2022-08-25 22:24 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: nate, linux-input, linux-kernel, hadess, benjamin.tissoires

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

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 9557e4768f14..ece38f00dfff 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -859,7 +859,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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-08-25 22:24 ` [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi Nate Yocom
@ 2022-08-27 10:40   ` Bastien Nocera
  2022-08-29 19:07     ` Nate Yocom
  0 siblings, 1 reply; 12+ messages in thread
From: Bastien Nocera @ 2022-08-27 10:40 UTC (permalink / raw)
  To: Nate Yocom, dmitry.torokhov; +Cc: linux-input, linux-kernel, benjamin.tissoires

On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> Add an ABS_PROFILE axis for input devices which need it, e.g. X-Box
> Adaptive Controller and X-Box Elite 2.
> ---
>  include/uapi/linux/input-event-codes.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/input-event-codes.h
> b/include/uapi/linux/input-event-codes.h
> index dff8e7f17074..7ad931a32970 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -862,6 +862,7 @@
>  #define ABS_TOOL_WIDTH         0x1c
>  
>  #define ABS_VOLUME             0x20
> +#define ABS_PROFILE            0x21
>  
>  #define ABS_MISC               0x28
>  


You probably also want to add it to the absolutes array in
drivers/hid/hid-debug.c.

Again, you might want to wait for confirmation from Dmitry that this is
the right way to do this for the profiles.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-08-27 10:40   ` Bastien Nocera
@ 2022-08-29 19:07     ` Nate Yocom
  2022-09-07 15:41       ` Bastien Nocera
  0 siblings, 1 reply; 12+ messages in thread
From: Nate Yocom @ 2022-08-29 19:07 UTC (permalink / raw)
  To: Bastien Nocera, dmitry.torokhov
  Cc: linux-input, linux-kernel, benjamin.tissoires

On Sat, Aug 27, 2022 at 12:40:46PM +0200, Bastien Nocera wrote:
> On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> > Add an ABS_PROFILE axis for input devices which need it, e.g. X-Box
> > Adaptive Controller and X-Box Elite 2.
> > ---
> >  include/uapi/linux/input-event-codes.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/uapi/linux/input-event-codes.h
> > b/include/uapi/linux/input-event-codes.h
> > index dff8e7f17074..7ad931a32970 100644
> > --- a/include/uapi/linux/input-event-codes.h
> > +++ b/include/uapi/linux/input-event-codes.h
> > @@ -862,6 +862,7 @@
> >  #define ABS_TOOL_WIDTH         0x1c
> >  
> >  #define ABS_VOLUME             0x20
> > +#define ABS_PROFILE            0x21
> >  
> >  #define ABS_MISC               0x28
> >  
> 
> 
> You probably also want to add it to the absolutes array in
> drivers/hid/hid-debug.c.

doh, roger.

> Again, you might want to wait for confirmation from Dmitry that this is
> the right way to do this for the profiles.

Makes sense.  Dmitry?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-08-29 19:07     ` Nate Yocom
@ 2022-09-07 15:41       ` Bastien Nocera
  2022-09-08  5:36         ` Dmitry Torokhov
  0 siblings, 1 reply; 12+ messages in thread
From: Bastien Nocera @ 2022-09-07 15:41 UTC (permalink / raw)
  To: Nate Yocom, dmitry.torokhov; +Cc: linux-input, linux-kernel, benjamin.tissoires

On Mon, 2022-08-29 at 12:07 -0700, Nate Yocom wrote:
> On Sat, Aug 27, 2022 at 12:40:46PM +0200, Bastien Nocera wrote:
> > On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> > > Add an ABS_PROFILE axis for input devices which need it, e.g. X-
> > > Box
> > > Adaptive Controller and X-Box Elite 2.
> > > ---
> > >  include/uapi/linux/input-event-codes.h | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/include/uapi/linux/input-event-codes.h
> > > b/include/uapi/linux/input-event-codes.h
> > > index dff8e7f17074..7ad931a32970 100644
> > > --- a/include/uapi/linux/input-event-codes.h
> > > +++ b/include/uapi/linux/input-event-codes.h
> > > @@ -862,6 +862,7 @@
> > >  #define ABS_TOOL_WIDTH         0x1c
> > >  
> > >  #define ABS_VOLUME             0x20
> > > +#define ABS_PROFILE            0x21
> > >  
> > >  #define ABS_MISC               0x28
> > >  
> > 
> > 
> > You probably also want to add it to the absolutes array in
> > drivers/hid/hid-debug.c.
> 
> doh, roger.
> 
> > Again, you might want to wait for confirmation from Dmitry that
> > this is
> > the right way to do this for the profiles.
> 
> Makes sense.  Dmitry?

Dmitry, could you please confirm whether ABS_PROFILE definition is
correct?

Then Nate can update his patch so we can land the support for that
controller.

Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-09-07 15:41       ` Bastien Nocera
@ 2022-09-08  5:36         ` Dmitry Torokhov
  2022-09-08  6:51           ` Benjamin Tissoires
  2022-09-08 17:36           ` Nate Yocom
  0 siblings, 2 replies; 12+ messages in thread
From: Dmitry Torokhov @ 2022-09-08  5:36 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: Nate Yocom, linux-input, linux-kernel, benjamin.tissoires

On Wed, Sep 07, 2022 at 05:41:08PM +0200, Bastien Nocera wrote:
> On Mon, 2022-08-29 at 12:07 -0700, Nate Yocom wrote:
> > On Sat, Aug 27, 2022 at 12:40:46PM +0200, Bastien Nocera wrote:
> > > On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> > > > Add an ABS_PROFILE axis for input devices which need it, e.g. X-
> > > > Box
> > > > Adaptive Controller and X-Box Elite 2.
> > > > ---
> > > >  include/uapi/linux/input-event-codes.h | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/include/uapi/linux/input-event-codes.h
> > > > b/include/uapi/linux/input-event-codes.h
> > > > index dff8e7f17074..7ad931a32970 100644
> > > > --- a/include/uapi/linux/input-event-codes.h
> > > > +++ b/include/uapi/linux/input-event-codes.h
> > > > @@ -862,6 +862,7 @@
> > > >  #define ABS_TOOL_WIDTH         0x1c
> > > >  
> > > >  #define ABS_VOLUME             0x20
> > > > +#define ABS_PROFILE            0x21
> > > >  
> > > >  #define ABS_MISC               0x28
> > > >  
> > > 
> > > 
> > > You probably also want to add it to the absolutes array in
> > > drivers/hid/hid-debug.c.
> > 
> > doh, roger.
> > 
> > > Again, you might want to wait for confirmation from Dmitry that
> > > this is
> > > the right way to do this for the profiles.
> > 
> > Makes sense.  Dmitry?
> 
> Dmitry, could you please confirm whether ABS_PROFILE definition is
> correct?

Yes, I think this makes sense. Do we have a buy in from userspace folks
(Peter H, etc) for this?

I'd like some documentation added to Documentation/input/event-codes.rst
and potentially to Documentation/input/gamepad.rst even though profile
does not have to be gamepad specific event.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-09-08  5:36         ` Dmitry Torokhov
@ 2022-09-08  6:51           ` Benjamin Tissoires
  2022-09-09  1:25             ` Peter Hutterer
  2022-09-08 17:36           ` Nate Yocom
  1 sibling, 1 reply; 12+ messages in thread
From: Benjamin Tissoires @ 2022-09-08  6:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Bastien Nocera, Nate Yocom, open list:HID CORE LAYER, lkml

On Thu, Sep 8, 2022 at 7:36 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Wed, Sep 07, 2022 at 05:41:08PM +0200, Bastien Nocera wrote:
> > On Mon, 2022-08-29 at 12:07 -0700, Nate Yocom wrote:
> > > On Sat, Aug 27, 2022 at 12:40:46PM +0200, Bastien Nocera wrote:
> > > > On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> > > > > Add an ABS_PROFILE axis for input devices which need it, e.g. X-
> > > > > Box
> > > > > Adaptive Controller and X-Box Elite 2.
> > > > > ---
> > > > >  include/uapi/linux/input-event-codes.h | 1 +
> > > > >  1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/include/uapi/linux/input-event-codes.h
> > > > > b/include/uapi/linux/input-event-codes.h
> > > > > index dff8e7f17074..7ad931a32970 100644
> > > > > --- a/include/uapi/linux/input-event-codes.h
> > > > > +++ b/include/uapi/linux/input-event-codes.h
> > > > > @@ -862,6 +862,7 @@
> > > > >  #define ABS_TOOL_WIDTH         0x1c
> > > > >
> > > > >  #define ABS_VOLUME             0x20
> > > > > +#define ABS_PROFILE            0x21
> > > > >
> > > > >  #define ABS_MISC               0x28
> > > > >
> > > >
> > > >
> > > > You probably also want to add it to the absolutes array in
> > > > drivers/hid/hid-debug.c.
> > >
> > > doh, roger.
> > >
> > > > Again, you might want to wait for confirmation from Dmitry that
> > > > this is
> > > > the right way to do this for the profiles.
> > >
> > > Makes sense.  Dmitry?
> >
> > Dmitry, could you please confirm whether ABS_PROFILE definition is
> > correct?
>
> Yes, I think this makes sense. Do we have a buy in from userspace folks
> (Peter H, etc) for this?

AFAICT, libinput wouldn't use that new axis, simply because it doesn't
care about game controllers.
So it all comes down to game users to validate this (and probably only
android is now the main consumer of these given that SDL and Steam are
directly using hidraw or libusb to talk to controllers).

Cheers,
Benjamin

>
> I'd like some documentation added to Documentation/input/event-codes.rst
> and potentially to Documentation/input/gamepad.rst even though profile
> does not have to be gamepad specific event.
>
> Thanks.
>
> --
> Dmitry
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-09-08  5:36         ` Dmitry Torokhov
  2022-09-08  6:51           ` Benjamin Tissoires
@ 2022-09-08 17:36           ` Nate Yocom
  1 sibling, 0 replies; 12+ messages in thread
From: Nate Yocom @ 2022-09-08 17:36 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Bastien Nocera, linux-input, linux-kernel, benjamin.tissoires

On Wed, Sep 07, 2022 at 10:36:35PM -0700, Dmitry Torokhov wrote:
> On Wed, Sep 07, 2022 at 05:41:08PM +0200, Bastien Nocera wrote:
> > On Mon, 2022-08-29 at 12:07 -0700, Nate Yocom wrote:
> > > On Sat, Aug 27, 2022 at 12:40:46PM +0200, Bastien Nocera wrote:
> > > > On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> > > > > Add an ABS_PROFILE axis for input devices which need it, e.g. X-
> > > > > Box
> > > > > Adaptive Controller and X-Box Elite 2.
> > > > > ---
> > > > >  include/uapi/linux/input-event-codes.h | 1 +
> > > > >  1 file changed, 1 insertion(+)
> > > > > 
> > > > > diff --git a/include/uapi/linux/input-event-codes.h
> > > > > b/include/uapi/linux/input-event-codes.h
> > > > > index dff8e7f17074..7ad931a32970 100644
> > > > > --- a/include/uapi/linux/input-event-codes.h
> > > > > +++ b/include/uapi/linux/input-event-codes.h
> > > > > @@ -862,6 +862,7 @@
> > > > >  #define ABS_TOOL_WIDTH         0x1c
> > > > >  
> > > > >  #define ABS_VOLUME             0x20
> > > > > +#define ABS_PROFILE            0x21
> > > > >  
> > > > >  #define ABS_MISC               0x28
> > > > >  
> > > > 
> > > > 
> > > > You probably also want to add it to the absolutes array in
> > > > drivers/hid/hid-debug.c.
> > > 
> > > doh, roger.
> > > 
> > > > Again, you might want to wait for confirmation from Dmitry that
> > > > this is
> > > > the right way to do this for the profiles.
> > > 
> > > Makes sense.  Dmitry?
> > 
> > Dmitry, could you please confirm whether ABS_PROFILE definition is
> > correct?
> 
> Yes, I think this makes sense. Do we have a buy in from userspace folks
> (Peter H, etc) for this?
> 
> I'd like some documentation added to Documentation/input/event-codes.rst
> and potentially to Documentation/input/gamepad.rst even though profile
> does not have to be gamepad specific event.
> 

Will do, v6 incoming shortly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi
  2022-09-08  6:51           ` Benjamin Tissoires
@ 2022-09-09  1:25             ` Peter Hutterer
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Hutterer @ 2022-09-09  1:25 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Dmitry Torokhov, Bastien Nocera, Nate Yocom,
	open list:HID CORE LAYER, lkml

On Thu, Sep 08, 2022 at 08:51:57AM +0200, Benjamin Tissoires wrote:
> On Thu, Sep 8, 2022 at 7:36 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Wed, Sep 07, 2022 at 05:41:08PM +0200, Bastien Nocera wrote:
> > > On Mon, 2022-08-29 at 12:07 -0700, Nate Yocom wrote:
> > > > On Sat, Aug 27, 2022 at 12:40:46PM +0200, Bastien Nocera wrote:
> > > > > On Thu, 2022-08-25 at 15:24 -0700, Nate Yocom wrote:
> > > > > > Add an ABS_PROFILE axis for input devices which need it, e.g. X-
> > > > > > Box
> > > > > > Adaptive Controller and X-Box Elite 2.
> > > > > > ---
> > > > > >  include/uapi/linux/input-event-codes.h | 1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > >
> > > > > > diff --git a/include/uapi/linux/input-event-codes.h
> > > > > > b/include/uapi/linux/input-event-codes.h
> > > > > > index dff8e7f17074..7ad931a32970 100644
> > > > > > --- a/include/uapi/linux/input-event-codes.h
> > > > > > +++ b/include/uapi/linux/input-event-codes.h
> > > > > > @@ -862,6 +862,7 @@
> > > > > >  #define ABS_TOOL_WIDTH         0x1c
> > > > > >
> > > > > >  #define ABS_VOLUME             0x20
> > > > > > +#define ABS_PROFILE            0x21
> > > > > >
> > > > > >  #define ABS_MISC               0x28
> > > > > >
> > > > >
> > > > >
> > > > > You probably also want to add it to the absolutes array in
> > > > > drivers/hid/hid-debug.c.
> > > >
> > > > doh, roger.
> > > >
> > > > > Again, you might want to wait for confirmation from Dmitry that
> > > > > this is
> > > > > the right way to do this for the profiles.
> > > >
> > > > Makes sense.  Dmitry?
> > >
> > > Dmitry, could you please confirm whether ABS_PROFILE definition is
> > > correct?
> >
> > Yes, I think this makes sense. Do we have a buy in from userspace folks
> > (Peter H, etc) for this?
> 
> AFAICT, libinput wouldn't use that new axis, simply because it doesn't
> care about game controllers.

yep, that's pretty much the summary from my side so ACK from me.

Cheers,
  Peter

> So it all comes down to game users to validate this (and probably only
> android is now the main consumer of these given that SDL and Steam are
> directly using hidraw or libusb to talk to controllers).
> 
> Cheers,
> Benjamin
> 
> >
> > I'd like some documentation added to Documentation/input/event-codes.rst
> > and potentially to Documentation/input/gamepad.rst even though profile
> > does not have to be gamepad specific event.
> >
> > Thanks.
> >
> > --
> > Dmitry
> >
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-09  1:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25 22:24 [PATCH v5 0/4] Input: joystick: xpad: Add X-Box Adaptive Controller support Nate Yocom
2022-08-25 22:24 ` [PATCH v5 1/4] " Nate Yocom
2022-08-25 22:24 ` [PATCH v5 2/4] Input: joystick: xpad: Add ABS_PROFILE axis value to uapi Nate Yocom
2022-08-27 10:40   ` Bastien Nocera
2022-08-29 19:07     ` Nate Yocom
2022-09-07 15:41       ` Bastien Nocera
2022-09-08  5:36         ` Dmitry Torokhov
2022-09-08  6:51           ` Benjamin Tissoires
2022-09-09  1:25             ` Peter Hutterer
2022-09-08 17:36           ` Nate Yocom
2022-08-25 22:24 ` [PATCH v5 3/4] Input: joystick: xpad: Add X-Box Adaptive Controller Profile button Nate Yocom
2022-08-25 22:24 ` [PATCH v5 4/4] Input: joystick: xpad: Add X-Box Adaptive Controller XBox button Nate Yocom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).