From patchwork Thu Jul 17 13:21:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 4574981 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 79F9A9F26C for ; Thu, 17 Jul 2014 13:20:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74BC32018A for ; Thu, 17 Jul 2014 13:20:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3F1B320122 for ; Thu, 17 Jul 2014 13:20:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2DE60265593; Thu, 17 Jul 2014 15:20:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 37F8026553F; Thu, 17 Jul 2014 15:19:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4140D26553F; Thu, 17 Jul 2014 15:19:38 +0200 (CEST) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0211.outbound.protection.outlook.com [207.46.163.211]) by alsa0.perex.cz (Postfix) with ESMTP id 190A0265527 for ; Thu, 17 Jul 2014 15:19:32 +0200 (CEST) Received: from BN3PR0301CA0003.namprd03.prod.outlook.com (25.160.180.141) by BLUPR03MB358.namprd03.prod.outlook.com (10.141.75.152) with Microsoft SMTP Server (TLS) id 15.0.985.8; Thu, 17 Jul 2014 13:19:25 +0000 Received: from BY2FFO11FD041.protection.gbl (2a01:111:f400:7c0c::104) by BN3PR0301CA0003.outlook.office365.com (2a01:111:e400:4000::13) with Microsoft SMTP Server (TLS) id 15.0.985.8 via Frontend Transport; Thu, 17 Jul 2014 13:19:25 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD041.mail.protection.outlook.com (10.1.14.226) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Thu, 17 Jul 2014 13:19:24 +0000 Received: from rio.ap.freescale.net (rio.ap.freescale.net [10.192.242.9]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s6HDJEkC021446; Thu, 17 Jul 2014 06:19:18 -0700 From: Nicolin Chen To: Date: Thu, 17 Jul 2014 21:21:37 +0800 Message-ID: <9ef07dc9cc98b19e3f81f8374617605bf0d9faeb.1405603108.git.nicoleotsuka@gmail.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Matching-Connectors: 130500767647401574; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(43544003)(199002)(189002)(102836001)(50466002)(79102001)(74502001)(84676001)(19580405001)(20776003)(19580395003)(87286001)(87936001)(88136002)(80022001)(107046002)(82202001)(229853001)(33646002)(73392001)(64706001)(61266001)(69596002)(110136001)(81542001)(47776003)(575784001)(48376002)(85306003)(68736004)(4396001)(74662001)(106466001)(44976005)(97736001)(81156004)(46102001)(99396002)(50986999)(89996001)(105596002)(93916002)(62966002)(87572001)(73972005)(26826002)(81442001)(2351001)(86362001)(55446002)(92566001)(81342001)(77156001)(104016003)(83072002)(104166001)(21056001)(6806004)(50226001)(95666004)(76176999)(92726001)(31966008)(77982001)(36756003)(85852003); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB358; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 027578BB13 Received-SPF: SoftFail (: domain of transitioning gmail.com discourages use of 192.88.158.2 as permitted sender) Authentication-Results: spf=softfail (sender IP is 192.88.158.2) smtp.mailfrom=nicoleotsuka@gmail.com; Cc: alsa-devel@alsa-project.org, b42378@freescale.com, b02247@freescale.com, linux-kernel@vger.kernel.org, timur@tabi.org, Li.Xiubo@freescale.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH 1/2] ASoC: fsl_sai: Reset FIFOs after disabling TE/RE X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver should take care the task so as not to let useless data remain in the FIFO. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_sai.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index c5a0e8a..b10dbd8 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -371,10 +371,13 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, /* Check if the opposite FRDE is also disabled */ if (!(tx ? rcsr & FSL_SAI_CSR_FRDE : tcsr & FSL_SAI_CSR_FRDE)) { + /* Disable both directions and reset their FIFOs */ regmap_update_bits(sai->regmap, FSL_SAI_TCSR, - FSL_SAI_CSR_TERE, 0); + FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR, + FSL_SAI_CSR_FR); regmap_update_bits(sai->regmap, FSL_SAI_RCSR, - FSL_SAI_CSR_TERE, 0); + FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR, + FSL_SAI_CSR_FR); } break; default: