From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jianhua Lu <lujianhua000@gmail.com>
Date: Mon, 17 Oct 2022 08:02:58 +0800
Subject: drm: dsi: emit panel turn on/off signal to touchscreen

---
 drivers/gpu/drm/msm/dsi/dsi_manager.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 896f369fdd53..50d788138192 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -7,6 +7,7 @@
 
 #include "msm_kms.h"
 #include "dsi.h"
+#include "drm/drm_notifier.h"
 
 #define DSI_CLOCK_MASTER	DSI_0
 #define DSI_CLOCK_SLAVE		DSI_1
@@ -303,6 +304,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
 	struct mipi_dsi_host *host = msm_dsi->host;
 	bool is_bonded_dsi = IS_BONDED_DSI();
 	int ret;
+	enum drm_notifier_data notifier_data;
 
 	DBG("id=%d", id);
 	if (!msm_dsi_device_connected(msm_dsi))
@@ -318,6 +320,9 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
 		return;
 	}
 
+	notifier_data = MI_DRM_BLANK_UNBLANK;
+	mi_drm_notifier_call_chain(MI_DRM_EVENT_BLANK, &notifier_data);
+
 	ret = msm_dsi_host_enable(host);
 	if (ret) {
 		pr_err("%s: enable host %d failed, %d\n", __func__, id, ret);
@@ -361,12 +366,16 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
 	struct mipi_dsi_host *host = msm_dsi->host;
 	bool is_bonded_dsi = IS_BONDED_DSI();
 	int ret;
+	enum drm_notifier_data notifier_data;
 
 	DBG("id=%d", id);
 
 	if (!msm_dsi_device_connected(msm_dsi))
 		return;
 
+	notifier_data = MI_DRM_BLANK_POWERDOWN;
+	mi_drm_notifier_call_chain(MI_DRM_EARLY_EVENT_BLANK, &notifier_data);
+
 	/*
 	 * Do nothing with the host if it is slave-DSI in case of bonded DSI.
 	 * It is safe to call dsi_mgr_phy_disable() here because a single PHY
-- 
Armbian

