iio: bu27008: Add illuminance channel
authorMatti Vaittinen <mazziesaccount@gmail.com>
Fri, 20 Oct 2023 10:53:47 +0000 (13:53 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 16 Nov 2023 19:10:27 +0000 (19:10 +0000)
commita6d160b21fe6f9e3ac868ab1d79194d3e7977cd5
treee824af0ac9234a307d13d908beafefbf641d114f
parenta2d43f44628fe4fa9c17f0e09548cb385e772f7e
iio: bu27008: Add illuminance channel

The RGB + IR data can be used to calculate the illuminance value (luxes).
Implement the equation obtained from the ROHM HW colleagues and add a
raw light data channel outputting illuminance values in (nano) Luxes.

Both the read_raw and buffering values are supported, with the limitation
that buffering is only allowed when a suitable scan-mask is used. (RGB+IR,
no clear).

The equation has been developed by ROHM HW colleagues for open air sensor.
Adding any lens to the sensor is likely to impact to used c1, c2, c3
coefficients. Also, the output values have only been tested on BU27008.

According to the HW colleagues, the very same equation should work on
BU27010 as well.

Calculate and output illuminance values from BU27008 and BU27010.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/ZTJcOxSb/WHzdN8h@dc78bmyyyyyyyyyyyyydt-3.rev.dnainternet.fi
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/rohm-bu27008.c