From 2ad10509361a9982c9428383eb2a2f04b832bc96 Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Mon, 6 May 2019 21:14:14 +0800 Subject: [PATCH] audio: set hdmi format-check threshold by input samplerate [2/2] PD#SWPL-6340 Problem: ddp audio input from hdmiin is not smooth Solution: set hdmiin format-check threshold by input sr Verify: Verified by x301. Change-Id: Idb8ffa616c3880b1c34d61ca4e8c2917343a9ffc Signed-off-by: Zhe Wang --- sound/soc/amlogic/auge/extn.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sound/soc/amlogic/auge/extn.c b/sound/soc/amlogic/auge/extn.c index 681e67d..e90909d 100644 --- a/sound/soc/amlogic/auge/extn.c +++ b/sound/soc/amlogic/auge/extn.c @@ -17,6 +17,8 @@ * such as fratv, frhdmirx */ +/*#define DEBUG*/ + #include #include #include @@ -134,6 +136,17 @@ static irqreturn_t extn_ddr_isr(int irq, void *devid) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct device *dev = rtd->platform->dev; struct extn *p_extn = (struct extn *)dev_get_drvdata(dev); + int timeout_thres = 5; + +#ifdef CONFIG_AMLOGIC_MEDIA_TVIN_HDMI + int sample_rate_index = get_hdmi_sample_rate_index(); + + /*192K audio*/ + if (sample_rate_index == 7) + timeout_thres = 10; + else + timeout_thres = 5; +#endif if (!snd_pcm_running(substream)) return IRQ_HANDLED; @@ -148,7 +161,7 @@ static irqreturn_t extn_ddr_isr(int irq, void *devid) p_extn->frhdmirx_same_cnt++; - if (p_extn->frhdmirx_same_cnt > 5) + if (p_extn->frhdmirx_same_cnt > timeout_thres) frhdmirx_nonpcm2pcm_clr_reset(p_extn); if (p_extn->frhdmirx_cnt == 0) -- 2.7.4