From patchwork Wed Apr 23 08:04:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 4039321 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1F9E7BFF02 for ; Wed, 23 Apr 2014 08:06:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1EEC20221 for ; Wed, 23 Apr 2014 08:06:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F0D7C20265 for ; Wed, 23 Apr 2014 08:05:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6ED812650F2; Wed, 23 Apr 2014 10:05:55 +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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 30ECF265068; Wed, 23 Apr 2014 10:05:46 +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 8BBC6265086; Wed, 23 Apr 2014 10:05:44 +0200 (CEST) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by alsa0.perex.cz (Postfix) with ESMTP id 3983B265068 for ; Wed, 23 Apr 2014 10:05:36 +0200 (CEST) Received: by mail-pd0-f178.google.com with SMTP id x10so528530pdj.37 for ; Wed, 23 Apr 2014 01:05:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mV9Xow1Rr/GSodsN+5N2Wk7VBE7HeldDCb4n/+iqV9g=; b=YbCMcVVSAzboSlUtWOhtjluYQojZ9y8eRqweRhmK7mDX5TZOxWbuKNADQY/6PlxdVM bjHqUkeT7qsvbVAnq0LmpgIqTxfDLbiqU+RL+2tcGi0V/6dTwH7d5Q389I3CCy2x5IOn W9o1SNp62GoyrL1BeHIrsY86u4xz1/lkKN/JFZvXO/OYMLUIeTFKH1gbK1sNOa13W/wc +3qlm6exD+09UrMiBmq0MtCzS4sOzG7S7TMlLtUYE1BneM8uL1Ssi2PtH3melJFAhHna nQ1maIXD9a8SRDJlQaYrDjdeNpp0WwwDGLZuJan1qOARWNTUxwrvpSTD4F0sNyeGi3mU tbgw== X-Gm-Message-State: ALoCoQmDGKusZv2N1hc0GQl9MRr5+ovLgJ8WFcWTpEDQOFBLZoburvwOTud8s7yCb/ngeCFPfPZQ X-Received: by 10.68.94.164 with SMTP id dd4mr6661617pbb.161.1398240333307; Wed, 23 Apr 2014 01:05:33 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id te2sm1160817pac.25.2014.04.23.01.05.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 01:05:32 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org Date: Wed, 23 Apr 2014 13:34:24 +0530 Message-Id: <1398240264-21285-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 Cc: sbkim73@samsung.com, jassisinghbrar@gmail.com, broonie@kernel.org, lgirdwood@gmail.com, kgene.kim@samsung.com Subject: [alsa-devel] [PATCH] ASoC: SAMSUNG: Don't clear clock setting during i2s_startup 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 In exiting kernel, if DAIFMT flags are set in dai_link and I2S is set to run in master mode, the I2S clocks are not getting configured resulting in no output. Existing code clears the current I2S clock settings during i2s_startup and requires that the clocks are reconfigured. It then assumes that sound-card driver would call snd_soc_dai_{set_sysclk/set_fmt} to configure the root clock. 1. Since I2S clock settings remain fixed for a board, it would be better to set the clocks once during sound-card probe. 2. Also if the DAIFMT flags are set in dai_link, snd_soc_dai_set_fmt is called during DAI probe. If both these conditions are true, then I2S clock remains unconfigured during audio playback. Fix this by removing the code to clear rclk_srcrate in i2s_startup. Instead, reset this during DAI probe. Signed-off-by: Tushar Behera --- The patch is based on v3.15-rc2. sound/soc/samsung/i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 048ead9..6e61db7 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -724,9 +724,6 @@ static int i2s_startup(struct snd_pcm_substream *substream, else i2s->mode |= DAI_MANAGER; - /* Enforce set_sysclk in Master mode */ - i2s->rclk_srcrate = 0; - if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR)) writel(CON_RSTCLR, i2s->addr + I2SCON); @@ -984,6 +981,7 @@ probe_exit: /* Reset any constraint on RFS and BFS */ i2s->rfs = 0; i2s->bfs = 0; + i2s->rclk_srcrate = 0; i2s_txctrl(i2s, 0); i2s_rxctrl(i2s, 0); i2s_fifo(i2s, FIC_TXFLUSH);