* [PATCH] Input: joydev fixes for 4.12 @ 2017-06-09 20:35 Roderick Colenbrander 2017-06-09 20:35 ` [PATCH] Input: joydev - ignore accelerometer devices Roderick Colenbrander 0 siblings, 1 reply; 6+ messages in thread From: Roderick Colenbrander @ 2017-06-09 20:35 UTC (permalink / raw) To: linux-input; +Cc: Dmitry Torokhov, Benjamin Tissoires, Roderick Colenbrander From: Roderick Colenbrander <roderick.colenbrander@sony.com> Hi, Earlier this week a user reported issues on 4.12 with DS3/DS4 for which the motion sensor devices are picked up by joydev. In 4.12, the hid-sony driver moved the motion sensors to a separate device node. This patch makes blacklists accelorometer devices as they don't make sense for classic joystick applications. Thanks, Roderick Roderick Colenbrander (1): Input: joydev - ignore accelerometer devices drivers/input/joydev.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.9.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] Input: joydev - ignore accelerometer devices 2017-06-09 20:35 [PATCH] Input: joydev fixes for 4.12 Roderick Colenbrander @ 2017-06-09 20:35 ` Roderick Colenbrander 2017-06-12 7:09 ` Benjamin Tissoires 0 siblings, 1 reply; 6+ messages in thread From: Roderick Colenbrander @ 2017-06-09 20:35 UTC (permalink / raw) To: linux-input; +Cc: Dmitry Torokhov, Benjamin Tissoires, Roderick Colenbrander From: Roderick Colenbrander <roderick.colenbrander@sony.com> Gamepads like DualShock 3 / 4 as of 4.12 started reporting motion sensors on a separate evdev node. Joydev is picking these devices up as well, but they don't make sense for the joydev interface. Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> --- drivers/input/joydev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 29d677c..a5ceaaf 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -819,6 +819,10 @@ static bool joydev_match(struct input_handler *handler, struct input_dev *dev) if (joydev_dev_is_absolute_mouse(dev)) return false; + /* Avoid accelerometers */ + if (test_bit(INPUT_PROP_ACCELEROMETER, dev->propbit)) + return false; + return true; } -- 2.9.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: joydev - ignore accelerometer devices 2017-06-09 20:35 ` [PATCH] Input: joydev - ignore accelerometer devices Roderick Colenbrander @ 2017-06-12 7:09 ` Benjamin Tissoires 2017-06-20 2:57 ` Dmitry Torokhov 0 siblings, 1 reply; 6+ messages in thread From: Benjamin Tissoires @ 2017-06-12 7:09 UTC (permalink / raw) To: Roderick Colenbrander; +Cc: linux-input, Dmitry Torokhov, Roderick Colenbrander On Jun 09 2017 or thereabouts, Roderick Colenbrander wrote: > From: Roderick Colenbrander <roderick.colenbrander@sony.com> > > Gamepads like DualShock 3 / 4 as of 4.12 started reporting motion > sensors on a separate evdev node. Joydev is picking these devices > up as well, but they don't make sense for the joydev interface. > > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> > --- Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cheers, Benjamin > drivers/input/joydev.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c > index 29d677c..a5ceaaf 100644 > --- a/drivers/input/joydev.c > +++ b/drivers/input/joydev.c > @@ -819,6 +819,10 @@ static bool joydev_match(struct input_handler *handler, struct input_dev *dev) > if (joydev_dev_is_absolute_mouse(dev)) > return false; > > + /* Avoid accelerometers */ > + if (test_bit(INPUT_PROP_ACCELEROMETER, dev->propbit)) > + return false; > + > return true; > } > > -- > 2.9.3 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: joydev - ignore accelerometer devices 2017-06-12 7:09 ` Benjamin Tissoires @ 2017-06-20 2:57 ` Dmitry Torokhov 2017-06-20 16:58 ` Roderick Colenbrander 0 siblings, 1 reply; 6+ messages in thread From: Dmitry Torokhov @ 2017-06-20 2:57 UTC (permalink / raw) To: Benjamin Tissoires Cc: Roderick Colenbrander, linux-input, Roderick Colenbrander On Mon, Jun 12, 2017 at 09:09:53AM +0200, Benjamin Tissoires wrote: > On Jun 09 2017 or thereabouts, Roderick Colenbrander wrote: > > From: Roderick Colenbrander <roderick.colenbrander@sony.com> > > > > Gamepads like DualShock 3 / 4 as of 4.12 started reporting motion > > sensors on a separate evdev node. Joydev is picking these devices > > up as well, but they don't make sense for the joydev interface. > > > > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> > > --- > > Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> Hmm, I think you can quite often use accelerometer as a joystick, it is only the composite devices that we want to ignore I think. > > Cheers, > Benjamin > > > drivers/input/joydev.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c > > index 29d677c..a5ceaaf 100644 > > --- a/drivers/input/joydev.c > > +++ b/drivers/input/joydev.c > > @@ -819,6 +819,10 @@ static bool joydev_match(struct input_handler *handler, struct input_dev *dev) > > if (joydev_dev_is_absolute_mouse(dev)) > > return false; > > > > + /* Avoid accelerometers */ > > + if (test_bit(INPUT_PROP_ACCELEROMETER, dev->propbit)) > > + return false; > > + > > return true; > > } > > > > -- > > 2.9.3 > > -- Dmitry ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: joydev - ignore accelerometer devices 2017-06-20 2:57 ` Dmitry Torokhov @ 2017-06-20 16:58 ` Roderick Colenbrander 2017-07-11 0:42 ` Roderick Colenbrander 0 siblings, 1 reply; 6+ messages in thread From: Roderick Colenbrander @ 2017-06-20 16:58 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: Benjamin Tissoires, linux-input, Roderick Colenbrander On Mon, Jun 19, 2017 at 7:57 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote: > On Mon, Jun 12, 2017 at 09:09:53AM +0200, Benjamin Tissoires wrote: >> On Jun 09 2017 or thereabouts, Roderick Colenbrander wrote: >> > From: Roderick Colenbrander <roderick.colenbrander@sony.com> >> > >> > Gamepads like DualShock 3 / 4 as of 4.12 started reporting motion >> > sensors on a separate evdev node. Joydev is picking these devices >> > up as well, but they don't make sense for the joydev interface. >> > >> > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> >> > --- >> >> Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> > > Hmm, I think you can quite often use accelerometer as a joystick, it is > only the composite devices that we want to ignore I think. > Correct the issue came up for composite devices. So far the input_prop_accelerometer flag is only used in a handful of drivers (udraw, wacom and sony). They don't have any buttons on the motion devices. The wii driver doesn't set any the acceleration flag yet, but may mix acceleration sensors, buttons and sticks. At least currently it does for nunchuck and questionably uses ABS_HAT0X/0Y instead of 'ABS_X/_Y' for an analog stick, maybe not to get picked up by joydev, the same device reports acceleration through ABS_RX/_RY_RZ. Personally I had the feeling that motion sensors may not be in the spirit of the classic joydev interface in part, because it is difficult to figure out what axes of which type. If you think it is okay to support them through here, I don't mind finding another way at least for composite devices to not get these registered. I'm not fully sure how we can figure out something is a composite device from joydev in an easy way. Any suggestions? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: joydev - ignore accelerometer devices 2017-06-20 16:58 ` Roderick Colenbrander @ 2017-07-11 0:42 ` Roderick Colenbrander 0 siblings, 0 replies; 6+ messages in thread From: Roderick Colenbrander @ 2017-07-11 0:42 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: Benjamin Tissoires, linux-input, Roderick Colenbrander On Tue, Jun 20, 2017 at 9:58 AM, Roderick Colenbrander <roderick@gaikai.com> wrote: > On Mon, Jun 19, 2017 at 7:57 PM, Dmitry Torokhov > <dmitry.torokhov@gmail.com> wrote: >> On Mon, Jun 12, 2017 at 09:09:53AM +0200, Benjamin Tissoires wrote: >>> On Jun 09 2017 or thereabouts, Roderick Colenbrander wrote: >>> > From: Roderick Colenbrander <roderick.colenbrander@sony.com> >>> > >>> > Gamepads like DualShock 3 / 4 as of 4.12 started reporting motion >>> > sensors on a separate evdev node. Joydev is picking these devices >>> > up as well, but they don't make sense for the joydev interface. >>> > >>> > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> >>> > --- >>> >>> Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> >> >> Hmm, I think you can quite often use accelerometer as a joystick, it is >> only the composite devices that we want to ignore I think. >> > > Correct the issue came up for composite devices. So far the > input_prop_accelerometer flag is only used in a handful of drivers > (udraw, wacom and sony). They don't have any buttons on the motion > devices. > > The wii driver doesn't set any the acceleration flag yet, but may mix > acceleration sensors, buttons and sticks. At least currently it does > for nunchuck and questionably uses ABS_HAT0X/0Y instead of 'ABS_X/_Y' > for an analog stick, maybe not to get picked up by joydev, the same > device reports acceleration through ABS_RX/_RY_RZ. > > Personally I had the feeling that motion sensors may not be in the > spirit of the classic joydev interface in part, because it is > difficult to figure out what axes of which type. If you think it is > okay to support them through here, I don't mind finding another way at > least for composite devices to not get these registered. I'm not fully > sure how we can figure out something is a composite device from joydev > in an easy way. Any suggestions? I have been trying to see how this could be handed. Considering we can't easily look up other devices (and we are still in the process of device initialization), the best I could think of is maybe adding more flags to devices. Maybe introduce a new flag to mark something as a composite device e.g. 'INPUT_PROP_COMPOSITE'. The logic could then be to filter out composite devices with accelerometers. In addition such a flag could also be a nice hint to user space that a device is a composite device. Another option if no new flags are desired, could be a check which checks if the device has accelerometers, but no other axes or keys. Something along these lines is a bit messier. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-07-11 0:42 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-06-09 20:35 [PATCH] Input: joydev fixes for 4.12 Roderick Colenbrander 2017-06-09 20:35 ` [PATCH] Input: joydev - ignore accelerometer devices Roderick Colenbrander 2017-06-12 7:09 ` Benjamin Tissoires 2017-06-20 2:57 ` Dmitry Torokhov 2017-06-20 16:58 ` Roderick Colenbrander 2017-07-11 0:42 ` Roderick Colenbrander
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).