From 3b6c8e0b83c1b0f96a6136e2d6b25c63cbf75044 Mon Sep 17 00:00:00 2001 From: Alan Date: Tue, 8 Aug 2023 14:57:29 +0800 Subject: [PATCH] add i2c0(PI5&PI6) overlay --- .../arm64/boot/dts/allwinner/overlay/Makefile | 1 + .../allwinner/overlay/sun50i-h616-i2c0.dts | 20 +++++++++++++++++++ .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 1 + userpatches/sunxi.txt | 5 ++++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 kernel/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0.dts diff --git a/kernel/arch/arm64/boot/dts/allwinner/overlay/Makefile b/kernel/arch/arm64/boot/dts/allwinner/overlay/Makefile index 1897e9e12b..c591d7e4a8 100644 --- a/kernel/arch/arm64/boot/dts/allwinner/overlay/Makefile +++ b/kernel/arch/arm64/boot/dts/allwinner/overlay/Makefile @@ -9,6 +9,7 @@ dtbo-$(CONFIG_ARCH_SUNXI) += \ sun50i-h616-spidev1_0.dtbo \ sun50i-h616-spidev1_1.dtbo \ sun50i-h616-spidev1_2.dtbo \ + sun50i-h616-i2c0.dtbo\ sun50i-h616-ir.dtbo \ sun50i-h616-tft35_spi.dtbo \ sun50i-h616-tft35_spi25.dtbo \ diff --git a/kernel/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0.dts b/kernel/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0.dts new file mode 100755 index 0000000000..11a7b7f6b9 --- /dev/null +++ b/kernel/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0.dts @@ -0,0 +1,20 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-h616"; + + fragment@0 { + target-path = "/aliases"; + __overlay__ { + i2c0 = "/soc/i2c@5002000"; + }; + }; + + fragment@1 { + target = <&i2c0>; + __overlay__ { + status = "okay"; + }; + }; +}; diff --git a/kernel/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/kernel/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi index 061c66d9ce..7446101ec7 100755 --- a/kernel/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +++ b/kernel/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi @@ -335,6 +335,7 @@ i2c0_pins: i2c0-pins { pins = "PI5", "PI6"; function = "i2c0"; + bias-pull-up; }; i2c1_pins: i2c1-pins { diff --git a/userpatches/sunxi.txt b/userpatches/sunxi.txt index 3b4c252856..9b616ab583 100644 --- a/userpatches/sunxi.txt +++ b/userpatches/sunxi.txt @@ -22,6 +22,9 @@ console=display ## uncomment MCP2515 spi to canbus module #overlays=mcp2515 +## uncomment to release 'spidev0.0' to user space +#overlays=i2c0 + ## uncomment to release 'spidev0.0' to user space #overlays=spidev0_0 @@ -38,6 +41,6 @@ console=display #overlays=ir ## write the config after the 'overlays' and separate it with a space when multiple functions are enabled -#overlays=disable_uart0 pwm ws2812 light tft35_spi mcp2515 spidev0_0 spidev1_0 spidev1_1 spidev1_2 ir +#overlays=disable_uart0 pwm ws2812 light tft35_spi mcp2515 i2c0 spidev0_0 spidev1_0 spidev1_1 spidev1_2 ir #------------------------------------------------#