From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbbI1GhV (ORCPT ); Mon, 28 Sep 2015 02:37:21 -0400 Received: from smtpbg302.qq.com ([184.105.206.27]:49149 "EHLO smtpbg302.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750843AbbI1GhT (ORCPT ); Mon, 28 Sep 2015 02:37:19 -0400 X-QQ-mid: bizesmtp3t1443422177t772t322 X-QQ-SSF: 01100000002000F0FF32000A0000000 X-QQ-FEAT: QX/rXDl9P1sZu1bEaF9N2UCLyAllcOyPB7I7XuMJBthfmvKU6a3rKSZnhimJw 1xWuDR5QswawL450gHypyCVqpW8ZCDFl+pRhMXmsBVfvl8QbcAfCdSXR1crDgDnbkpjoQH+ IlcDlMPJUvu1dtXbJUBPRQutuOjIZGGrd3pUcOzsFFxYxjTdxQRHzy2U7EHxAG207iIBrjz kO+vwkqAK6YXRKOuSvjTmJANdxLgFMi6hV7Gx2eLiUJFklxd81N8v6USgjqejmfdsQe2Rkn vEYA== X-QQ-GoodBg: 0 From: "yitian" To: , , , , , Cc: , , Subject: [PATCH 1/1] ASoC: dwc: fix dma stop transferring issue Date: Mon, 28 Sep 2015 14:36:16 +0800 Message-ID: <035401d0f9b7$faa800b0$eff80210$@tangramtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AdD5t7Plg69ISthdQqymxJZAL7iwHA== Content-Language: zh-cn X-QQ-SENDSIZE: 520 X-QQ-FName: 389235BBFE104784B6133AFA692B716F X-QQ-LocalIP: 112.95.241.173 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Designware I2S uses tx empty and rx available signals as the DMA handshaking signals. during music playing, if XRUN occurs, i2s_stop() function will be executed and both tx and rx irq are masked, when music contintes to be played, i2s_start() is executed but both tx and rx irq are not unmasked which cause I2S stop sending DMA handshaking signal to DMA controller, and it finally cause music playing will be stopped once XRUN occurs for the first time. Signed-off-by: Yitian Bu --- sound/soc/dwc/designware_i2s.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index a3e97b4..4d3e1d3 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -144,10 +144,19 @@ static void i2s_start(struct dw_i2s_dev *dev, i2s_write_reg(dev->i2s_base, IER, 1); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + for (i = 0; i < 4; i++) { + irq = i2s_read_reg(dev->i2s_base, IMR(i)); + i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30); + } i2s_write_reg(dev->i2s_base, ITER, 1); - else + } else { + for (i = 0; i < 4; i++) { + irq = i2s_read_reg(dev->i2s_base, IMR(i)); + i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x03); + } i2s_write_reg(dev->i2s_base, IRER, 1); + } i2s_write_reg(dev->i2s_base, CER, 1); } -- 1.7.12.4