iio: Add channel type for attention
authorRicardo Ribalda <ribalda@chromium.org>
Fri, 1 Nov 2024 07:46:29 +0000 (07:46 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 3 Nov 2024 20:33:43 +0000 (20:33 +0000)
Add a new channel type representing if the user's attention state to the
the system. This usually means if the user is looking at the screen or
not.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20241101-hpd-v3-3-e9c80b7c7164@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Documentation/ABI/testing/sysfs-bus-iio
drivers/iio/industrialio-core.c
include/uapi/linux/iio/types.h
tools/iio/iio_event_monitor.c

index 9641dd2..f83bd68 100644 (file)
@@ -2363,3 +2363,11 @@ KernelVersion:   6.10
 Contact:       linux-iio@vger.kernel.org
 Description:
                The value of current sense resistor in Ohms.
+
+What:          /sys/.../iio:deviceX/in_attention_input
+KernelVersion: 6.13
+Contact:       linux-iio@vger.kernel.org
+Description:
+               Value representing the user's attention to the system expressed
+               in units as percentage. This usually means if the user is
+               looking at the screen or not.
index 4c54349..a2117ad 100644 (file)
@@ -95,6 +95,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_DELTA_VELOCITY] = "deltavelocity",
        [IIO_COLORTEMP] = "colortemp",
        [IIO_CHROMATICITY] = "chromaticity",
+       [IIO_ATTENTION] = "attention",
 };
 
 static const char * const iio_modifier_names[] = {
index f2e0b2d..12886d4 100644 (file)
@@ -51,6 +51,7 @@ enum iio_chan_type {
        IIO_DELTA_VELOCITY,
        IIO_COLORTEMP,
        IIO_CHROMATICITY,
+       IIO_ATTENTION,
 };
 
 enum iio_modifier {
index d0b8e48..cccf62e 100644 (file)
@@ -63,6 +63,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_DELTA_VELOCITY] = "deltavelocity",
        [IIO_COLORTEMP] = "colortemp",
        [IIO_CHROMATICITY] = "chromaticity",
+       [IIO_ATTENTION] = "attention",
 };
 
 static const char * const iio_ev_type_text[] = {
@@ -183,6 +184,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_DELTA_VELOCITY:
        case IIO_COLORTEMP:
        case IIO_CHROMATICITY:
+       case IIO_ATTENTION:
                break;
        default:
                return false;