summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap-pm/dss2/0069-DSS2-DSI-Add-support-for-external-TE-signal.patch
blob: e32f8ad04a26647a573e922aeec783d254df6fe7 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From da9828702ab1cf29401f9a93f1e950505bfa2b76 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Fri, 22 May 2009 13:43:26 +0300
Subject: [PATCH 069/146] DSS2: DSI: Add support for external TE signal

I hope this can be removed when the DSI displays work properly.
---
 arch/arm/plat-omap/include/mach/display.h |    4 ++++
 drivers/video/omap2/dss/dsi.c             |   29 +++++++++++++++++++----------
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 31ebb96..dccc660 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -201,6 +201,9 @@ struct omap_dss_display_config {
 			u8 data2_lane;
 			u8 data2_pol;
 			unsigned long ddr_clk_hz;
+
+			bool ext_te;
+			u8 ext_te_gpio;
 		} dsi;
 
 		struct {
@@ -256,6 +259,7 @@ struct omap_ctrl {
 			     u16 x, u16 y, u16 w, u16 h);
 
 	int (*enable_te)(struct omap_display *display, bool enable);
+	int (*wait_for_te)(struct omap_display *display);
 
 	u8 (*get_rotate)(struct omap_display *display);
 	int (*set_rotate)(struct omap_display *display, u8 rotate);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 057b057..f39c890 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -274,7 +274,8 @@ static struct
 	enum omap_dss_update_mode user_update_mode;
 	enum omap_dss_update_mode target_update_mode;
 	enum omap_dss_update_mode update_mode;
-	int use_te;
+	bool use_te;
+	bool use_ext_te;
 	int framedone_scheduled; /* helps to catch strange framedone bugs */
 
 	unsigned long cache_req_pck;
@@ -2734,6 +2735,9 @@ static void dsi_update_screen_dispc(struct omap_display *display,
 
 	display->ctrl->setup_update(display, x, y, w, h);
 
+	if (dsi.use_ext_te && display->ctrl->wait_for_te)
+		display->ctrl->wait_for_te(display);
+
 	if (0)
 		dsi_vc_print_status(1);
 
@@ -3001,19 +3005,24 @@ end:
 
 static void dsi_do_cmd_set_te(struct omap_display *display, bool enable)
 {
-	dsi.use_te = enable;
+	if (!display->hw_config.u.dsi.ext_te)
+		dsi.use_te = enable;
+	else
+		dsi.use_ext_te = enable;
 
 	if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
 		return;
 
 	display->ctrl->enable_te(display, enable);
 
-	if (enable) {
-		/* disable LP_RX_TO, so that we can receive TE.
-		 * Time to wait for TE is longer than the timer allows */
-		REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
-	} else {
-		REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
+	if (!display->hw_config.u.dsi.ext_te) {
+		if (enable) {
+			/* disable LP_RX_TO, so that we can receive TE.
+			 * Time to wait for TE is longer than the timer allows */
+			REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
+		} else {
+			REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
+		}
 	}
 }
 
@@ -3508,7 +3517,7 @@ static int dsi_display_enable(struct omap_display *display)
 
 	display->state = OMAP_DSS_DISPLAY_ACTIVE;
 
-	if (dsi.use_te)
+	if (dsi.use_te || dsi.use_ext_te)
 		dsi_push_set_te(display, 1);
 
 	dsi_push_set_update_mode(display, dsi.user_update_mode);
@@ -3641,7 +3650,7 @@ static int dsi_display_enable_te(struct omap_display *display, bool enable)
 
 static int dsi_display_get_te(struct omap_display *display)
 {
-	return dsi.use_te;
+	return dsi.use_te | dsi.use_ext_te;
 }
 
 
-- 
1.6.2.4