forked from radxa-pkg/radxa-overlays
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add i2c sensors for ROCK 3C/ZERO3
Signed-off-by: Nascs Fang <[email protected]>
- Loading branch information
Showing
16 changed files
with
469 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
arch/arm64/boot/dts/rockchip/overlays/rk3568-dht11-gpio3-a5.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/pinctrl/rockchip.h> | ||
|
||
/ { | ||
metadata { | ||
title = "Enable DHT11 on GPIO3_A5"; | ||
compatible = "radxa,rock-3c", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO3_A5"; | ||
description = "Enable DHT11 on GPIO3_A5. | ||
On Radxa NX5 IO this is pin 40."; | ||
}; | ||
}; | ||
|
||
&{/} { | ||
dht11: dht11@0 { | ||
compatible = "dht11"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&dht11_pin>; | ||
gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
dht11 { | ||
dht11_pin: dht11-pin { | ||
rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; | ||
}; | ||
}; | ||
}; |
11 changes: 11 additions & 0 deletions
11
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c3-m0-jc42.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "rk3568-i2c3-m0.dts" | ||
|
||
&i2c3 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
mcp980x: mcp980x@18 { | ||
compatible = "jedec,jc-42.4-temp"; | ||
reg = <0x1a>; | ||
}; | ||
}; |
11 changes: 11 additions & 0 deletions
11
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c3-m0-mcp980x.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "rk3568-i2c3-m0.dts" | ||
|
||
&i2c3 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
mcp980x: mcp980x@18 { | ||
compatible = "maxim,mcp980x"; | ||
reg = <0x18>; | ||
}; | ||
}; |
24 changes: 24 additions & 0 deletions
24
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c3-m0-sc16is750.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "rk3568-i2c3-m0.dts" | ||
|
||
&i2c3 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
sc16is750: sc16is750@48 { | ||
compatible = "nxp,sc16is750"; | ||
reg = <0x48>; | ||
clocks = <&sc16is750_clk>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <24 2>; | ||
pinctrl-0 = <&int_pins>; | ||
pinctrl-names = "default"; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
i2c-max-frequency = <400000>; | ||
}; | ||
}; | ||
|
||
|
||
&{/} { | ||
|
||
}; |
33 changes: 33 additions & 0 deletions
33
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-bme280.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
metadata { | ||
title = "Enable BME280 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable BME280 on I2C4-M0. | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
clock-frequency = <400000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
bme280: bme280@76 { | ||
compatible = "bme280"; | ||
reg = <0x76>; | ||
status = "okay"; | ||
}; | ||
}; |
33 changes: 33 additions & 0 deletions
33
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-bme680.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
metadata { | ||
title = "Enable BME680 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable BME680 on I2C4-M0. | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
clock-frequency = <400000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
bme680: bme680@76 { | ||
compatible = "bme680"; | ||
reg = <0x76>; | ||
status = "okay"; | ||
}; | ||
}; |
33 changes: 33 additions & 0 deletions
33
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-bmp280.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
metadata { | ||
title = "Enable BMP280 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable BMP280 on I2C4-M0. | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
clock-frequency = <400000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
bmp280: bmp280@76 { | ||
compatible = "bosch,bmp280"; | ||
reg = <0x76>; | ||
status = "okay"; | ||
}; | ||
}; |
33 changes: 33 additions & 0 deletions
33
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-bmp380.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
metadata { | ||
title = "Enable BMP380 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable BMP380 on I2C4-M0. | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
clock-frequency = <400000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
bmp380: bmp380@76 { | ||
compatible = "bosch,bmp380"; | ||
reg = <0x76>; | ||
status = "okay"; | ||
}; | ||
}; |
33 changes: 33 additions & 0 deletions
33
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-htu21.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
metadata { | ||
title = "Enable HTU21 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable HTU21 on I2C4-M0. | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
clock-frequency = <400000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
htu21: htu21@76 { | ||
compatible = "meas,htu21"; | ||
reg = <0x40>; | ||
status = "okay"; | ||
}; | ||
}; |
33 changes: 33 additions & 0 deletions
33
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-lm75.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
metadata { | ||
title = "Enable LM75 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable LM75 on I2C4-M0 . | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
lm75: lm75@48 { | ||
compatible = "st,stlm75"; | ||
reg = <0x48>; | ||
vs-supply = <&vcc3v3_sys>; | ||
status = "okay"; | ||
}; | ||
}; |
38 changes: 38 additions & 0 deletions
38
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-pcf8574.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/pinctrl/rockchip.h> | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
|
||
/ { | ||
metadata { | ||
title = "Enable PCF8574 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,cm3-io", "radxa,cm3-rpi-cm4-io", "radxa,cm3s-io", "radxa,radxa-cm3-sodimm-io", "radxa,e23", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable PCF8574 on I2C4-M0 . | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28. | ||
On Radxa CM3 IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa CM3 RPI CM4 IO this SDA pin 19 and SCL pin 23. | ||
On Radxa CM3S IO this is SDA pin 19 and SCL pin 23. | ||
On Radxa E23 this is SDA pin 19 and SCL pin 23.. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
pcf8574: pcf8574@20 { | ||
compatible = "nxp,pcf8574"; | ||
reg = <0x20>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
status = "okay"; | ||
}; | ||
}; |
38 changes: 38 additions & 0 deletions
38
arch/arm64/boot/dts/rockchip/overlays/rk3568-i2c4-m0-pcf8575.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/pinctrl/rockchip.h> | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
|
||
/ { | ||
metadata { | ||
title = "Enable PCF8575 on I2C4-M0"; | ||
compatible = "radxa,rock-3c", "radxa,zero3"; | ||
category = "misc"; | ||
exclusive = "GPIO4_B2", "GPIO4_B3"; | ||
description = "Enable PCF8575 on I2C4-M0. | ||
On Radxa ROCK 3C this is SDA pin 27 and SCL pin 28, INT=3. | ||
On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28, INT=3"; | ||
}; | ||
}; | ||
|
||
&i2c4 { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&i2c4m0_xfer>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
pcf8575: pcf8575@20 { | ||
compatible = "nxp,pcf8575"; | ||
reg = <0x20>; | ||
#gpio-controller; | ||
#gpio-cells = <2>; | ||
gpio-controller; | ||
#interrupt-cells = <2>; | ||
interrupt-parent = <&gpio3>; | ||
interrupts = <RK_PC4 IRQ_TYPE_EDGE_FALLING>; | ||
status = "okay"; | ||
}; | ||
}; |
Oops, something went wrong.