From patchwork Fri Jan 13 20:44:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 9516655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DD5C2607D6 for ; Sat, 14 Jan 2017 00:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2CBB28749 for ; Sat, 14 Jan 2017 00:49:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A702928754; Sat, 14 Jan 2017 00:49:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9308428749 for ; Sat, 14 Jan 2017 00:49:41 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C239B26788A; Sat, 14 Jan 2017 01:49:39 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 31BBF2668C0; Sat, 14 Jan 2017 01:47:21 +0100 (CET) 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 9E43C2677F9; Fri, 13 Jan 2017 21:44:43 +0100 (CET) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by alsa0.perex.cz (Postfix) with ESMTP id 9F95A266A13 for ; Fri, 13 Jan 2017 21:44:41 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3v0ZPD703Rzyv4; Fri, 13 Jan 2017 21:44:32 +0100 (CET) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :date:subject:subject:from:from:received:received; s=default; t= 1484340272; x=1484945073; bh=4iFyt05hdSrm8Hec8Jg7vhxFUQwRR3RoZa4 0h/zKvnc=; b=v/nK3rlLyghXNLdzpt+tKhOMLGOYfqG8RD/XOOVUVR/tw3aQV+2 /B9MTVi4ZrxGBBVEnq7BtIIlTcPmmu0xYmJ0ocwtlO4HwnFzUnsV82pjL+PVpLv+ 5Q3KGpsMHCRKQz9pkORU2LL1eTyM0CyPxfs/j0A46fg6RcIIkb9ixbktKUcS37hx 6xrCawMk0lGqOUUC5k5coMNNRM5dA48wkKdPtgNa87B8qa1wcMwBg6da5nRoAfpY JmjAYYRDFMzn3IgLxFF5EHDi2Pq6gMz9PftyFrTyFtGUbRWIufY54kr0fYaQ/zEz TrqJ2AQ8b/6TZhYAAfekFdjANP+3jX6Iimw== Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id smN2aw5vXUZS; Fri, 13 Jan 2017 21:44:32 +0100 (CET) Received: from nzxt.fritz.box (x4d0c96de.dyn.telefonica.de [77.12.150.222]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Fri, 13 Jan 2017 21:44:31 +0100 (CET) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: alsa-devel@alsa-project.org Date: Fri, 13 Jan 2017 21:44:28 +0100 Message-Id: <20170113204428.16703-2-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170113204428.16703-1-joerg.krause@embedded.rocks> References: <20170113204428.16703-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Cc: Mans Rullgard , Victorien Vedrine , =?UTF-8?q?J=C3=B6rg=20Krause?= , Takashi Iwai , Mark Brown , Fabio Estevam , Shawn Guo Subject: [alsa-devel] [PATCH 2/2] ASoC: mxs-saif: fix setting SAIF1 register 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 If SAIF0 is used in master and SAIF1 in slave mode setting the SAIF1 register in mxs_saif_set_dai_fmt() does not have any effect on the interface as the clk gate needs to be cleared before the register can be written. Signed-off-by: Jörg Krause --- sound/soc/mxs/mxs-saif.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 1e724533dc6e..26c240af8099 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -309,6 +309,16 @@ static int mxs_saif_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) return -EBUSY; } + /* If SAIF1 is configured as slave, the clk gate needs to be cleared + * before the register can be written. + */ + if (saif->id != saif->master_id) { + __raw_writel(BM_SAIF_CTRL_SFTRST, + saif->base + SAIF_CTRL + MXS_CLR_ADDR); + __raw_writel(BM_SAIF_CTRL_CLKGATE, + saif->base + SAIF_CTRL + MXS_CLR_ADDR); + } + scr0 = __raw_readl(saif->base + SAIF_CTRL); scr0 = scr0 & ~BM_SAIF_CTRL_BITCLK_EDGE & ~BM_SAIF_CTRL_LRCLK_POLARITY \ & ~BM_SAIF_CTRL_JUSTIFY & ~BM_SAIF_CTRL_DELAY;