Input: uinput - add new UINPUT_DEV_SETUP and UI_ABS_SETUP ioctl
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Sat, 19 Dec 2015 01:20:09 +0000 (17:20 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 19 Dec 2015 01:48:50 +0000 (17:48 -0800)
commit052876f8e5aec887d22c4d06e54aa5531ffcec75
tree4327b502de0d11288b69a48fbf4a4e529949a6e0
parentf01c5e652ca949722a7fe4cfdecd73e8026971d2
Input: uinput - add new UINPUT_DEV_SETUP and UI_ABS_SETUP ioctl

This adds two new ioctls, UINPUT_DEV_SETUP and UI_ABS_SETUP, that replaces
the old device setup method (by write()'ing "struct uinput_user_dev" to the
node). The old method is not easily extendable and requires huge payloads.
Furthermore, overloading write() without properly versioned objects is
error-prone.

Therefore, we introduce two new ioctls to replace the old method.  These
ioctls support all features of the old method, plus a "resolution" field
for absinfo. Furthermore, it's properly forward-compatible to new ABS codes
and a growing "struct input_absinfo" structure.

UI_ABS_SETUP also allows user-space to skip unknown axes if not set.  There
is no need to copy the whole array temporarily into the kernel, but instead
the caller issues several ioctl where we copy each value manually.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/uinput.c
include/linux/uinput.h
include/uapi/linux/uinput.h