Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TCS3472 and VEML6040 sensor support (and a few others) #6448

Open
wants to merge 7 commits into
base: rpi-6.6.y
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Documentation/ABI/testing/sysfs-bus-iio
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,8 @@ What: /sys/.../iio:deviceX/in_intensityY_raw
What: /sys/.../iio:deviceX/in_intensityY_ir_raw
What: /sys/.../iio:deviceX/in_intensityY_both_raw
What: /sys/.../iio:deviceX/in_intensityY_uv_raw
What: /sys/.../iio:deviceX/in_intensityY_uva_raw
What: /sys/.../iio:deviceX/in_intensityY_uvb_raw
What: /sys/.../iio:deviceX/in_intensityY_duv_raw
KernelVersion: 3.4
Contact: [email protected]
Expand All @@ -1537,8 +1539,9 @@ Description:
that measurements contain visible and infrared light
components or just infrared light, respectively. Modifier
uv indicates that measurements contain ultraviolet light
components. Modifier duv indicates that measurements
contain deep ultraviolet light components.
components. Modifiers uva, uvb and duv indicate that
measurements contain A, B or deep (C) ultraviolet light
components respectively.

What: /sys/.../iio:deviceX/in_uvindex_input
KernelVersion: 4.6
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -23054,6 +23054,12 @@ S: Maintained
F: drivers/input/serio/userio.c
F: include/uapi/linux/userio.h

VISHAY VEML6075 UVA AND UVB LIGHT SENSOR DRIVER
M: Javier Carrasco <[email protected]>
S: Maintained
F: Documentation/devicetree/bindings/iio/light/vishay,veml6075.yaml
F: drivers/iio/light/veml6075.c

VISL VIRTUAL STATELESS DECODER DRIVER
M: Daniel Almeida <[email protected]>
L: [email protected]
Expand Down
14 changes: 14 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -2386,6 +2386,8 @@ Params: addr Set the address for the ADT7410, BH1750, BME280,
aht10 Select the Aosong AHT10 temperature and humidity
sensor

as73211 Select the AMS AS73211 XYZ true color sensor

bh1750 Select the Rohm BH1750 ambient light sensor
Valid addresses 0x23 or 0x5c, default 0x23

Expand Down Expand Up @@ -2421,6 +2423,9 @@ Params: addr Set the address for the ADT7410, BH1750, BME280,
hdc100x Select the Texas Instruments HDC100x temp sensor
Valid addresses 0x40-0x43, default 0x40

hts221 Select the HTS221 temperature and humidity
sensor

htu21 Select the HTU21 temperature and humidity sensor

ina238 Select the TI INA238 power monitor. Valid
Expand Down Expand Up @@ -2510,15 +2515,24 @@ Params: addr Set the address for the ADT7410, BH1750, BME280,
sgp30 Select the Sensirion SGP30 VOC sensor.
Fixed address 0x58.

tcs3472 Select the AMS TAOS TCS3472 family of RGBW light
sensors.
Valid addresses 0x48-0x4b, default 0x48 XXX

tmp102 Select the Texas Instruments TMP102 temp sensor
Valid addresses 0x48-0x4b, default 0x48

tsl4531 Select the AMS TSL4531 digital ambient light
sensor

veml6040 Select the Vishay VEML6040 RGBW light sensor

veml6070 Select the Vishay VEML6070 ultraviolet light
sensor

veml6075 Select the Vishay VEML6075 UVA and UVB light
sensor


Name: i2c0
Info: Change i2c0 pin usage. Not all pin combinations are usable on all
Expand Down
94 changes: 93 additions & 1 deletion arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Definitions for I2C based sensors using the Industrial IO or HWMON interface.
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
compatible = "brcm,bcm2835";
Expand Down Expand Up @@ -562,6 +563,89 @@
};
};

fragment@37 {
target = <&i2cbus>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

hts221: hts221@5f {
compatible = "st,hts221-humid", "st,hts221";
reg = <0x5f>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};

fragment@38 {
target = <&i2cbus>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

veml6075: veml6075@10 {
compatible = "vishay,veml6075";
reg = <0x10>;
};
};
};

fragment@39 {
target = <&i2cbus>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

as73211: as73211@74 {
compatible = "ams,as73211";
reg = <0x74>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};

fragment@40 {
target = <&i2cbus>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

tcs3472: tcs3472@29 {
compatible = "amstaos,tcs3472";
reg = <0x29>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};

fragment@41 {
target = <&i2cbus>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

veml6040: veml6040@10 {
compatible = "vishay,veml6040";
reg = <0x10>;
status = "okay";
};
};
};

fragment@99 {
target = <&gpio>;
__dormant__ {
Expand Down Expand Up @@ -611,6 +695,11 @@
adt7410 = <0>,"+34";
ina238 = <0>,"+35";
shtc3 = <0>,"+36";
hts221 = <0>,"+37+99";
veml6075 = <0>,"+38";
as73211 = <0>,"+39+99";
tcs3472 = <0>,"+40+99";
veml6040 = <0>,"+41";

addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0",
<&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0",
Expand All @@ -625,7 +714,10 @@
<&int_pins>, "reg:0",
<&max30102>, "interrupts:0",
<&mpu6050>, "interrupts:0",
<&mpu9250>, "interrupts:0";
<&mpu9250>, "interrupts:0",
<&hts221>, "interrupts:0",
<&as73211>, "interrupts:0",
<&tcs3472>, "interrupts:0";
no_timeout = <&jc42>, "smbus-timeout-disable?";
reset_pin = <&bno055>,"reset-gpios:4", <0>,"+30";
shunt_resistor = <&ina238>,"shunt-resistor:0";
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1418,14 +1418,18 @@ CONFIG_SPS30_I2C=m
CONFIG_MAX30102=m
CONFIG_DHT11=m
CONFIG_HDC100X=m
CONFIG_HTS221=m
CONFIG_HTU21=m
CONFIG_SI7020=m
CONFIG_BOSCH_BNO055_I2C=m
CONFIG_INV_MPU6050_I2C=m
CONFIG_APDS9960=m
CONFIG_AS73211=m
CONFIG_BH1750=m
CONFIG_TCS3472=m
CONFIG_TSL4531=m
CONFIG_VEML6070=m
CONFIG_VEML6075=m
CONFIG_IIO_HRTIMER_TRIGGER=m
CONFIG_IIO_INTERRUPT_TRIGGER=m
CONFIG_IIO_SYSFS_TRIGGER=m
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1450,14 +1450,18 @@ CONFIG_SPS30_I2C=m
CONFIG_MAX30102=m
CONFIG_DHT11=m
CONFIG_HDC100X=m
CONFIG_HTS221=m
CONFIG_HTU21=m
CONFIG_SI7020=m
CONFIG_BOSCH_BNO055_I2C=m
CONFIG_INV_MPU6050_I2C=m
CONFIG_APDS9960=m
CONFIG_AS73211=m
CONFIG_BH1750=m
CONFIG_TCS3472=m
CONFIG_TSL4531=m
CONFIG_VEML6070=m
CONFIG_VEML6075=m
CONFIG_IIO_HRTIMER_TRIGGER=m
CONFIG_IIO_INTERRUPT_TRIGGER=m
CONFIG_IIO_SYSFS_TRIGGER=m
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1411,14 +1411,18 @@ CONFIG_SPS30_I2C=m
CONFIG_MAX30102=m
CONFIG_DHT11=m
CONFIG_HDC100X=m
CONFIG_HTS221=m
CONFIG_HTU21=m
CONFIG_SI7020=m
CONFIG_BOSCH_BNO055_I2C=m
CONFIG_INV_MPU6050_I2C=m
CONFIG_APDS9960=m
CONFIG_AS73211=m
CONFIG_BH1750=m
CONFIG_TCS3472=m
CONFIG_TSL4531=m
CONFIG_VEML6070=m
CONFIG_VEML6075=m
CONFIG_IIO_HRTIMER_TRIGGER=m
CONFIG_IIO_INTERRUPT_TRIGGER=m
CONFIG_IIO_SYSFS_TRIGGER=m
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1505,14 +1505,18 @@ CONFIG_SPS30_I2C=m
CONFIG_MAX30102=m
CONFIG_DHT11=m
CONFIG_HDC100X=m
CONFIG_HTS221=m
CONFIG_HTU21=m
CONFIG_SI7020=m
CONFIG_BOSCH_BNO055_I2C=m
CONFIG_INV_MPU6050_I2C=m
CONFIG_APDS9960=m
CONFIG_AS73211=m
CONFIG_BH1750=m
CONFIG_TCS3472=m
CONFIG_TSL4531=m
CONFIG_VEML6070=m
CONFIG_VEML6075=m
CONFIG_IIO_HRTIMER_TRIGGER=m
CONFIG_IIO_INTERRUPT_TRIGGER=m
CONFIG_IIO_SYSFS_TRIGGER=m
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1507,14 +1507,18 @@ CONFIG_SPS30_I2C=m
CONFIG_MAX30102=m
CONFIG_DHT11=m
CONFIG_HDC100X=m
CONFIG_HTS221=m
CONFIG_HTU21=m
CONFIG_SI7020=m
CONFIG_BOSCH_BNO055_I2C=m
CONFIG_INV_MPU6050_I2C=m
CONFIG_APDS9960=m
CONFIG_AS73211=m
CONFIG_BH1750=m
CONFIG_TCS3472=m
CONFIG_TSL4531=m
CONFIG_VEML6070=m
CONFIG_VEML6075=m
CONFIG_IIO_HRTIMER_TRIGGER=m
CONFIG_IIO_INTERRUPT_TRIGGER=m
CONFIG_IIO_SYSFS_TRIGGER=m
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/configs/bcmrpi3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1388,14 +1388,18 @@ CONFIG_SPS30_I2C=m
CONFIG_MAX30102=m
CONFIG_DHT11=m
CONFIG_HDC100X=m
CONFIG_HTS221=m
CONFIG_HTU21=m
CONFIG_SI7020=m
CONFIG_BOSCH_BNO055_I2C=m
CONFIG_INV_MPU6050_I2C=m
CONFIG_APDS9960=m
CONFIG_AS73211=m
CONFIG_BH1750=m
CONFIG_TCS3472=m
CONFIG_TSL4531=m
CONFIG_VEML6070=m
CONFIG_VEML6075=m
CONFIG_IIO_HRTIMER_TRIGGER=m
CONFIG_IIO_INTERRUPT_TRIGGER=m
CONFIG_IIO_SYSFS_TRIGGER=m
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ static const char * const iio_modifier_names[] = {
[IIO_MOD_LIGHT_GREEN] = "green",
[IIO_MOD_LIGHT_BLUE] = "blue",
[IIO_MOD_LIGHT_UV] = "uv",
[IIO_MOD_LIGHT_UVA] = "uva",
[IIO_MOD_LIGHT_UVB] = "uvb",
[IIO_MOD_LIGHT_DUV] = "duv",
[IIO_MOD_QUATERNION] = "quaternion",
[IIO_MOD_TEMP_AMBIENT] = "ambient",
Expand Down
11 changes: 11 additions & 0 deletions drivers/iio/light/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,17 @@ config VEML6070
To compile this driver as a module, choose M here: the
module will be called veml6070.

config VEML6075
tristate "VEML6075 UVA and UVB light sensor"
select REGMAP_I2C
depends on I2C
help
Say Y here if you want to build a driver for the Vishay VEML6075 UVA
and UVB light sensor.

To compile this driver as a module, choose M here: the
module will be called veml6075.

config VL6180
tristate "VL6180 ALS, range and proximity sensor"
depends on I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/light/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ obj-$(CONFIG_VCNL4000) += vcnl4000.o
obj-$(CONFIG_VCNL4035) += vcnl4035.o
obj-$(CONFIG_VEML6030) += veml6030.o
obj-$(CONFIG_VEML6070) += veml6070.o
obj-$(CONFIG_VEML6075) += veml6075.o
obj-$(CONFIG_VL6180) += vl6180.o
obj-$(CONFIG_ZOPT2201) += zopt2201.o
Loading
Loading