From 48ff1e8f467c3b7315361943b710258e2c9d1a3f Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Wed, 8 Jul 2020 01:00:48 +0200 Subject: [PATCH 193/478] arm64: dts: sun50i-a64-pinephone: Add modem power manager Pinephone has a EG25-G modem that needs a special powerup/powerdown sequence. Add a power manager to manage the modem power. Signed-off-by: Ondrej Jirman --- .../allwinner/sun50i-a64-pinephone-1.0.dts | 22 ++++++++++++++++++ .../allwinner/sun50i-a64-pinephone-1.1.dts | 23 +++++++++++++++++++ .../allwinner/sun50i-a64-pinephone-1.2.dts | 23 +++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts index 0cc97b36dacc..7789bcb30eb6 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts @@ -86,6 +86,28 @@ ®_drivevbus { status = "okay"; }; +&uart3 { + modem { + compatible = "quectel,eg25"; + char-device-name = "modem-power"; + + power-supply = <®_vbat_bb>; /* PL7 */ + + enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */ + reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */ + pwrkey-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ + + sleep-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + wakeup-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-RI */ + + cts-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* PD5-CTS */ + dtr-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6-DTR */ + rts-gpios = <&pio 3 4 GPIO_ACTIVE_HIGH>; /* PD4-RTS */ + + quectel,qdai = "1,1,0,1,0,0,1,1"; + }; +}; + &usbphy { usb-role-switch; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts index 9dba7ac15509..9da19016ae8d 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts @@ -110,6 +110,29 @@ &sgm3140 { flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */ }; +&uart3 { + modem { + compatible = "quectel,eg25"; + char-device-name = "modem-power"; + + power-supply = <®_vbat_bb>; /* PL7 */ + + enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */ + reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */ + status-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ + status-pwrkey-multiplexed; /* status acts as pwrkey */ + + sleep-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + wakeup-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-RI */ + + dtr-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6-DTR */ + cts-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* PD5-CTS */ + rts-gpios = <&pio 3 4 GPIO_ACTIVE_HIGH>; /* PD4-RTS */ + + quectel,qdai = "1,1,0,1,0,0,1,1"; + }; +}; + &usbphy { usb-role-switch; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts index 40127186606f..5e988230e6e4 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts @@ -103,6 +103,29 @@ &sgm3140 { flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */ }; +&uart3 { + modem { + compatible = "quectel,eg25"; + char-device-name = "modem-power"; + + power-supply = <®_vbat_bb>; /* PL7 */ + + enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */ + reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */ + status-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ + pwrkey-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ + + host-ready-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6-RI */ + + dtr-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-DTR */ + cts-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* PD5-CTS */ + rts-gpios = <&pio 3 4 GPIO_ACTIVE_HIGH>; /* PD4-RTS */ + + quectel,qdai = "1,1,0,1,0,0,1,1"; + }; +}; + &usbphy { usb-role-switch; -- 2.35.3