diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2016-12-06 13:34:03 +0100 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-13 20:16:00 -0800 |
commit | 37867525c2ddec009f73bfbfa98e9a9c29b12abf (patch) | |
tree | ca42178a76c268c5ad9e68856d4e0ea7f6fca19d | |
parent | c23ed1220ff9f5154064864442468dcc8f08eb87 (diff) | |
download | linux-exynos-37867525c2ddec009f73bfbfa98e9a9c29b12abf.tar.gz linux-exynos-37867525c2ddec009f73bfbfa98e9a9c29b12abf.tar.bz2 linux-exynos-37867525c2ddec009f73bfbfa98e9a9c29b12abf.zip |
drm/bridge/sii8620: split EDID read and write code
MHL3 requires that after reading EDID from the sink source should ask
peer for features. To make both protocols happy the patch splits code
accordingly.
Change-Id: I367a05e4c4aac0b0de31692027da117ec56ff039
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
-rw-r--r-- | drivers/gpu/drm/bridge/sil-sii8620.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 3ba69756816d..60b3c22b6e1a 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -479,6 +479,10 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) ctx->sink_type = SINK_DVI; dev_info(dev, "detected sink(type: %s)\n", sink_str[ctx->sink_type]); +} + +static void sii8620_edid_read(struct sii8620 *ctx, int ret) +{ sii8620_set_upstream_edid(ctx); sii8620_enable_hpd(ctx); } @@ -784,12 +788,12 @@ static void sii8620_fetch_edid(struct sii8620 *ctx) edid = new_edid; } } - - if (fetched + FETCH_SIZE == edid_len) - sii8620_write(ctx, REG_INTR3, int3); } - sii8620_write(ctx, REG_LM_DDC, lm_ddc); + sii8620_write_seq(ctx, + REG_INTR3_MASK, BIT_DDC_CMD_DONE, + REG_LM_DDC, lm_ddc + ); end: kfree(ctx->edid); @@ -1699,6 +1703,21 @@ static void sii8620_irq_block(struct sii8620 *ctx) sii8620_write(ctx, REG_EMSCINTR, stat); } +static void sii8620_irq_ddc(struct sii8620 *ctx) +{ + u8 stat = sii8620_readb(ctx, REG_INTR3); + + if (stat & BIT_DDC_CMD_DONE) { + sii8620_write(ctx, REG_INTR3_MASK, 0); + if (ctx->mode > CM_MHL1) + sii8620_mt_set_int(ctx, MHL_INT_REG(RCHANGE), + MHL_INT_RC_FEAT_REQ); + else + sii8620_edid_read(ctx, 0); + } + sii8620_write(ctx, REG_INTR3, stat); +} + /* endian agnostic, non-volatile version of test_bit */ static bool sii8620_test_bit(unsigned int nr, const u8 *addr) { @@ -1719,6 +1738,7 @@ static irqreturn_t sii8620_irq_thread(int irq, void *data) { BIT_FAST_INTR_STAT_MERR, sii8620_irq_merr }, { BIT_FAST_INTR_STAT_BLOCK, sii8620_irq_block }, { BIT_FAST_INTR_STAT_EDID, sii8620_irq_edid }, + { BIT_FAST_INTR_STAT_DDC, sii8620_irq_ddc }, { BIT_FAST_INTR_STAT_SCDT, sii8620_irq_scdt }, { BIT_FAST_INTR_STAT_INFR, sii8620_irq_infr }, }; |