Skip to contentSkip to conversation

IIO channel type and modifiers for CCT and RGBC data

PATCH Superseded Jon Brenner 2 participants 2 messages May 15, 2012 – May 16, 2012

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IIO channel type and modifiers for CCT and RGBC data

Add iio channel type and modifiers for Correlated Color Temperature (CCT) and RGBC (red/green/blue/clear) data.
Add CCT and RGBC descriptions in documentation.

---
 drivers/iio/industrialio-core.c                    |    5 ++
 .../staging/iio/Documentation/sysfs-bus-iio-light  |   50 ++++++++++++++++++++
 include/linux/iio/types.h                          |    5 ++
 3 files changed, 60 insertions(+), 0 deletions(-)
drivers/iio/industrialio-core.c +5 -0
index 1ddd886..34d8cc9 100644
@@ -64,6 +64,7 @@ static const char * const iio_chan_type_name_spec[] = {
 	[IIO_TIMESTAMP] = "timestamp",
 	[IIO_CAPACITANCE] = "capacitance",
 	[IIO_ALTVOLTAGE] = "altvoltage",
+	[IIO_CCT] = "cct",
 };
 
 static const char * const iio_modifier_names[] = {
@@ -72,6 +73,10 @@ static const char * const iio_modifier_names[] = {
 	[IIO_MOD_Z] = "z",
 	[IIO_MOD_LIGHT_BOTH] = "both",
 	[IIO_MOD_LIGHT_IR] = "ir",
+	[IIO_MOD_LIGHT_CLEAR] = "clear",
+	[IIO_MOD_LIGHT_RED] = "red",
+	[IIO_MOD_LIGHT_GREEN] = "green",
+	[IIO_MOD_LIGHT_BLUE] = "blue",
 };
 
 /* relies on pairs of these shared then separate */
drivers/staging/iio/Documentation/sysfs-bus-iio-light +50 -0

59 lines not on this page · raw message

include/linux/iio/types.h +5 -0
index 1b073b1..a7de5d9 100644
@@ -28,6 +28,7 @@ enum iio_chan_type {
 	IIO_TIMESTAMP,
 	IIO_CAPACITANCE,
 	IIO_ALTVOLTAGE,
+	IIO_CCT,
 };
 
 enum iio_modifier {
@@ -45,6 +46,10 @@ enum iio_modifier {
 	IIO_MOD_X_OR_Y_OR_Z,
 	IIO_MOD_LIGHT_BOTH,
 	IIO_MOD_LIGHT_IR,
+	IIO_MOD_LIGHT_CLEAR,
+	IIO_MOD_LIGHT_RED,
+	IIO_MOD_LIGHT_GREEN,
+	IIO_MOD_LIGHT_BLUE,
 };
 
 #define IIO_VAL_INT 1

--
1.7.4.1

maintainer
#1 lore raw
Quoted 4 lines · Jon Brenner

Add iio channel type and modifiers for Correlated Color Temperature (CCT) and RGBC (red/green/blue/clear) data.
Add CCT and RGBC descriptions in documentation.

Core changes are fine. Few trivial bits in the docs.

Quoted 54 lines
---
  drivers/iio/industrialio-core.c                    |    5 ++
  .../staging/iio/Documentation/sysfs-bus-iio-light  |   50 ++++++++++++++++++++
  include/linux/iio/types.h                          |    5 ++
  3 files changed, 60 insertions(+), 0 deletions(-)
drivers/iio/industrialio-core.c +5 -0
index 1ddd886..34d8cc9 100644
@@ -64,6 +64,7 @@ static const char * const iio_chan_type_name_spec[] = {
  	[IIO_TIMESTAMP] = "timestamp",
  	[IIO_CAPACITANCE] = "capacitance",
  	[IIO_ALTVOLTAGE] = "altvoltage",
+	[IIO_CCT] = "cct",
  };
 
  static const char * const iio_modifier_names[] = {
@@ -72,6 +73,10 @@ static const char * const iio_modifier_names[] = {
  	[IIO_MOD_Z] = "z",
  	[IIO_MOD_LIGHT_BOTH] = "both",
  	[IIO_MOD_LIGHT_IR] = "ir",
+	[IIO_MOD_LIGHT_CLEAR] = "clear",
+	[IIO_MOD_LIGHT_RED] = "red",
+	[IIO_MOD_LIGHT_GREEN] = "green",
+	[IIO_MOD_LIGHT_BLUE] = "blue",
  };
 
  /* relies on pairs of these shared then separate */
drivers/staging/iio/Documentation/sysfs-bus-iio-light +9 -0
index 715c74d..f9a4145 100644
@@ -34,6 +34,15 @@ Description:
  		it comes back in SI units, it should also include _input else it
  		should include _raw to signify it is not in SI units.
 
+What:		/sys/bus/iio/devices/device[n]/in_cct0[_input|_raw]
+KernelVersion:	3.4.0
+Contact:	[email protected]
+Description:
+		This should return the correlated color temperature from the
+		light sensor. If it comes back in SI units, it should also
+		include _input else it should include _raw to signify it is not
+		in SI units.
+
  What:		/sys/.../device[n]/proximity_on_chip_ambient_infrared_supression
  KernelVersion:	2.6.37
  Contact:	[email protected]
@@ -82,3 +91,44 @@ Contact:	[email protected]
  Description:
  		This property gets/sets the table of coefficients
  		used in calculating illuminance in lux.

drivers/staging/iio/Documentation/sysfs-bus-iio-light Contact: [email protected] · line 103

Quoted 10 lines
drivers/staging/iio/Documentation/sysfs-bus-iio-light +10 -0
+
+What:		/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw]
+KernelVersion:	3.4.0
+Contact:	[email protected]
+Description:
+		This property is supported by sensors that have a RGBC
+		sensing mode. This value should be the output from a reading
+		and if expressed in SI units, should include _input. If this
+		value is not in SI units (e.g. irradiance, uW/mm), then it should
+		include _raw.

It's not an example so loose the e.g. (it's the only choice). Also units should be W/m^2. We let in a few micro units before because they match with hwmon, but lets just put this in the correct units from the start...

Almost certainly makes sense to have one help entry for the next three. Just igve it multiple What: lines

Quoted 61 lines
drivers/staging/iio/Documentation/sysfs-bus-iio-light +31 -0
+
+What:		/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw]
+KernelVersion:	3.4.0
+Contact:	[email protected]
+Description:
+		This property is supported by sensors that have a RGBC
+		sensing mode. This value should be the output from a reading
+		and if expressed in SI units, should include _input. If this
+		value is not in SI units (e.g. irradiance, uW/mm), then it should
+		include _raw.
+
+What:		/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_raw]
+KernelVersion:	3.4.0
+Contact:	[email protected]
+Description:
+		This property is supported by sensors that have a RGBC
+		sensing mode. This value should be the output from a reading
+		and if expressed in SI units, should include _input. If this
+		value is not in SI units (e.g. irradiance, uW/mm), then it should
+		include _raw.
+
+What:		/sys/bus/iio/devices/device[n]/in_intensity_blue[_input|_raw]
+KernelVersion:	3.4.0
+Contact:	[email protected]
+Description:
+		This property is supported by sensors that have a RGBC
+		sensing mode. This value should be the output from a reading
+		and if expressed in SI units, should include _input. If this
+		value is not in SI units (e.g. irradiance, uW/mm), then it should
+		include _raw.
+
include/linux/iio/types.h +5 -1
index 1b073b1..a7de5d9 100644
@@ -28,6 +28,7 @@ enum iio_chan_type {
  	IIO_TIMESTAMP,
  	IIO_CAPACITANCE,
  	IIO_ALTVOLTAGE,
+	IIO_CCT,
  };
 
  enum iio_modifier {
@@ -45,6 +46,10 @@ enum iio_modifier {
  	IIO_MOD_X_OR_Y_OR_Z,
  	IIO_MOD_LIGHT_BOTH,
  	IIO_MOD_LIGHT_IR,
+	IIO_MOD_LIGHT_CLEAR,
+	IIO_MOD_LIGHT_RED,
+	IIO_MOD_LIGHT_GREEN,
+	IIO_MOD_LIGHT_BLUE,
  };
 
  #define IIO_VAL_INT 1
--

1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html