Skip to contentSkip to conversation

IIO channel type and modifiers for CCT and RGBC data

PATCH In review Jon Brenner 5 participants 8 messages May 16, 2012 – Jul 10, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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 to documentation.

Changes:
Revised/condensed RGBC descriptions.

---
 drivers/iio/industrialio-core.c                    |    5 ++++
 .../staging/iio/Documentation/sysfs-bus-iio-light  |   23 ++++++++++++++++++++
 include/linux/iio/types.h                          |    5 ++++
 3 files changed, 33 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 +23 -0
index 715c74d..83a2876 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,17 @@ Contact:	[email protected]
 Description:
 		This property gets/sets the table of coefficients
 		used in calculating illuminance in lux.
+
+What:		/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_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 (irradiance, uW/mm), then it should
+		include _raw.
+
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

Acked-by on v2 1/1
#1 lore raw
Quoted 9 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 to documentation.

Changes:
Revised/condensed RGBC descriptions.

Quoted 101 lines

---
drivers/iio/industrialio-core.c | 5 ++++
.../staging/iio/Documentation/sysfs-bus-iio-light | 23
++++++++++++++++++++
include/linux/iio/types.h | 5 ++++

3 files changed, 33 insertions(+), 0 deletions(-)
drivers/iio/industrialio-core.c +1 -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[] = {

drivers/iio/industrialio-core.c +4 -0
@@ -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..83a2876 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]

drivers/staging/iio/Documentation/sysfs-bus-iio-light +0 -0
@@ -82,3 +91,17 @@ 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 +14 -0
+
+What:		/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_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 (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

Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
#2 lore raw
In reply to Jon Brenner
Quoted 6 lines

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

drivers/staging/iio/Documentation/sysfs-bus-iio-light +2 -0
+What:		/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw]

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

Quoted 10 lines
drivers/staging/iio/Documentation/sysfs-bus-iio-light +10 -0
+What:		/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_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 (irradiance, uW/mm), then it should
+		include _raw.

should the irradiance unit be uW/mm^2 ??

p.

Signature · 2 lines
Peter Meerwald
+43-664-2444418 (mobile)
#3 lore raw
Quoted 4 lines · Peter Meerwald
Quoted 3 lines

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

Quoted 14 lines

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

Quoted 12 lines
drivers/staging/iio/Documentation/sysfs-bus-iio-light +12 -0
+What:		/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw]
+What:		/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_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 (irradiance, uW/mm), then it should
+		include _raw.

should the irradiance unit be uW/mm^2 ??

or just W/m^2? Whichever people prefer! Good spot Peter.

maintainer
#4 lore raw

Jon,

Peter raised the question below about this.

Now we have two varients of this patch. As it was original yours Jon, could you rustle up a new version incorporating Peter's one and if both of you sign off / ack it, I'll merge it.

Jonathan

Quoted 30 lines · Peter Meerwald
Quoted 15 lines
Quoted 15 lines

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

+What:
/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw] +What:
/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw] +What:
/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_raw] +What:
/sys/bus/iio/devices/device[n]/in_intensity_blue[_input|_raw]

(quoted diff) +2 -0
+KernelVersion:    3.4.0
+Contact:    [email protected]
Quoted 8 lines

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

Quoted 6 lines
drivers/staging/iio/Documentation/sysfs-bus-iio-light +6 -0
+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 (irradiance, uW/mm), then it should
+        include _raw.

should the irradiance unit be uW/mm^2 ??

or just W/m^2? Whichever people prefer! Good spot Peter.

--
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

maintainer
#5 lore raw
Quoted 7 lines · Jonathan Cameron

Jon,

Peter raised the question below about this.

Now we have two varients of this patch. As it was original yours Jon, could you rustle up a new version incorporating Peter's one and if both of you sign off / ack it, I'll merge it.

At Jon's request I've made the minor change below and done the merge with the current tree. Could people take a look to make sure I haven't messed it up (was a little fiddly due to changing context).

I'll send out the pull if no one shouts. It's getting vaguely near the end of this cycle...

Jonathan

Quoted 34 lines

Jonathan

Quoted 30 lines · Peter Meerwald
Quoted 15 lines
Quoted 15 lines

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

+What:
/sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw] +What:
/sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw] +What:
/sys/bus/iio/devices/device[n]/in_intensity_green[_input|_raw] +What:
/sys/bus/iio/devices/device[n]/in_intensity_blue[_input|_raw]

(quoted diff) +2 -0
+KernelVersion:    3.4.0
+Contact:    [email protected]
Quoted 8 lines

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

Quoted 6 lines
drivers/staging/iio/Documentation/sysfs-bus-iio-light +6 -0
+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 (irradiance, uW/mm), then it should
+        include _raw.

should the irradiance unit be uW/mm^2 ??

or just W/m^2? Whichever people prefer! Good spot Peter.

Signature · 3 lines
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
#6 lore raw
Quoted 3 lines

I'll send out the pull if no one shouts. It's getting vaguely near the end of this cycle...

I'm happy this got merged finally

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+KernelVersion:    3.4.0
+Contact:    [email protected]

should be 3.6?

regards, p.

Signature · 2 lines
Peter Meerwald
+43-664-2444418 (mobile)
#7 lore raw
Quoted 7 lines · Peter Meerwald
Quoted 2 lines

I'll send out the pull if no one shouts. It's getting vaguely near the end of this cycle...

I'm happy this got merged finally

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+KernelVersion:    3.4.0
+Contact:    [email protected]

should be 3.6?

Good spot. I'll do a trivial fixup patch to follow it. Will add a reported-by.

Quoted 3 lines

regards, p.