From 5547207e11f604491659e71791488f00b010d3c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 26 Oct 2021 01:25:46 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Workaround broken HDMI HPD signal

HDMI HPD signal from ANX7688 to SoC's HDMI PHY is wrongly level
shifted and does not register most of the time at the SoC's input.

We need to do the signalling in software. Link anx7688 to hdmi
driver via extcon interface.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts | 6 +++++-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts | 6 +++++-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts | 6 +++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

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 cfb9518e057f..0530881d8401 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
@@ -25,7 +25,7 @@ &axp803 {
 };
 
 &i2c0 {
-	hdmi-bridge@28 {
+	anx7688: hdmi-bridge@28 {
 		compatible = "analogix,anx7688";
 		reg = <0x28>;
 
@@ -131,3 +131,7 @@ &sgm3140 {
 &codec_analog {
 	allwinner,internal-bias-resistor;
 };
+
+&hdmi {
+	extcon = <&anx7688 0>;
+};
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 35cb92e3b5f1..053e4add9973 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
@@ -34,7 +34,7 @@ &codec_analog {
 };
 
 &i2c0 {
-	hdmi-bridge@28 {
+	anx7688: hdmi-bridge@28 {
 		compatible = "analogix,anx7688";
 		reg = <0x28>;
 
@@ -133,3 +133,7 @@ usb0_drd_sw: endpoint {
 		};
 	};
 };
+
+&hdmi {
+	extcon = <&anx7688 0>;
+};
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 aeb5c69fe51d..c4e3547e02e9 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
@@ -34,7 +34,7 @@ &mmc1 {
 };
 
 &i2c0 {
-	hdmi-bridge@28 {
+	anx7688: hdmi-bridge@28 {
 		compatible = "analogix,anx7688";
 		reg = <0x28>;
 
@@ -121,3 +121,7 @@ usb0_drd_sw: endpoint {
 		};
 	};
 };
+
+&hdmi {
+	extcon = <&anx7688 0>;
+};
-- 
2.35.3

