[PATCH 0/2] iio: light: add support for veml6031x00 ALS series

Javier Carrasco
2024-11-26T21:52:12Z

These ambient light sensors with I2C interface provide two light
channels (ALS and IR), high/low threshold alarms with configurable
persistence, and a data ready signal.

The devices covered by this driver have the same resolution and they
share most of their functionality. These are the differences between
them:

- Device ID: accessible via two 8-byte registers, different values for
veml6031x00/veml6031x01 and veml60311x00/veml60311x01.
- I2C address: same grouping, 0x29 and 0x10 I2C addresses.
- AEC qualification: AEC-Q100 for veml6031x00/veml60311x00 and
AEC-Q101 for veml6031x01/veml60311x01.

The alarms and the data ready signals share the interrupt pin, and an
interrupt status register must be accessed to identify the source. Such
multiplexing is not new in IIO, and I have followed existing examples
for it. The persistence setting (own attribute) to trigger the alarms
uses the pattern that has already been used for the veml6030.

The device configuration is in general documented in the datasheet and
the application note. There is an exception, though: the activation of
the "active force" mode that is required for the data ready signal must
be carried out in two steps even though the affected bits are located in
the same register: first ALS_AF (active force mode enable) must be set,
and then ALS_TRIG (active force trigger setting) must be enabled. I have
added a brief commentary in the code to explain this behavior, which has
been confirmed by the manufacturer.

This driver has been tested with the four supported devices separately
as well as in pairs where the I2C addresses don't overlap.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
Javier Carrasco (2):
dt-bindings: iio: light: veml6030: add veml6031x00 ALS series
iio: light: add support for veml6031x00 ALS series

.../bindings/iio/light/vishay,veml6030.yaml | 23 +-
MAINTAINERS | 6 +
drivers/iio/light/Kconfig | 13 +
drivers/iio/light/Makefile | 1 +
drivers/iio/light/veml6031x00.c | 1129 ++++++++++++++++++++
5 files changed, 1171 insertions(+), 1 deletion(-)
---
base-commit: a61ff7eac77e86de828fe28c4e42b8ae9ec2b195
change-id: 20241109-veml6031x00-aa9463da064a

Best regards,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>