Re: [PATCH] Input: joydev - ignore accelerometer devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 20, 2017 at 9:58 AM, Roderick Colenbrander
<roderick@xxxxxxxxxx> wrote:
> On Mon, Jun 19, 2017 at 7:57 PM, Dmitry Torokhov
> <dmitry.torokhov@xxxxxxxxx> 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@xxxxxxxx>
>>> >
>>> > 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@xxxxxxxx>
>>> > ---
>>>
>>> Acked-By: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
>>
>> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux