From af807021e3027c96efa6bb6792b4fa134b4c9909 Mon Sep 17 00:00:00 2001 From: Chuangcheng Peng Date: Fri, 3 Apr 2020 14:06:44 +0800 Subject: [PATCH] demux: dsc source enable [1/1] PD#SWPL-23541 Problem: REE set dsc source don't work in time. Solution: add set dsc source work in time. Verify: irdeto cas verify. Change-Id: I761b6c18a68fbc35dcf6d26e75cb3a0904a9c1a2 Signed-off-by: Chuangcheng Peng --- .../stream_input/parser/hw_demux/aml_dmx.c | 69 ++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/drivers/stream_input/parser/hw_demux/aml_dmx.c b/drivers/stream_input/parser/hw_demux/aml_dmx.c index bb482db..3a54d64 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dmx.c +++ b/drivers/stream_input/parser/hw_demux/aml_dmx.c @@ -2392,6 +2392,71 @@ void dsc_release(void) } /************************* AES DESC************************************/ +void dsc_enable_source(struct aml_dsc *dsc) +{ + u32 data; + u32 in = 0, out = 0; + int set = 0; + + if (dsc->id != 0) { + pr_error("Ciplus set output can only work at dsc0 device\n"); + return; + } + + switch (dsc->source) { + case AM_TS_SRC_DMX0: + in = 0; + break; + case AM_TS_SRC_DMX1: + in = 1; + break; + case AM_TS_SRC_DMX2: + in = 2; + break; + default: + break; + } + + if (ciplus_out_auto_mode == 1) { + switch (dsc->dst) { + case AM_TS_SRC_DMX0: + out = 1; + break; + case AM_TS_SRC_DMX1: + out = 2; + break; + case AM_TS_SRC_DMX2: + out = 4; + break; + default: + break; + } + set = 1; + ciplus_out_sel = out; + } else if (ciplus_out_sel >= 0 && ciplus_out_sel <= 7) { + set = 1; + out = ciplus_out_sel; + } else { + pr_error("dsc ciplus out config is invalid\n"); + } + + if (set) { + /* Set ciplus input source , + * output set 0 means no output. ---> need confirm. + * if output set 0 still affects dsc output, we need to disable + * ciplus module. + */ + data = READ_MPEG_REG(STB_TOP_CONFIG); + data &= ~(3<id == 0) { @@ -5398,7 +5463,9 @@ int aml_dsc_hw_set_source(struct aml_dsc *dsc, if (hw_dst == -1) dsc_enable(dsc, 0); } - + if (src_reset && dst_reset) { + dsc_enable_source(dsc); + } spin_unlock_irqrestore(&dvb->slock, flags); return ret; -- 2.20.1