bcm27xx: switch to 5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0621-overlays-add-bh1750-and-ccs811-to-i2c-sensor-4334.patch
1 From fa6a21d6e2e8d5416ec9d2ca7841777aa0822796 Mon Sep 17 00:00:00 2001
2 From: Mart Lubbers <mart@martlubbers.net>
3 Date: Tue, 11 May 2021 11:51:35 +0200
4 Subject: [PATCH] overlays: add bh1750 and ccs811 to i2c-sensor (#4334)
5
6 See: https://github.com/raspberrypi/linux/pull/4334
7 ---
8 arch/arm/boot/dts/overlays/README | 15 +++++---
9 .../boot/dts/overlays/i2c-sensor-overlay.dts | 35 ++++++++++++++++++-
10 2 files changed, 45 insertions(+), 5 deletions(-)
11
12 --- a/arch/arm/boot/dts/overlays/README
13 +++ b/arch/arm/boot/dts/overlays/README
14 @@ -1482,11 +1482,15 @@ Params: abx80x Select o
15
16
17 Name: i2c-sensor
18 -Info: Adds support for a number of I2C barometric pressure and temperature
19 - sensors on i2c_arm
20 +Info: Adds support for a number of I2C barometric pressure, temperature,
21 + light level and chemical sensors on i2c_arm
22 Load: dtoverlay=i2c-sensor,<param>=<val>
23 -Params: addr Set the address for the BME280, BME680, BMP280,
24 - DS1621, HDC100X, LM75, SHT3x or TMP102
25 +Params: addr Set the address for the BH1750, BME280, BME680,
26 + BMP280, CCS811, DS1621, HDC100X, LM75, SHT3x or
27 + TMP102
28 +
29 + bh1750 Select the Rohm BH1750 ambient light sensor
30 + Valid addresses 0x23 or 0x5c, default 0x23
31
32 bme280 Select the Bosch Sensortronic BME280
33 Valid addresses 0x76-0x77, default 0x76
34 @@ -1501,6 +1505,9 @@ Params: addr Set the
35 bmp280 Select the Bosch Sensortronic BMP280
36 Valid addresses 0x76-0x77, default 0x76
37
38 + ccs811 Select the AMS CCS811 digital gas sensor
39 + Valid addresses 0x5a-0x5b, default 0x5b
40 +
41 ds1621 Select the Dallas Semiconductors DS1621 temp
42 sensor. Valid addresses 0x48-0x4f, default 0x48
43
44 --- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
45 +++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
46 @@ -261,10 +261,41 @@
47 };
48 };
49
50 + fragment@17 {
51 + target = <&i2c_arm>;
52 + __dormant__ {
53 + #address-cells = <1>;
54 + #size-cells = <0>;
55 + status = "okay";
56 +
57 + ccs811: ccs811@5b {
58 + compatible = "ccs811";
59 + reg = <0x5b>;
60 + status = "okay";
61 + };
62 + };
63 + };
64 +
65 + fragment@18 {
66 + target = <&i2c_arm>;
67 + __dormant__ {
68 + #address-cells = <1>;
69 + #size-cells = <0>;
70 + status = "okay";
71 +
72 + bh1750: bh1750@23 {
73 + compatible = "bh1750";
74 + reg = <0x23>;
75 + status = "okay";
76 + };
77 + };
78 + };
79 +
80 __overrides__ {
81 addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0",
82 <&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0",
83 - <&ds1621>,"reg:0", <&bme680>,"reg:0";
84 + <&ds1621>,"reg:0", <&bme680>,"reg:0", <&ccs811>,"reg:0",
85 + <&bh1750>,"reg:0";
86 bme280 = <0>,"+0";
87 bmp085 = <0>,"+1";
88 bmp180 = <0>,"+2";
89 @@ -283,5 +314,7 @@
90 bme680 = <0>,"+14";
91 sps30 = <0>,"+15";
92 sgp30 = <0>,"+16";
93 + ccs811 = <0>, "+17";
94 + bh1750 = <0>, "+18";
95 };
96 };