Input: introduce notion of passive observers for input handlers
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 23 Oct 2024 18:45:24 +0000 (11:45 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 5 Nov 2024 22:19:47 +0000 (14:19 -0800)
commit57a063632df8db6cb20d64ee52a06d4e2049235a
treeae74cbeb02110a4a884b83f6b1b90b95e283ec4b
parent6b6b40ff05ab43b603abd7ae1821892307421d49
Input: introduce notion of passive observers for input handlers

Sometimes it is useful to observe (and maybe modify) data coming from
an input device, but only do that if there are other users of such input
device. An example is touchpad switching functionality on Lenovo IdeaPad
Z570 where it is desirable to suppress events coming from the touchpad
if user toggles touchpad on/off button (on this laptop the firmware does
not stop the device).

Introduce notion of passive observers for input handlers to solve this
issue. An input handler marked as passive observer behaves exactly like
any other input handler or filter, but with one exception: it does not
open/start underlying input device when attaching to it.

Link: https://lore.kernel.org/r/ZxlEROX7bMo5cbZP@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input.c
include/linux/input.h