From patchwork Tue Oct 20 00:42:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 7440741 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C69EBEEA4 for ; Tue, 20 Oct 2015 00:42:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70AB4206E0 for ; Tue, 20 Oct 2015 00:42:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3C463206A9 for ; Tue, 20 Oct 2015 00:42:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 60EBC265E5B; Tue, 20 Oct 2015 02:42:22 +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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 786A2265E10; Tue, 20 Oct 2015 02:42:13 +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 9FD22265E14; Tue, 20 Oct 2015 02:42:12 +0200 (CEST) Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by alsa0.perex.cz (Postfix) with ESMTP id E8B3B265E0C for ; Tue, 20 Oct 2015 02:42:06 +0200 (CEST) Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 2A6755C2338; Tue, 20 Oct 2015 02:40:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=agner.ch; s=dkim; t=1445301616; bh=l5sCae7UDy+Fjl0d6GfglF58GMdNVlgubS7EZa25Tho=; h=From:To:Cc:Subject:Date:From; b=ZtTJHTotjwil0uIu2+KChdz4wz/pmWFx3nQ6C9uOGNosbYuBx95GcOrxECSMS1t0n Y9jIFA4CNLck+AH+iKBjeMjHb/JAOO0W+ee5O+oah74x9aCY/6ivlr3xaFUqo4Zrj0 /aX01hXGtMSt382O6CHfVFQR2inaZbloJ0+RLCjg= From: Stefan Agner To: broonie@kernel.org, timur@tabi.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com Date: Mon, 19 Oct 2015 17:42:23 -0700 Message-Id: <1445301743-24173-1-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.6.1 Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, Stefan Agner , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: fsl_sai: fix Rx synchrounous 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP When using the Rx clock for both, transmitter and receiver, the transmitter needs to be set to synchronous with receiver. This reverts 855675f6e6a6 ("ASoC: fsl_sai: Set SYNC bit of TCR2 to Asynchronous Mode"), which, judiging from the commit log, seems to mixed up between the two synchronous modes: The boolean sai->synchronous[TX] is indicating wheather the SAI should work in Rx synchronous mode (sync Tx with Rx), hence if the value is true, the SYNC field of TCR2 needs to be set to 0x1 ("Synchronous with receiver"). Signed-off-by: Stefan Agner Acked-by: Nicolin Chen --- Hi Nicolin, I got this reported from a customer, he tried to use the device tree property "fsl,sai-synchronous-rx" according to the description but it failed. In a quick test, setting the SYNC field of TCR2 to 0x1 helped in his case. So I think this here is right. But given that you chaged the very same line can you review that again and give me a Ack/Nack? -- Stefan sound/soc/fsl/fsl_sai.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index a18fd92..1f0e552 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -454,7 +454,8 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, * Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx. * Tx sync with Rx clocks: Clear SYNC for Rx, set it for Tx. */ - regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, 0); + regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, + sai->synchronous[TX] ? FSL_SAI_CR2_SYNC : 0); regmap_update_bits(sai->regmap, FSL_SAI_RCR2, FSL_SAI_CR2_SYNC, sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0);