Convert BPro touch screen patch to a DT overlay

This commit is contained in:
zador-blood-stained 2017-03-04 00:08:51 +03:00
parent 4a4517c86c
commit c8de734d35
3 changed files with 52 additions and 94 deletions

View File

@ -1,46 +0,0 @@
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index 18fcc87..50f1a36 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -147,6 +147,26 @@
status = "okay";
};
+&i2c3 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c3_pins_a>;
+ edt: edt-ft5x06@38 {
+ compatible = "edt,edt-ft5x06";
+ reg = <0x38>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 9 IRQ_TYPE_EDGE_FALLING>;
+ wake-gpios = <7 7 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&edt_ft5x06_pins>;
+ touchscreen-size-x = <1024>;
+ touchscreen-size-y = <600>;
+ touchscreen-inverted-x;
+ touchscreen-swapped-x-y;
+ };
+};
+
+
&ir0 {
pinctrl-names = "default";
pinctrl-0 = <&ir0_rx_pins_a>;
@@ -222,6 +242,14 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
+
+ edt_ft5x06_pins: edt_ft5x06_pins@0 {
+ allwinner,pins = "PH7", "PH9";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+
};
&reg_usb1_vbus {

View File

@ -1,9 +1,9 @@
diff --git a/arch/arm/boot/dts/overlay/Makefile b/arch/arm/boot/dts/overlay/Makefile
new file mode 100644
index 00000000..be4f2595
index 00000000..194dddba
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/Makefile
@@ -0,0 +1,28 @@
@@ -0,0 +1,29 @@
+ifeq ($(CONFIG_OF_CONFIGFS),y)
+
+dtbo-$(CONFIG_MACH_SUN7I) += \
@ -12,6 +12,7 @@ index 00000000..be4f2595
+ sun7i-a20-i2c1.dtbo \
+ sun7i-a20-i2c2.dtbo \
+ sun7i-a20-i2c3.dtbo \
+ sun7i-a20-i2c3-edt-ft5x06.dtbo \
+ sun7i-a20-nand.dtbo \
+ sun7i-a20-spdif-out.dtbo \
+ sun7i-a20-spi0-cs0-spidev.dtbo \
@ -144,6 +145,55 @@ index 00000000..3f94c827
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun7i-a20-i2c3-edt-ft5x06.dts b/arch/arm/boot/dts/overlay/sun7i-a20-i2c3-edt-ft5x06.dts
new file mode 100644
index 00000000..3ff36cd0
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun7i-a20-i2c3-edt-ft5x06.dts
@@ -0,0 +1,43 @@
+/dts-v1/ /plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ compatible = "allwinner,sun7i-a20";
+
+ fragment@0 {
+ target = <&pio>;
+ __overlay__ {
+ edt_ft5x06_pins: edt_ft5x06_pins@0 {
+ allwinner,pins = "PH7", "PH9";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <0>;
+ allwinner,pull = <0>;
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&i2c3>;
+ __overlay__ {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c3_pins_a>;
+ edt: edt-ft5x06@38 {
+ compatible = "edt,edt-ft5x06";
+ reg = <0x38>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 9 IRQ_TYPE_EDGE_FALLING>;
+ wake-gpios = <7 7 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&edt_ft5x06_pins>;
+ touchscreen-size-x = <1024>;
+ touchscreen-size-y = <600>;
+ touchscreen-inverted-x;
+ touchscreen-swapped-x-y;
+ };
+ };
+
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun7i-a20-i2c3.dts b/arch/arm/boot/dts/overlay/sun7i-a20-i2c3.dts
new file mode 100644
index 00000000..0236b5ae

View File

@ -1,46 +0,0 @@
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index 18fcc87..50f1a36 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -147,6 +147,26 @@
status = "okay";
};
+&i2c3 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c3_pins_a>;
+ edt: edt-ft5x06@38 {
+ compatible = "edt,edt-ft5x06";
+ reg = <0x38>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 9 IRQ_TYPE_EDGE_FALLING>;
+ wake-gpios = <7 7 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&edt_ft5x06_pins>;
+ touchscreen-size-x = <1024>;
+ touchscreen-size-y = <600>;
+ touchscreen-inverted-x;
+ touchscreen-swapped-x-y;
+ };
+};
+
+
&ir0 {
pinctrl-names = "default";
pinctrl-0 = <&ir0_rx_pins_a>;
@@ -222,6 +242,14 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
+
+ edt_ft5x06_pins: edt_ft5x06_pins@0 {
+ allwinner,pins = "PH7", "PH9";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+
};
&reg_usb1_vbus {