[PATCH 0/2] Support for Texas Instruments OPT4001 Ambient Light Sensor

From: Stefan Windfeldt-Prytz
Date: Tue Apr 04 2023 - 05:08:29 EST


This series adds support for Texas Instruments OPT4001 Ambient light sensor.

The light sensor has a i2c interface and supports continuous, oneshot and
interruptdriven measurements and has configurable conversion time and range.

This driver uses the sensors continuous mode so it always has a updated light
value available. The conversion time which is
(integration time + time to set registers) which is used to configure
integration time through sysfs. The chip also has a configurable light
range which this driver sets to Auto where the chip chooses range itself
depending on previously read values.

Since the OPT4001 has different constants used to calculate lux values
depeding on packaging of the chip but uses the same device id, two compatible
string are used depending on the packaging, these are "ti,opt4001-picostar"
and "ti,opt4001-sot-5x3".

Signed-off-by: Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@xxxxxxxx>
---
Stefan Windfeldt-Prytz (2):
dt-bindings: Document TI OPT4001 light sensor bindings
iio: light: Add support for TI OPT4001 light sensor

.../devicetree/bindings/iio/light/ti,opt4001.yaml | 42 ++
drivers/iio/light/Kconfig | 11 +
drivers/iio/light/Makefile | 1 +
drivers/iio/light/opt4001.c | 487 +++++++++++++++++++++
4 files changed, 541 insertions(+)
---
base-commit: 60c5238813fdfbe167eb579d58172106916b8db0
change-id: 20230323-add-opt4001-driver-99b9aad69319

Best regards,
--
Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@xxxxxxxx>