Commit 42f31175 authored by Basavaraj Natikar's avatar Basavaraj Natikar Committed by Jonathan Cameron
Browse files

iio: Add channel type light color temperature



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: default avatarBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Link: https://lore.kernel.org/r/20230919081054.2050714-3-Basavaraj.Natikar@amd.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 286d528b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -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[] = {
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ enum iio_chan_type {
	IIO_POSITIONRELATIVE,
	IIO_PHASE,
	IIO_MASSCONCENTRATION,
	IIO_COLORTEMP,
};

enum iio_modifier {
+2 −0
Original line number Diff line number Diff line
@@ -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;