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: 4039341 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 E78D8BFF02 for ; Wed, 23 Apr 2014 08:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AD252014A for ; Wed, 23 Apr 2014 08:07:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D2BC20265 for ; Wed, 23 Apr 2014 08:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757419AbaDWIG0 (ORCPT ); Wed, 23 Apr 2014 04:06:26 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:64142 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754103AbaDWIFe (ORCPT ); Wed, 23 Apr 2014 04:05:34 -0400 Received: by mail-pa0-f47.google.com with SMTP id lj1so520047pab.20 for ; Wed, 23 Apr 2014 01:05:33 -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=FBNJ+Y33tQoKMTmYTgO9XwcF1swECYY+Z+5bB+6NYp1WcXA4R/gkp/ob58CZS0fzuy DjwuciQ/aI2UNbC8E8JFFwsU0FAuzNMsgjh0MM1KlakZ2pv8cLH2ajcDgKvqCZMHkifn 3RSUSFgxy0INLfepVcYCutFA9eHkBZLxxPbxGqBnX6rNhmpZAfR4jJwie24GvjmUysYk //VISgl93FqQpeaP3hmhQCoET75mRyhIG0cD5mqZlFD1GiaBY7MYAvTuw0tk6Yw2DNSQ MKSLz8SsmbuJbBGrFB5fnspvS/UZjXSjLxrQ1gVUklZIhm8xDBlcViDh28eVsi7Pm0kL q4hg== X-Gm-Message-State: ALoCoQlSheIA2dsvXIUllCU0fqBsSociHBur5T1oNXKtkQDRWPeIZiamcufChYkC2YI6g0De0SyM 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 Cc: broonie@kernel.org, lgirdwood@gmail.com, sbkim73@samsung.com, jassisinghbrar@gmail.com, kgene.kim@samsung.com Subject: [PATCH] ASoC: SAMSUNG: Don't clear clock setting during i2s_startup 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.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);