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 8 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 @@ -2417,6 +2419,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

int_pin Set the GPIO to use for interrupts (max30102,
Expand Down Expand Up @@ -2494,15 +2499,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

i2c0 Choose the I2C0 bus on GPIOs 0&1

i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
Expand Down
95 changes: 94 additions & 1 deletion arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
compatible = "brcm,bcm2835";
Expand Down Expand Up @@ -529,6 +530,90 @@
};
};

fragment@35 {
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@36 {
target = <&i2cbus>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

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

fragment@38 {
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 @@ -576,6 +661,11 @@
bno055 = <0>,"+31";
sht4x = <0>,"+32";
adt7410 = <0>,"+34";
hts221 = <0>,"+35+99";
veml6075 = <0>,"+36";
as73211 = <0>,"+38+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 @@ -590,7 +680,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";
};
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
CONFIG_BINFMT_MISC=m
CONFIG_ZSWAP=y
CONFIG_Z3FOLD=m
# CONFIG_COMPAT_BRK is not set
CONFIG_CMA=y
CONFIG_LRU_GEN=y
Expand Down Expand Up @@ -1414,14 +1413,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
5 changes: 4 additions & 1 deletion arch/arm/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
CONFIG_BINFMT_MISC=m
CONFIG_ZSWAP=y
CONFIG_Z3FOLD=m
# CONFIG_COMPAT_BRK is not set
CONFIG_CMA=y
CONFIG_LRU_GEN=y
Expand Down Expand Up @@ -1443,14 +1442,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
5 changes: 4 additions & 1 deletion arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
CONFIG_BINFMT_MISC=m
CONFIG_ZSWAP=y
CONFIG_Z3FOLD=m
# CONFIG_COMPAT_BRK is not set
CONFIG_CMA=y
CONFIG_LRU_GEN=y
Expand Down Expand Up @@ -1407,14 +1406,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
7 changes: 5 additions & 2 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CONFIG_ARCH_BRCMSTB=y
# CONFIG_CAVIUM_ERRATUM_27456 is not set
CONFIG_HOTPLUG_CPU=y
CONFIG_NUMA=y
CONFIG_NUMA_EMULATION=y
CONFIG_COMPAT=y
CONFIG_ARMV8_DEPRECATED=y
CONFIG_SWP_EMULATION=y
Expand Down Expand Up @@ -77,7 +78,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
CONFIG_BINFMT_MISC=m
CONFIG_ZSWAP=y
CONFIG_Z3FOLD=m
# CONFIG_COMPAT_BRK is not set
CONFIG_CMA=y
CONFIG_LRU_GEN=y
Expand Down Expand Up @@ -1492,14 +1492,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 Expand Up @@ -1695,4 +1699,3 @@ CONFIG_SCHED_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_UPROBE_EVENTS is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_NUMA_EMULATION=y
7 changes: 5 additions & 2 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ CONFIG_ARCH_BRCMSTB=y
CONFIG_ARM64_16K_PAGES=y
CONFIG_HOTPLUG_CPU=y
CONFIG_NUMA=y
CONFIG_NUMA_EMULATION=y
CONFIG_COMPAT=y
CONFIG_ARMV8_DEPRECATED=y
CONFIG_SWP_EMULATION=y
Expand Down Expand Up @@ -80,7 +81,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
CONFIG_BINFMT_MISC=m
CONFIG_ZSWAP=y
CONFIG_Z3FOLD=m
# CONFIG_COMPAT_BRK is not set
CONFIG_CMA=y
CONFIG_LRU_GEN=y
Expand Down Expand Up @@ -1495,14 +1495,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 Expand Up @@ -1698,4 +1702,3 @@ CONFIG_SCHED_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_UPROBE_EVENTS is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_NUMA_EMULATION=y
5 changes: 4 additions & 1 deletion arch/arm64/configs/bcmrpi3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_MAC_PARTITION=y
CONFIG_BINFMT_MISC=y
CONFIG_ZSWAP=y
CONFIG_Z3FOLD=m
# CONFIG_COMPAT_BRK is not set
CONFIG_CMA=y
CONFIG_LRU_GEN=y
Expand Down Expand Up @@ -1385,14 +1384,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
Loading
Loading