All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks.
@ 2016-08-25 14:16 Ville Ranki
  2016-08-25 16:45 ` Dmitry Torokhov
  2016-09-15 22:35 ` Dmitry Torokhov
  0 siblings, 2 replies; 6+ messages in thread
From: Ville Ranki @ 2016-08-25 14:16 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, Ville Ranki

Current implementation of joydev's input_device_id
table recognizes only devices with ABS_X, ABS_WHEEL
or ABS_THROTTLE axes as joysticks.

There are joystick devices that do not have those axes,
for example TRC Rudder device. The device in question
has ABS_Z, ABS_RX and ABS_RY axes causing it not being
detected as joystick.

This patch adds ABS_Z to the input_device_id list
allowing devices with ABS_Z axis to be detected
correctly.

Signed-off-by: Ville Ranki <ville.ranki@iki.fi>
---
 drivers/input/joydev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 5d11fea..f3135ae 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -950,6 +950,12 @@ static const struct input_device_id joydev_ids[] = {
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
 				INPUT_DEVICE_ID_MATCH_ABSBIT,
 		.evbit = { BIT_MASK(EV_ABS) },
+		.absbit = { BIT_MASK(ABS_Z) },
+	},
+	{
+		.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
+				INPUT_DEVICE_ID_MATCH_ABSBIT,
+		.evbit = { BIT_MASK(EV_ABS) },
 		.absbit = { BIT_MASK(ABS_WHEEL) },
 	},
 	{
-- 
2.7.4


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

* Re: [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks.
  2016-08-25 14:16 [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks Ville Ranki
@ 2016-08-25 16:45 ` Dmitry Torokhov
  2016-08-25 20:56   ` Ville Ranki
  2016-09-15 22:35 ` Dmitry Torokhov
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2016-08-25 16:45 UTC (permalink / raw)
  To: Ville Ranki; +Cc: linux-input

On Thu, Aug 25, 2016 at 05:16:50PM +0300, Ville Ranki wrote:
> Current implementation of joydev's input_device_id
> table recognizes only devices with ABS_X, ABS_WHEEL
> or ABS_THROTTLE axes as joysticks.
> 
> There are joystick devices that do not have those axes,
> for example TRC Rudder device. The device in question
> has ABS_Z, ABS_RX and ABS_RY axes causing it not being
> detected as joystick.
> 
> This patch adds ABS_Z to the input_device_id list
> allowing devices with ABS_Z axis to be detected
> correctly.

I am curious why you still use joydev and not switch your client(s) to
evdev? Or is it some legacy game?

Thanks.

> 
> Signed-off-by: Ville Ranki <ville.ranki@iki.fi>
> ---
>  drivers/input/joydev.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
> index 5d11fea..f3135ae 100644
> --- a/drivers/input/joydev.c
> +++ b/drivers/input/joydev.c
> @@ -950,6 +950,12 @@ static const struct input_device_id joydev_ids[] = {
>  		.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
>  				INPUT_DEVICE_ID_MATCH_ABSBIT,
>  		.evbit = { BIT_MASK(EV_ABS) },
> +		.absbit = { BIT_MASK(ABS_Z) },
> +	},
> +	{
> +		.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
> +				INPUT_DEVICE_ID_MATCH_ABSBIT,
> +		.evbit = { BIT_MASK(EV_ABS) },
>  		.absbit = { BIT_MASK(ABS_WHEEL) },
>  	},
>  	{
> -- 
> 2.7.4
> 

-- 
Dmitry

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

* Re: [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks.
  2016-08-25 16:45 ` Dmitry Torokhov
@ 2016-08-25 20:56   ` Ville Ranki
  2016-09-02  9:11     ` Ville Ranki
  0 siblings, 1 reply; 6+ messages in thread
From: Ville Ranki @ 2016-08-25 20:56 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/25/2016 07:45 PM, Dmitry Torokhov wrote:
>> This patch adds ABS_Z to the input_device_id list allowing
>> devices with ABS_Z axis to be detected correctly.
> 
> I am curious why you still use joydev and not switch your client(s)
> to evdev? Or is it some legacy game?

Yes, this is about legacy games. For example X-Plane requires
joystick node to be present.

- -- 
Ville Ranki <ville.ranki@iki.fi>
http://www.iki.fi/~cos
PGP public key: http://www.iki.fi/~cos/vranki_pub.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAle/W3UACgkQVm11nqR7UVwysgCcDb9WIsMKC9qNPHxMWA9rFSqM
7YcAnibn2E02M4/7v7QjD0wuD3QdJMhG
=DjXV
-----END PGP SIGNATURE-----

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

* Re: [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks.
  2016-08-25 20:56   ` Ville Ranki
@ 2016-09-02  9:11     ` Ville Ranki
  2016-09-15 14:18       ` Ville Ranki
  0 siblings, 1 reply; 6+ messages in thread
From: Ville Ranki @ 2016-09-02  9:11 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On 08/25/2016 11:56 PM, Ville Ranki wrote:
> On 08/25/2016 07:45 PM, Dmitry Torokhov wrote:
>>> This patch adds ABS_Z to the input_device_id list allowing 
>>> devices with ABS_Z axis to be detected correctly.
> 
>> I am curious why you still use joydev and not switch your
>> client(s) to evdev? Or is it some legacy game?
> 
> Yes, this is about legacy games. For example X-Plane requires 
> joystick node to be present.

Was this patch accepted or rejected? In distros event devices are
not readable by non-root users by default while joystick devices are.
These can be changed with udev rules, but IMO joystick detection
should be fixed on kernel level.

-- 
Ville Ranki <ville.ranki@iki.fi>
http://www.iki.fi/~cos
PGP public key: http://www.iki.fi/~cos/vranki_pub.asc

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

* Re: [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks.
  2016-09-02  9:11     ` Ville Ranki
@ 2016-09-15 14:18       ` Ville Ranki
  0 siblings, 0 replies; 6+ messages in thread
From: Ville Ranki @ 2016-09-15 14:18 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On 09/02/2016 12:11 PM, Ville Ranki wrote:

> Was this patch accepted or rejected? 

Still waiting for answer. If it requires changes, I'm happy
to do so. I asked another kernel developer to review the
patch and he said it should be ok.

-- 
Ville Ranki <ville.ranki@iki.fi>
http://www.iki.fi/~cos
PGP public key: http://www.iki.fi/~cos/vranki_pub.asc

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

* Re: [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks.
  2016-08-25 14:16 [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks Ville Ranki
  2016-08-25 16:45 ` Dmitry Torokhov
@ 2016-09-15 22:35 ` Dmitry Torokhov
  1 sibling, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2016-09-15 22:35 UTC (permalink / raw)
  To: Ville Ranki; +Cc: linux-input

On Thu, Aug 25, 2016 at 05:16:50PM +0300, Ville Ranki wrote:
> Current implementation of joydev's input_device_id
> table recognizes only devices with ABS_X, ABS_WHEEL
> or ABS_THROTTLE axes as joysticks.
> 
> There are joystick devices that do not have those axes,
> for example TRC Rudder device. The device in question
> has ABS_Z, ABS_RX and ABS_RY axes causing it not being
> detected as joystick.
> 
> This patch adds ABS_Z to the input_device_id list
> allowing devices with ABS_Z axis to be detected
> correctly.
> 
> Signed-off-by: Ville Ranki <ville.ranki@iki.fi>

Applied, thank you.

Although I wonder if we could not move joydev implementation to
userspace in the long run.

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2016-09-15 22:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 14:16 [PATCH] Input: joydev - Recognize joysticks with Z axis as joysticks Ville Ranki
2016-08-25 16:45 ` Dmitry Torokhov
2016-08-25 20:56   ` Ville Ranki
2016-09-02  9:11     ` Ville Ranki
2016-09-15 14:18       ` Ville Ranki
2016-09-15 22:35 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.