[ rockchip-dev ] add i2c1 and 4 overlays

Allows enable/disable of I2C channels found on Tinker GPIO headers.
This commit is contained in:
Thomas McKahan 2018-12-18 23:55:45 -05:00
parent 077a7f8590
commit 89c97f3d71
2 changed files with 81 additions and 3 deletions

View File

@ -5,7 +5,7 @@ BOOTCONFIG="tinker-rk3288_defconfig"
#
MODULES="hci_uart rfcomm hidp 8723bs"
MODULES_NEXT=""
DEFAULT_OVERLAYS="spi2 spidev2 uart1 uart2"
DEFAULT_OVERLAYS="i2c1 i2c4 spi2 spidev2 uart1 uart2"
KERNEL_TARGET="default,next,dev"
CLI_TARGET="stretch,bionic:default,next"
DESKTOP_TARGET="stretch,bionic:default,next"

View File

@ -45,10 +45,12 @@ new file mode 100644
index 000000000..207eb4789
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/Makefile
@@ -0,0 +1,24 @@
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: GPL-2.0
+dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
+ rockchip-ds1307.dtbo \
+ rockchip-i2c1.dtbo \
+ rockchip-i2c4.dtbo \
+ rockchip-spi0.dtbo \
+ rockchip-spi2.dtbo \
+ rockchip-spidev0.dtbo \
@ -75,7 +77,7 @@ new file mode 100644
index 000000000..c6f331542
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/README.rockchip-overlays
@@ -0,0 +1,68 @@
@@ -0,0 +1,78 @@
+This document describes overlays provided in the kernel packages
+For generic Armbian overlays documentation please see
+https://docs.armbian.com/User-Guide_Allwinner_overlays/
@ -87,6 +89,8 @@ index 000000000..c6f331542
+### Provided overlays:
+
+- ds1307
+- i2c1
+- i2c4
+- spi0
+- spi2
+- spidev0
@ -103,6 +107,14 @@ index 000000000..c6f331542
+
+Activates ds1307 rtc on i2c1
+
+### i2c1
+
+Activate i2c1
+
+### i2c4
+
+Activate i2c4
+
+### spi0
+
+Activate spi0
@ -432,4 +444,70 @@ index 000000000..02bb81a1e
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/rockchip-i2c1.dts b/arch/arm/boot/dts/overlay/rockchip-i2c1.dts
new file mode 100644
index 000000000..12064d4d2
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/rockchip-i2c1.dts
@@ -0,0 +1,16 @@
+/* Definitions for i2c1
+*/
+
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
+
+ fragment@0 {
+ target = <&i2c1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/rockchip-i2c4.dts b/arch/arm/boot/dts/overlay/rockchip-i2c4.dts
new file mode 100644
index 000000000..b399ecbd8
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/rockchip-i2c4.dts
@@ -0,0 +1,16 @@
+/* Definitions for i2c4
+*/
+
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
+
+ fragment@0 {
+ target = <&i2c4>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
index 994f60a55..958c0f3bf 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dts
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
@@ -369,7 +369,7 @@
};
&i2c1 {
- status = "okay";
+ status = "disabled";
};
&i2c2 {
@@ -392,7 +392,7 @@
};
&i2c4 {
- status = "okay";
+ status = "disabled";
};
&i2c5 {