Commit 21cd1fab058671313f7c178b640999fcd0d8de21

Authored by Jon Brenner
Committed by Jonathan Cameron
1 parent ee0312a05d

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.

Merge and trivial fix done by Jonathan Cameron.

Signed-off-by: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

Showing 3 changed files with 33 additions and 0 deletions Side-by-side Diff

drivers/iio/industrialio-core.c
... ... @@ -64,6 +64,7 @@
64 64 [IIO_TIMESTAMP] = "timestamp",
65 65 [IIO_CAPACITANCE] = "capacitance",
66 66 [IIO_ALTVOLTAGE] = "altvoltage",
  67 + [IIO_CCT] = "cct",
67 68 };
68 69  
69 70 static const char * const iio_modifier_names[] = {
... ... @@ -74,6 +75,10 @@
74 75 [IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2",
75 76 [IIO_MOD_LIGHT_BOTH] = "both",
76 77 [IIO_MOD_LIGHT_IR] = "ir",
  78 + [IIO_MOD_LIGHT_CLEAR] = "clear",
  79 + [IIO_MOD_LIGHT_RED] = "red",
  80 + [IIO_MOD_LIGHT_GREEN] = "green",
  81 + [IIO_MOD_LIGHT_BLUE] = "blue",
77 82 };
78 83  
79 84 /* relies on pairs of these shared then separate */
drivers/staging/iio/Documentation/sysfs-bus-iio-light
... ... @@ -82,4 +82,26 @@
82 82 Description:
83 83 This property gets/sets the table of coefficients
84 84 used in calculating illuminance in lux.
  85 +
  86 +What: /sys/bus/iio/devices/device[n]/in_intensity_clear[_input|_raw]
  87 +What: /sys/bus/iio/devices/device[n]/in_intensity_red[_input|_raw]
  88 +What: /sys/bus/iio/devices/device[n]/in_intensity_green[_input|_raw]
  89 +What: /sys/bus/iio/devices/device[n]/in_intensity_blue[_input|_raw]
  90 +KernelVersion: 3.4.0
  91 +Contact: linux-iio@vger.kernel.org
  92 +Description:
  93 + This property is supported by sensors that have a RGBC
  94 + sensing mode. This value should be the output from a reading
  95 + and if expressed in SI units, should include _input. If this
  96 + value is not in SI units (irradiance, uW/mm^2), then it should
  97 + include _raw.
  98 +
  99 +What: /sys/bus/iio/devices/device[n]/in_cct0[_input|_raw]
  100 +KernelVersion: 3.4.0
  101 +Contact: linux-iio@vger.kernel.org
  102 +Description:
  103 + This should return the correlated color temperature from the
  104 + light sensor. If it comes back in SI units, it should also
  105 + include _input else it should include _raw to signify it is not
  106 + in SI units.
include/linux/iio/types.h
... ... @@ -27,6 +27,7 @@
27 27 IIO_TIMESTAMP,
28 28 IIO_CAPACITANCE,
29 29 IIO_ALTVOLTAGE,
  30 + IIO_CCT,
30 31 };
31 32  
32 33 enum iio_modifier {
... ... @@ -46,6 +47,10 @@
46 47 IIO_MOD_LIGHT_IR,
47 48 IIO_MOD_ROOT_SUM_SQUARED_X_Y,
48 49 IIO_MOD_SUM_SQUARED_X_Y_Z,
  50 + IIO_MOD_LIGHT_CLEAR,
  51 + IIO_MOD_LIGHT_RED,
  52 + IIO_MOD_LIGHT_GREEN,
  53 + IIO_MOD_LIGHT_BLUE,
49 54 };
50 55  
51 56 #define IIO_VAL_INT 1