From f737e55412c58d0bd6ceb2a9610ab95290d0cd52 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 29 Jul 2023 17:34:52 +0200
Subject: [PATCH 230/463] arm64: dts: rk3399-pinebook-pro: Disable SD card
 power when suspended

Without this the card will not properly power cycle out of 1.8V
I/O voltage back to 3.3V when the system is resuming from sleep.

Upstream doesn't have uhs-sdr104 enabled, so this patch is not
necessary for upstream.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
index bbcf572857089..62e9e85b16d51 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
@@ -275,8 +275,8 @@ vcc3v0_sd: vcc3v0-sd {
 		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&sdmmc0_pwr_h_pin>;
+		regulator-boot-on;
 		regulator-name = "vcc3v0_sd";
-		regulator-always-on;
 		regulator-min-microvolt = <3000000>;
 		regulator-max-microvolt = <3000000>;
 		vin-supply = <&vcc3v3_sys>;
@@ -537,13 +537,12 @@ regulator-state-mem {
 
 			vcc_sdio: LDO_REG4 {
 				regulator-name = "vcc_sdio";
-				regulator-always-on;
 				regulator-boot-on;
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <3000000>;
 
 				regulator-state-mem {
-					regulator-on-in-suspend;
+					regulator-off-in-suspend;
 					regulator-suspend-microvolt = <3000000>;
 				};
 			};
-- 
2.46.0

