From patchwork Mon Aug 4 07:07:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 4667211 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 A738B9F38C for ; Mon, 4 Aug 2014 07:05:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B029F20220 for ; Mon, 4 Aug 2014 07:05:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4D95B2021A for ; Mon, 4 Aug 2014 07:05:41 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 855AC26531F; Mon, 4 Aug 2014 09:05:37 +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,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6286D261B01; Mon, 4 Aug 2014 09:05:19 +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 B29C126163C; Mon, 4 Aug 2014 09:05:17 +0200 (CEST) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0210.outbound.protection.outlook.com [207.46.163.210]) by alsa0.perex.cz (Postfix) with ESMTP id 92EFD261B01 for ; Mon, 4 Aug 2014 09:05:03 +0200 (CEST) Received: from BLUPR03MB357.namprd03.prod.outlook.com (10.141.75.151) by BLUPR03MB472.namprd03.prod.outlook.com (10.141.78.153) with Microsoft SMTP Server (TLS) id 15.0.995.14; Mon, 4 Aug 2014 07:04:56 +0000 Received: from BN3PR0301CA0084.namprd03.prod.outlook.com (25.160.152.180) by BLUPR03MB357.namprd03.prod.outlook.com (10.141.75.151) with Microsoft SMTP Server (TLS) id 15.0.995.14; Mon, 4 Aug 2014 07:04:55 +0000 Received: from BN1BFFO11FD059.protection.gbl (2a01:111:f400:7c10::1:126) by BN3PR0301CA0084.outlook.office365.com (2a01:111:e400:401e::52) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Mon, 4 Aug 2014 07:04:55 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD059.mail.protection.outlook.com (10.58.145.14) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Mon, 4 Aug 2014 07:04:55 +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 s7474jgF003114; Mon, 4 Aug 2014 00:04:46 -0700 From: Nicolin Chen To: Date: Mon, 4 Aug 2014 15:07:25 +0800 Message-ID: <1407136045-8940-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 1.8.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130516094954605069; (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:(10009002)(6009001)(189002)(199002)(80022001)(77156001)(55446002)(19580405001)(4396001)(93916002)(50226001)(6806004)(31966008)(81342001)(81442001)(77982001)(19580395003)(105596002)(81156004)(87936001)(79102001)(68736004)(61266001)(73972005)(46102001)(82202001)(74662001)(50986999)(64706001)(87572001)(92566001)(107046002)(21056001)(81542001)(229853001)(73392001)(102836001)(110136001)(36756003)(44976005)(89996001)(62966002)(26826002)(88136002)(92726001)(74502001)(99396002)(33646002)(106466001)(86362001)(97736001)(69596002)(104166001)(20776003)(48376002)(84676001)(2351001)(47776003)(85306004)(95666004)(85852003)(104016003)(87286001)(83072002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB357; 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: 0293D40691 Received-SPF: SoftFail (protection.outlook.com: 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; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: Cc: alsa-devel@alsa-project.org, Li.Xiubo@freescale.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, timur@tabi.org Subject: [alsa-devel] [PATCH] ASoC: fsl_sai: Set SYNC bit of TCR2 to Asynchronous Mode 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 From: Nicolin Chen There is one design rule according to SAI's reference manual: If the transmitter bit clock and frame sync are to be used by both transmitter and receiver, the transmitter must be configured for asynchronous operation and the receiver for synchronous operation. And SYNC of TCR2 is a 2-width control bit: 00 Asynchronous mode. 01 Synchronous with receiver. 10 Synchronous with another SAI transmitter. 11 Synchronous with another SAI receiver. So the driver should have set SYNC bit of TCR2 to 0x0, and meanwhile set SYNC bit of RCR2 to 0x1 (Synchronous with transmitter). Signed-off-by: Nicolin Chen --- @Mark Sir, I don't see your last patch in your branch. So I guess we can still use this better fix which does not have the 64bit compiling issue either. sound/soc/fsl/fsl_sai.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index faa0497..9f10575 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -333,8 +333,7 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, * The transmitter bit clock and frame sync are to be * used by both the transmitter and receiver. */ - regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, - ~FSL_SAI_CR2_SYNC); + regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, 0); regmap_update_bits(sai->regmap, FSL_SAI_RCR2, FSL_SAI_CR2_SYNC, FSL_SAI_CR2_SYNC);