From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757355AbbI1JtW (ORCPT ); Mon, 28 Sep 2015 05:49:22 -0400 Received: from smtpbg302.qq.com ([184.105.206.27]:40383 "EHLO smtpbg302.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757025AbbI1JtV (ORCPT ); Mon, 28 Sep 2015 05:49:21 -0400 X-QQ-mid: bizesmtp7t1443433700t641t036 X-QQ-SSF: 01100000002000F0FG42000A0000000 X-QQ-FEAT: D4/1wLnaeJbTxm5bVvgkDUnTaSvPdt8fzHFAmLbfu3c0ymYCv+4cxsb0hJ5Cc 5JngchVa91kpsxaXsRNyDlqbOa3qJnepED0TGLkpS09X7sXLNaarZ7kTlGdaNuJ+YlE1vtu t7/9AsjQPnF3eqXhmBBFHRXFoBBBGtOZ4fa2f/1OIYYHVcnuQuzclgYQAf4fQOclg2kl70R 7tfoFIQrc6VN/QVQ8nFmNrkxSruxIRT/p4I7UN2CBDcLlfIiutXbH258rV9LOw6SW6gpfbz vuQw== X-QQ-GoodBg: 0 From: "yitian" To: , , , , , Cc: , , Subject: [PATCH v2 1/1] ASoC: dwc: fix dma stop transferring issue Date: Mon, 28 Sep 2015 17:48:14 +0800 Message-ID: <037a01d0f9d2$cec8aa10$6c59fe30$@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: AdD50rdBvxyzSg70RjeyWezvnWLo3Q== Content-Language: zh-cn X-QQ-SENDSIZE: 520 X-QQ-FName: 90F5A939BA1E466181FE05D77985158F X-QQ-LocalIP: 127.0.0.1 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 --- changes in V2: - add definition for i and irq --- sound/soc/dwc/designware_i2s.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index a3e97b4..76b2e19 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -141,13 +141,22 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream) static void i2s_start(struct dw_i2s_dev *dev, struct snd_pcm_substream *substream) { - + u32 i, irq; 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