From 2ff65ffbdeb0c8764985af19df2a687a126136f4 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Fri, 29 Sep 2023 16:55:28 +0100
Subject: [PATCH] overlays: Fix vc4-kms-dsi-7inch

Fix the touchscreen.

See: https://github.com/raspberrypi/linux/issues/5619

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 arch/arm/boot/dts/overlays/edt-ft5406.dtsi          | 13 ++++---------
 .../boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts |  2 +-
 2 files changed, 5 insertions(+), 10 deletions(-)

--- a/arch/arm/boot/dts/overlays/edt-ft5406.dtsi
+++ b/arch/arm/boot/dts/overlays/edt-ft5406.dtsi
@@ -22,11 +22,13 @@
 		};
 	};
 
-	fragment@12 {
-		target = <&i2cbus>;
+	ts_i2c_frag: fragment@12 {
+		target = <&i2c_csi_dsi>;
 		__overlay__ {
 			#address-cells = <1>;
 			#size-cells = <0>;
+			status = "okay";
+
 			ft5406: ts@38 {
 				compatible = "edt,edt-ft5506";
 				reg = <0x38>;
@@ -37,13 +39,6 @@
 		};
 	};
 
-	ts_i2c_frag: fragment@13 {
-		target = <&i2c_csi_dsi>;
-		i2cbus: __overlay__ {
-			status = "okay";
-		};
-	};
-
 	__overrides__ {
 		sizex = <&ft5406>,"touchscreen-size-x:0";
 		sizey = <&ft5406>,"touchscreen-size-y:0";
--- a/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts
+++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts
@@ -119,6 +119,6 @@
 		       <&panel_disp>, "reg:0=0",
 		       <&reg_bridge>, "reg:0=0",
 		       <&reg_bridge>, "regulator-name=bridge_reg_0";
-		disable_touch = <0>, "-10-11-12";
+		disable_touch = <&ft5406>, "status=disabled";
 	};
 };
