From 3866db63d94b39ca441e6d94b4f19ec8ce9bf996 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Mon, 13 Nov 2017 17:20:42 +0100
Subject: [PATCH 07/11] ARM: dts: N9/N950: Add touchscreen support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
 arch/arm/boot/dts/omap3-n950-n9.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 0d9b85317529..219519812050 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -141,6 +141,14 @@
 			OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0)		/* uart2_rx */
 		>;
 	};
+
+	ts_pins: pinmux_ts_pins {
+		pinctrl-single,pins = <
+		    /* REVISIT pinmuxing gpmc_nbe1 to gpio_61 breaks Atmel maXTouch */
+			/*OMAP3_CORE1_IOPAD(0x20c8, PIN_INPUT | MUX_MODE4)*/	/* gpmc_nbe1.gpio_61 -> TINTX */
+			OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE4)	/* dss_data11.gpio_81 -> TRESX */
+		>;
+	};
 };
 
 &omap3_pmx_core2 {
@@ -199,6 +207,7 @@
 	regulator-name = "vaux1";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <2800000>;
+	regulator-always-on; /* needed for Atmel maXTouch */
 };
 
 /* CSI-2 receiver */
@@ -261,6 +270,7 @@
 	regulator-name = "vio";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-always-on; /* needed for Atmel maXTouch */
 };
 
 &i2c2 {
@@ -283,6 +293,18 @@
 			led-max-microamp = <10000>;
 		};
 	};
+
+	touch@4b {
+		compatible = "atmel,maxtouch";
+		reg = <0x4b>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&ts_pins>;
+
+		interrupt-parent = <&gpio2>;
+		interrupts = <29 IRQ_TYPE_EDGE_FALLING>; /* gpio_61 */
+		reset-gpios = <&gpio3 17 0>;             /* gpio_81 */
+	};
 };
 
 &i2c3 {
-- 
2.17.0