aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-08-31 07:42:49 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:43 -0400
commite82b090b80a41f2b5d9daec4c73edd76e2865419 (patch)
treecc954466343ac31f735430191f488177c7750684 /drivers/video/omap2
parent4a61e267c84e98caeddcab25432a871bf1a599dd (diff)
OMAP: DSS2: DISPC: improve dispc_mgr_enable_digit_out()
dispc_mgr_enable_digit_out() didn't handle HDMI case very well. Improve the function to use FRAMEDONETV interrupt to see when HDMI has been disabled. Cc: Mythri P K <mythripk@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dispc.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 4e9f87fc33d8..38d6595bb916 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1924,11 +1924,16 @@ static void _enable_digit_out(bool enable)
1924static void dispc_mgr_enable_digit_out(bool enable) 1924static void dispc_mgr_enable_digit_out(bool enable)
1925{ 1925{
1926 struct completion frame_done_completion; 1926 struct completion frame_done_completion;
1927 int r; 1927 enum dss_hdmi_venc_clk_source_select src;
1928 int r, i;
1929 u32 irq_mask;
1930 int num_irqs;
1928 1931
1929 if (REG_GET(DISPC_CONTROL, 1, 1) == enable) 1932 if (REG_GET(DISPC_CONTROL, 1, 1) == enable)
1930 return; 1933 return;
1931 1934
1935 src = dss_get_hdmi_venc_clk_source();
1936
1932 if (enable) { 1937 if (enable) {
1933 unsigned long flags; 1938 unsigned long flags;
1934 /* When we enable digit output, we'll get an extra digit 1939 /* When we enable digit output, we'll get an extra digit
@@ -1945,36 +1950,40 @@ static void dispc_mgr_enable_digit_out(bool enable)
1945 * wait for the extra sync losts */ 1950 * wait for the extra sync losts */
1946 init_completion(&frame_done_completion); 1951 init_completion(&frame_done_completion);
1947 1952
1953 if (src == DSS_HDMI_M_PCLK && enable == false) {
1954 irq_mask = DISPC_IRQ_FRAMEDONETV;
1955 num_irqs = 1;
1956 } else {
1957 irq_mask = DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD;
1958 /* XXX I understand from TRM that we should only wait for the
1959 * current field to complete. But it seems we have to wait for
1960 * both fields */
1961 num_irqs = 2;
1962 }
1963
1948 r = omap_dispc_register_isr(dispc_disable_isr, &frame_done_completion, 1964 r = omap_dispc_register_isr(dispc_disable_isr, &frame_done_completion,
1949 DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD); 1965 irq_mask);
1950 if (r) 1966 if (r)
1951 DSSERR("failed to register EVSYNC isr\n"); 1967 DSSERR("failed to register %x isr\n", irq_mask);
1952 1968
1953 _enable_digit_out(enable); 1969 _enable_digit_out(enable);
1954 1970
1955 /* XXX I understand from TRM that we should only wait for the 1971 for (i = 0; i < num_irqs; ++i) {
1956 * current field to complete. But it seems we have to wait 1972 if (!wait_for_completion_timeout(&frame_done_completion,
1957 * for both fields */ 1973 msecs_to_jiffies(100)))
1958 if (!wait_for_completion_timeout(&frame_done_completion, 1974 DSSERR("timeout waiting for digit out to %s\n",
1959 msecs_to_jiffies(100))) 1975 enable ? "start" : "stop");
1960 DSSERR("timeout waiting for EVSYNC\n"); 1976 }
1961
1962 if (!wait_for_completion_timeout(&frame_done_completion,
1963 msecs_to_jiffies(100)))
1964 DSSERR("timeout waiting for EVSYNC\n");
1965 1977
1966 r = omap_dispc_unregister_isr(dispc_disable_isr, 1978 r = omap_dispc_unregister_isr(dispc_disable_isr, &frame_done_completion,
1967 &frame_done_completion, 1979 irq_mask);
1968 DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD);
1969 if (r) 1980 if (r)
1970 DSSERR("failed to unregister EVSYNC isr\n"); 1981 DSSERR("failed to unregister %x isr\n", irq_mask);
1971 1982
1972 if (enable) { 1983 if (enable) {
1973 unsigned long flags; 1984 unsigned long flags;
1974 spin_lock_irqsave(&dispc.irq_lock, flags); 1985 spin_lock_irqsave(&dispc.irq_lock, flags);
1975 dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR; 1986 dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST_DIGIT;
1976 if (dss_has_feature(FEAT_MGR_LCD2))
1977 dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST2;
1978 dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT); 1987 dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT);
1979 _omap_dispc_set_irqs(); 1988 _omap_dispc_set_irqs();
1980 spin_unlock_irqrestore(&dispc.irq_lock, flags); 1989 spin_unlock_irqrestore(&dispc.irq_lock, flags);