aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Purski <m.purski@samsung.com>2017-11-29 06:48:50 -0500
committerAndrzej Hajda <a.hajda@samsung.com>2018-06-13 10:26:57 -0400
commitbbc05e172fad9affa388be35b78b9e5e5da76648 (patch)
tree70c3ce63b6db29c96ff95a7ef6b303ea60b98af2
parent9378cecb1ce5d618b8aff4d65113ddcf72fc1011 (diff)
drm/bridge/sii8620: start MHL transmission after HDMI signal detection
The vendor code waits for infoframe to detect video mode set by source. We do not need to follow this pattern, because video mode information is provided by drm core. As a result most of the infoframe handling code can be removed. Start transmission immediately after detecting stream on HDMI lines in irq_scdt() function without waiting for infoframe interrupt. Signed-off-by: Maciej Purski <m.purski@samsung.com> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/1511956130-24482-1-git-send-email-m.purski@samsung.com
-rw-r--r--drivers/gpu/drm/bridge/sil-sii8620.c53
1 files changed, 2 insertions, 51 deletions
diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c
index 61fd3e0a4ba6..853c4f97c7c9 100644
--- a/drivers/gpu/drm/bridge/sil-sii8620.c
+++ b/drivers/gpu/drm/bridge/sil-sii8620.c
@@ -1941,14 +1941,6 @@ static void sii8620_irq_edid(struct sii8620 *ctx)
1941 ctx->mt_state = MT_STATE_DONE; 1941 ctx->mt_state = MT_STATE_DONE;
1942} 1942}
1943 1943
1944static void sii8620_scdt_high(struct sii8620 *ctx)
1945{
1946 sii8620_write_seq_static(ctx,
1947 REG_INTR8_MASK, BIT_CEA_NEW_AVI | BIT_CEA_NEW_VSI,
1948 REG_TPI_SC, BIT_TPI_SC_TPI_OUTPUT_MODE_0_HDMI,
1949 );
1950}
1951
1952static void sii8620_irq_scdt(struct sii8620 *ctx) 1944static void sii8620_irq_scdt(struct sii8620 *ctx)
1953{ 1945{
1954 u8 stat = sii8620_readb(ctx, REG_INTR5); 1946 u8 stat = sii8620_readb(ctx, REG_INTR5);
@@ -1956,53 +1948,13 @@ static void sii8620_irq_scdt(struct sii8620 *ctx)
1956 if (stat & BIT_INTR_SCDT_CHANGE) { 1948 if (stat & BIT_INTR_SCDT_CHANGE) {
1957 u8 cstat = sii8620_readb(ctx, REG_TMDS_CSTAT_P3); 1949 u8 cstat = sii8620_readb(ctx, REG_TMDS_CSTAT_P3);
1958 1950
1959 if (cstat & BIT_TMDS_CSTAT_P3_SCDT) { 1951 if (cstat & BIT_TMDS_CSTAT_P3_SCDT)
1960 if (ctx->sink_type == SINK_HDMI) 1952 sii8620_start_video(ctx);
1961 /* enable infoframe interrupt */
1962 sii8620_scdt_high(ctx);
1963 else
1964 sii8620_start_video(ctx);
1965 }
1966 } 1953 }
1967 1954
1968 sii8620_write(ctx, REG_INTR5, stat); 1955 sii8620_write(ctx, REG_INTR5, stat);
1969} 1956}
1970 1957
1971static void sii8620_new_vsi(struct sii8620 *ctx)
1972{
1973 u8 vsif[11];
1974
1975 sii8620_write(ctx, REG_RX_HDMI_CTRL2,
1976 VAL_RX_HDMI_CTRL2_DEFVAL |
1977 BIT_RX_HDMI_CTRL2_VSI_MON_SEL_VSI);
1978 sii8620_read_buf(ctx, REG_RX_HDMI_MON_PKT_HEADER1, vsif,
1979 ARRAY_SIZE(vsif));
1980}
1981
1982static void sii8620_new_avi(struct sii8620 *ctx)
1983{
1984 sii8620_write(ctx, REG_RX_HDMI_CTRL2, VAL_RX_HDMI_CTRL2_DEFVAL);
1985 sii8620_read_buf(ctx, REG_RX_HDMI_MON_PKT_HEADER1, ctx->avif,
1986 ARRAY_SIZE(ctx->avif));
1987}
1988
1989static void sii8620_irq_infr(struct sii8620 *ctx)
1990{
1991 u8 stat = sii8620_readb(ctx, REG_INTR8)
1992 & (BIT_CEA_NEW_VSI | BIT_CEA_NEW_AVI);
1993
1994 sii8620_write(ctx, REG_INTR8, stat);
1995
1996 if (stat & BIT_CEA_NEW_VSI)
1997 sii8620_new_vsi(ctx);
1998
1999 if (stat & BIT_CEA_NEW_AVI)
2000 sii8620_new_avi(ctx);
2001
2002 if (stat & (BIT_CEA_NEW_VSI | BIT_CEA_NEW_AVI))
2003 sii8620_start_video(ctx);
2004}
2005
2006static void sii8620_got_xdevcap(struct sii8620 *ctx, int ret) 1958static void sii8620_got_xdevcap(struct sii8620 *ctx, int ret)
2007{ 1959{
2008 if (ret < 0) 1960 if (ret < 0)
@@ -2084,7 +2036,6 @@ static irqreturn_t sii8620_irq_thread(int irq, void *data)
2084 { BIT_FAST_INTR_STAT_EDID, sii8620_irq_edid }, 2036 { BIT_FAST_INTR_STAT_EDID, sii8620_irq_edid },
2085 { BIT_FAST_INTR_STAT_DDC, sii8620_irq_ddc }, 2037 { BIT_FAST_INTR_STAT_DDC, sii8620_irq_ddc },
2086 { BIT_FAST_INTR_STAT_SCDT, sii8620_irq_scdt }, 2038 { BIT_FAST_INTR_STAT_SCDT, sii8620_irq_scdt },
2087 { BIT_FAST_INTR_STAT_INFR, sii8620_irq_infr },
2088 }; 2039 };
2089 struct sii8620 *ctx = data; 2040 struct sii8620 *ctx = data;
2090 u8 stats[LEN_FAST_INTR_STAT]; 2041 u8 stats[LEN_FAST_INTR_STAT];