From 0da088ce86e596f4d2bdff7c255cc579579be341 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?=
 <mylene.josserand@free-electrons.com>
Date: Thu, 6 Jul 2017 10:57:55 +0200
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add powerup/down support for the 3G
 modem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The modem needs tree gpios to be powered-up:
	- PL10 = reset
	- PL8 = On/Off
	- PL9 = vbat
Because of that, the PL9 corresponds to the regulator's gpio whereas
the PL8 (on/off) will be a power-gpio of the power sequence.

Thanks to that, the modem is powered up:
       # lsusb
	Bus 001 Device 004: ID 19d2:ffeb

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
 arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 5cedbe2455db..f7d8e5425233 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -118,7 +118,7 @@ reg_vmain: reg-vmain {
 		regulator-name = "vmain";
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
-		gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>;
+		gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
 		enable-active-high;
 		vin-supply = <&reg_vbat>;
 	};
@@ -134,6 +134,17 @@ wifi_pwrseq: pwrseq {
 		clocks = <&ac100_rtc 1>;
 		clock-names = "ext_clock";
 	};
+
+	modem {
+		compatible = "zte,mg3732";
+		char-device-name = "modem-power";
+
+		power-supply = <&reg_vmain>;
+
+		enable-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
+		reset-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
+		wakeup-gpios = <&r_pio 0 11 GPIO_ACTIVE_HIGH>; /* PL11 */
+	};
 };
 
 &cpu0 {
-- 
2.35.3

