]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitccb2d4c8057de553d92a8a6ecd17d1e228b18d96
tree4327b502de0d11288b69a48fbf4a4e529949a6e0
parent4f462433354f55a1660f5242f933364abcac8b68
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