iio: Add channel type for chromaticity
authorBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Tue, 19 Sep 2023 08:10:51 +0000 (13:40 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 24 Sep 2023 12:31:31 +0000 (13:31 +0100)
In most cases, ambient color sensors also support the x and y light
colors, which represent the coordinates on the CIE 1931 chromaticity
diagram. Thus, add channel type for chromaticity.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Link: https://lore.kernel.org/r/20230919081054.2050714-7-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 4cf7ed9ca57b403cdb23f0f166e020d3ab5ae266..0c9389ad3709d02dbf867033b33f67014a71f69a 100644 (file)
@@ -2186,3 +2186,11 @@ Contact: linux-iio@vger.kernel.org
 Description:
                Represents light color temperature, which measures light color
                temperature in Kelvin.
+
+What:          /sys/bus/iio/devices/iio:deviceX/in_chromaticity_x_raw
+What:          /sys/bus/iio/devices/iio:deviceX/in_chromaticity_y_raw
+KernelVersion: 6.7
+Contact:       linux-iio@vger.kernel.org
+Description:
+               The x and y light color coordinate on the CIE 1931 chromaticity
+               diagram.
index cba942cadf972a651b36427acd800138e3691db0..6dc4d2b296bba5350343d127c2674c70834bf59a 100644 (file)
@@ -91,6 +91,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_PHASE] = "phase",
        [IIO_MASSCONCENTRATION] = "massconcentration",
        [IIO_COLORTEMP] = "colortemp",
+       [IIO_CHROMATICITY] = "chromaticity",
 };
 
 static const char * const iio_modifier_names[] = {
index 08c20e540c137ebb798a87b79937b555082afe62..4832c611c027f783a5de88c36243e075157262d8 100644 (file)
@@ -48,6 +48,7 @@ enum iio_chan_type {
        IIO_PHASE,
        IIO_MASSCONCENTRATION,
        IIO_COLORTEMP,
+       IIO_CHROMATICITY,
 };
 
 enum iio_modifier {
index a63741e43ddf9ed3b2c2b939b7185a25c69c9ef8..a28a86f2bd5b358017f998d02ab3ab9d1293d56e 100644 (file)
@@ -60,6 +60,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_PHASE] = "phase",
        [IIO_MASSCONCENTRATION] = "massconcentration",
        [IIO_COLORTEMP] = "colortemp",
+       [IIO_CHROMATICITY] = "chromaticity",
 };
 
 static const char * const iio_ev_type_text[] = {
@@ -175,6 +176,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_PHASE:
        case IIO_MASSCONCENTRATION:
        case IIO_COLORTEMP:
+       case IIO_CHROMATICITY:
                break;
        default:
                return false;