aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/805-display-0013-drm-bridge-cadence-Add-power_on-to-__cdns_dp_probe.patch
blob: a58e75c499e9c0740ea9bf73d84537279ad16b65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From 9737dd813b872f5671d40685d2174a928da809a3 Mon Sep 17 00:00:00 2001
From: Wen He <wen.he_1@nxp.com>
Date: Tue, 17 Sep 2019 15:23:51 +0800
Subject: [PATCH] drm: bridge: cadence: Add power_on to __cdns_dp_probe

Add power_on of the cnds_plat_data to __cdns_dp_probe as to update
Board related configuration initalization.

Signed-off-by: Wen He <wen.he_1@nxp.com>
---
 drivers/gpu/drm/bridge/cadence/cdns-dp-core.c   | 2 ++
 drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c | 2 ++
 drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c           | 6 +++---
 drivers/gpu/drm/imx/cdn-mhdp-imxdrv.c           | 2 ++
 drivers/gpu/drm/imx/cdns-mhdp-imx.h             | 1 +
 5 files changed, 10 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/bridge/cadence/cdns-dp-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-dp-core.c
@@ -457,6 +457,8 @@ static int __cdns_dp_probe(struct platfo
 
 	cdns_dp_parse_dt(mhdp);
 
+	cdns_mhdp_plat_call(mhdp, power_on);
+
 //	mhdp->dual_mode = false;
 	cdns_mhdp_plat_call(mhdp, firmware_init);
 
--- a/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c
@@ -449,6 +449,8 @@ static int __cdns_hdmi_probe(struct plat
 	/* Initialize dual_mode to false */
 //	hdmi->dual_mode = false;
 
+	cdns_mhdp_plat_call(mhdp, power_on);
+
 	/* Initialize FW */
 	cdns_mhdp_plat_call(mhdp, firmware_init);
 
--- a/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c
+++ b/drivers/gpu/drm/imx/cdn-mhdp-imx8qm.c
@@ -440,7 +440,7 @@ fail:
 	return ret;
 }
 
-static void imx8qm_mhdp_power_on(struct cdns_mhdp_device *mhdp)
+int cdns_mhdp_power_on_imx8qm(struct cdns_mhdp_device *mhdp)
 {
 	struct imx_mhdp_device *imx_mhdp =
 				container_of(mhdp, struct imx_mhdp_device, mhdp);
@@ -463,6 +463,8 @@ static void imx8qm_mhdp_power_on(struct
 	imx8qm_pixel_clk_enable(imx_mhdp);
 
 	imx8qm_phy_reset(1);
+
+	return 0;
 }
 
 void cdns_mhdp_plat_init_imx8qm(struct cdns_mhdp_device *mhdp)
@@ -506,8 +508,6 @@ int cdns_mhdp_firmware_init_imx8qm(struc
 	u32 rate;
 	int ret;
 
-	imx8qm_mhdp_power_on(mhdp);
-
 	/* configure HDMI/DP core clock */
 	rate = clk_get_rate(imx_mhdp->clks.clk_core);
 	cdns_mhdp_set_fw_clk(&imx_mhdp->mhdp, rate);
--- a/drivers/gpu/drm/imx/cdn-mhdp-imxdrv.c
+++ b/drivers/gpu/drm/imx/cdn-mhdp-imxdrv.c
@@ -71,6 +71,7 @@ static struct cdns_plat_data imx8qm_hdmi
 	.bind	= cdns_hdmi_bind,
 	.unbind	= cdns_hdmi_unbind,
 	.phy_set = cdns_hdmi_phy_set_imx8qm,
+	.power_on = cdns_mhdp_power_on_imx8qm,
 	.firmware_init = cdns_mhdp_firmware_init_imx8qm,
 	.pclk_rate = cdns_mhdp_pclk_rate_imx8qm,
 	.plat_init = cdns_mhdp_plat_init_imx8qm,
@@ -83,6 +84,7 @@ static struct cdns_plat_data imx8qm_dp_d
 	.bind	= cdns_dp_bind,
 	.unbind	= cdns_dp_unbind,
 	.phy_set = cdns_dp_phy_set_imx8qm,
+	.power_on = cdns_mhdp_power_on_imx8qm,
 	.firmware_init = cdns_mhdp_firmware_init_imx8qm,
 	.pclk_rate = cdns_mhdp_pclk_rate_imx8qm,
 	.plat_init = cdns_mhdp_plat_init_imx8qm,
--- a/drivers/gpu/drm/imx/cdns-mhdp-imx.h
+++ b/drivers/gpu/drm/imx/cdns-mhdp-imx.h
@@ -77,4 +77,5 @@ void cdns_mhdp_plat_init_imx8qm(struct c
 void cdns_mhdp_plat_deinit_imx8qm(struct cdns_mhdp_device *mhdp);
 void cdns_mhdp_pclk_rate_imx8qm(struct cdns_mhdp_device *mhdp);
 int cdns_mhdp_firmware_init_imx8qm(struct cdns_mhdp_device *mhdp);
+int cdns_mhdp_power_on_imx8qm(struct cdns_mhdp_device *mhdp);
 #endif /* CDNS_MHDP_IMX_H_ */