[systemd-devel] [PATCH] udev: input_id: tag accelerometers as ID_INPUT_ACCELEROMETER

Peter Hutterer peter.hutterer at who-t.net
Mon Apr 6 18:47:16 PDT 2015


On Sat, Apr 04, 2015 at 02:07:27PM +0200, David Herrmann wrote:
> Hi
> 
> On Fri, Apr 3, 2015 at 8:55 PM, Hans de Goede <hdegoede at redhat.com> wrote:
> [...]
> >> I don't think we should return when we see INPUT_PROP_ACCEL. If a
> >> keyboard embeds an accelerometer, we will miss it. I think I went too
> >> deep in detail for Wacoms/tablets devices and it confused you. Those
> >> don't need much processing in udev, we can mostly control everything
> >> out the tree.
> >
> >
> > Ok, I'll respin my patch to not have the return then.
> 
> What's the plan? Use INPUT_PROP_ACCEL as "negative check" (necessary
> negative condition) for touchpads and mice? And as fallback hint for
> accelerometer if nothing else matched?

no, Benjamin's concern is a misinterpretation of the return statement.
Hans' patch as it is will still label keyboards but that's elsewhere and
thus outside of the patch context. So Hans' patch is correct, I've pushed
it now (minus the s-o-b tag, bd1acc9f2).

Short summary for the archives:
If the property INPUT_PROP_ACCELEROMETER is set, any x/y/z axes must be
accelerometer data. Other axes are unaffected, the device may have
other EV_foo bits which are also unaffected.

If we know that the x/y axes are accelerometers we know the device isn't a
touchpad, mouse, pointing stick or touchscreen. And those are the only other
devices input_id cares about, so once we see the accelerometer property we
can skip any other pointer-related tests.

Cheers,
   Peter


More information about the systemd-devel mailing list