iio: Add channel type light color temperature
authorBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Tue, 19 Sep 2023 08:10:47 +0000 (13:40 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 24 Sep 2023 12:22:52 +0000 (13:22 +0100)
In most cases, ambient color sensors also support light color
temperature, which is measured in kelvin. Thus, add channel type light
color temperature.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Link: https://lore.kernel.org/r/20230919081054.2050714-3-Basavaraj.Natikar@amd.com
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 a2854dc9a839319984426ff7a0401021156424f7..4cf7ed9ca57b403cdb23f0f166e020d3ab5ae266 100644 (file)
@@ -2179,3 +2179,10 @@ Contact: linux-iio@vger.kernel.org
 Description:
                Number of conditions that must occur, during a running
                period, before an event is generated.
+
+What:          /sys/bus/iio/devices/iio:deviceX/in_colortemp_raw
+KernelVersion: 6.7
+Contact:       linux-iio@vger.kernel.org
+Description:
+               Represents light color temperature, which measures light color
+               temperature in Kelvin.
index d752e9c0499b964e3e2edee7ef36e10bb7aaa5c9..cba942cadf972a651b36427acd800138e3691db0 100644 (file)
@@ -90,6 +90,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_POSITIONRELATIVE]  = "positionrelative",
        [IIO_PHASE] = "phase",
        [IIO_MASSCONCENTRATION] = "massconcentration",
+       [IIO_COLORTEMP] = "colortemp",
 };
 
 static const char * const iio_modifier_names[] = {
index c79f2f046a0be1c6d71a0bcb9e6378b8bce04b3c..08c20e540c137ebb798a87b79937b555082afe62 100644 (file)
@@ -47,6 +47,7 @@ enum iio_chan_type {
        IIO_POSITIONRELATIVE,
        IIO_PHASE,
        IIO_MASSCONCENTRATION,
+       IIO_COLORTEMP,
 };
 
 enum iio_modifier {
index 0a5c2bb60030b93b7c67f2afbf87dde2139ac7c3..a63741e43ddf9ed3b2c2b939b7185a25c69c9ef8 100644 (file)
@@ -59,6 +59,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_POSITIONRELATIVE] = "positionrelative",
        [IIO_PHASE] = "phase",
        [IIO_MASSCONCENTRATION] = "massconcentration",
+       [IIO_COLORTEMP] = "colortemp",
 };
 
 static const char * const iio_ev_type_text[] = {
@@ -173,6 +174,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_POSITIONRELATIVE:
        case IIO_PHASE:
        case IIO_MASSCONCENTRATION:
+       case IIO_COLORTEMP:
                break;
        default:
                return false;