platform/surface: aggregator_cdev: Add support for forwarding events to user-space
authorMaximilian Luz <luzmaximilian@gmail.com>
Fri, 4 Jun 2021 13:47:52 +0000 (15:47 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 16 Jun 2021 15:47:53 +0000 (17:47 +0200)
commit776c53c6a448905d8b9b161805b67f82301bfe91
tree6e20b63dfca5d775745e8beb31e7a9d89a3a5a81
parentb2763358feb28590f6b52a4c95c94a645dadfb26
platform/surface: aggregator_cdev: Add support for forwarding events to user-space

Currently, debugging unknown events requires writing a custom driver.
This is somewhat difficult, slow to adapt, and not entirely
user-friendly for quickly trying to figure out things on devices of some
third-party user. We can do better. We already have a user-space
interface intended for debugging SAM EC requests, so let's add support
for receiving events to that.

This commit provides support for receiving events by reading from the
controller file. It additionally introduces two new IOCTLs to control
which event categories will be forwarded. Specifically, a user-space
client can specify which target categories it wants to receive events
from by registering the corresponding notifier(s) via the IOCTLs and
after that, read the received events by reading from the controller
device.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210604134755.535590-5-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Documentation/userspace-api/ioctl/ioctl-number.rst
drivers/platform/surface/surface_aggregator_cdev.c
include/uapi/linux/surface_aggregator/cdev.h