From patchwork Thu Jan 15 22:28:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Niederpr=C3=BCm?= X-Patchwork-Id: 5647161 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7A6AF9F3A0 for ; Fri, 16 Jan 2015 10:53:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B025B2015A for ; Fri, 16 Jan 2015 10:53:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6EEF920117 for ; Fri, 16 Jan 2015 10:53:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8953026549C; Fri, 16 Jan 2015 11:53:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 07904260641; Fri, 16 Jan 2015 11:53:16 +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 DD6C82612BD; Thu, 15 Jan 2015 23:28:09 +0100 (CET) Received: from mailgw1.uni-kl.de (mailgw1.uni-kl.de [131.246.120.220]) by alsa0.perex.cz (Postfix) with ESMTP id 60F7E261171 for ; Thu, 15 Jan 2015 23:27:58 +0100 (CET) Received: from maestro.triple-a.uni-kl.de (vpn-ipv4-0615.triple-a.uni-kl.de [131.246.82.103]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-7) with ESMTP id t0FMRt34028996; Thu, 15 Jan 2015 23:27:56 +0100 From: =?UTF-8?q?Thomas=20Niederpr=C3=BCm?= To: peter.ujfalusi@ti.com, jarkko.nikula@bitmer.com Date: Thu, 15 Jan 2015 23:28:21 +0100 Message-Id: <1421360901-20671-1-git-send-email-niederp@physik.uni-kl.de> X-Mailer: git-send-email 2.1.1 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 16 Jan 2015 11:53:13 +0100 Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, =?UTF-8?q?Thomas=20Niederpr=C3=BCm?= Subject: [alsa-devel] [PATCH] ASoC: OMAP: mcbsp: ensure that CLKX and CLKR are not used as ouput pins when they are used as input clock for the SRG. 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 This patch fixes faulty behaviour in a setup where the input clock for the SRG is fed through the CLKR pin but the McBSP is configured to be master (SND_SOC_DAIFMT_CBS_CFS). In that case of course CLKR must not be configured as output pin. Otherwise the input clock is messed up horribly. The same reasoning applies if CLKX is configured as input for the SRG. Signed-off-by: Thomas Niederprüm --- sound/soc/omap/omap-mcbsp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index bd3ef2a..c89f562 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -530,8 +530,12 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, case OMAP_MCBSP_SYSCLK_CLKX_EXT: regs->srgr2 |= CLKSM; + regs->pcr0 |= SCLKME; + regs->pcr0 &= ~CLKXM; + break; case OMAP_MCBSP_SYSCLK_CLKR_EXT: regs->pcr0 |= SCLKME; + regs->pcr0 &= ~CLKRM; break; default: err = -ENODEV;