From patchwork Fri Mar 9 17:48:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10271465 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 2E5F4603B5 for ; Fri, 9 Mar 2018 17:51:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C02529E0F for ; Fri, 9 Mar 2018 17:51:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1063929EA9; Fri, 9 Mar 2018 17:51:44 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A817529E24 for ; Fri, 9 Mar 2018 17:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932133AbeCIRvn (ORCPT ); Fri, 9 Mar 2018 12:51:43 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:29499 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932594AbeCIRuJ (ORCPT ); Fri, 9 Mar 2018 12:50:09 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180309175007epoutp0343d21a83bbb8c1e96fefe93777762624~aUdb2z6oH1731017310epoutp03S; Fri, 9 Mar 2018 17:50:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180309175007epoutp0343d21a83bbb8c1e96fefe93777762624~aUdb2z6oH1731017310epoutp03S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520617807; bh=YmnA8r/Dk0ZjayVpYRgWnW7AJciOOfvPUwKToIblibQ=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Axa1oaXAkj6Xvt9F7Dh8MrbThJCF4z85sE+sPijoAKIqDVsSfGm8lpbx2/thR6uTc Va9MNYqDJ1PkBgnSZsbArngrnKOGgetLaGLHsDwqcou+qo9odXOAZQ2rc9WV9AOkEl 4EPCL4V1M6lDGPCWk2yXMwH5iVSD7lhUKU1rB1HM= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180309175007epcas1p32145f1902a210d56a28e13f51264a5f8~aUdbr9tkj0662906629epcas1p3F; Fri, 9 Mar 2018 17:50:07 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 02.FF.04037.F49C2AA5; Sat, 10 Mar 2018 02:50:07 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180309175007epcas1p47d08eaa5611bf2f686065ca681ffde52~aUdbK33Q12065120651epcas1p4V; Fri, 9 Mar 2018 17:50:07 +0000 (GMT) X-AuditID: b6c32a39-47fff70000000fc5-18-5aa2c94f866a Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 34.16.03826.E49C2AA5; Sat, 10 Mar 2018 02:50:07 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P5C0033645R9230@mmp2.samsung.com>; Sat, 10 Mar 2018 02:50:06 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, krzk@kernel.org, sbkim73@samsung.com, alsa-devel@alsa-project.org, robh+dt@kernel.org, devicetree@vger.kernel.org, javierm@redhat.com, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Sylwester Nawrocki Subject: [PATCH v2 4/7] ASoC: samsung: i2s: Fix rclk_srcrate handling Date: Fri, 09 Mar 2018 18:48:55 +0100 Message-id: <20180309174858.24017-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20180309174858.24017-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsWy7bCmnq7/yUVRBi1tmhZXLh5istg4Yz2r xdSHT9gs5h85x2qxcNpyRovz5zewW3y70sFkMeP8PiaLtUfuslu07j3CbnH4TTurxcUVX5gc eDw2fG5i89g56y67x6ZVnWwe7/ddZfPo27KK0ePzJrkAtigum5TUnMyy1CJ9uwSujKl/9rEU fOGouD51G1MD4zr2LkZODgkBE4nJH54zdjFycQgJ7GCU2H1qKSuE851R4tHVP3BVb+8uZYJI bGCUOHXwE5Tzi1Fi849FrCBVbAKGEr1H+xhBbBEBMYnbczqZQYqYBVYxSay6v5YNJCEs4Crx fMUlMJtFQFWib9MaFhCbV8BaYt+ZFcwQ6+Ql3i+4DzaIU8BGorflIdiBEgI72CR+TNsN5HAA OS4SezcFQ9QLS7w6voUdIiwtcemoLUS4WqKzrYsdorWFUeLPNIi9EkC7Dh+/CHY0swCfxLuv PawQvbwSHW1CECUeEpN3vof63lFi6uqD0GDpB4bRvEksExilFjAyrGIUSy0ozk1PLTYsMNUr TswtLs1L10vOz93ECI5pLcsdjMfO+RxiFOBgVOLh3TF1UZQQa2JZcWXuIUYJDmYlEd73NUAh 3pTEyqrUovz4otKc1OJDjNIcLErivAEB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msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180309175007epcas1p47d08eaa5611bf2f686065ca681ffde52 X-RootMTR: 20180309175007epcas1p47d08eaa5611bf2f686065ca681ffde52 References: <20180309174858.24017-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the RCLK clock may be updated through the common clk API before each snd_soc_dai_ops::trigger call, it is not enough to update i2s->rclk_srcrate only once after it has been initially set to 0. To avoid wrong PSR values we always get RCLK frequency from the CLK_I2S_RCLK_SRC clock, when that clock is available. Fixes: e1417fdf3011 "ASoC: samsung: i2s: Ensure the RCLK rate is properly determined" Signed-off-by: Sylwester Nawrocki --- Changes since v1: - none. --- sound/soc/samsung/i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index c65227e2561c..97fe3f9352c5 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -897,7 +897,7 @@ static int config_setup(struct i2s_dai *i2s) if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { struct clk *rclksrc = i2s->clock[CLK_I2S_RCLK_SRC]; - if (i2s->rclk_srcrate == 0 && rclksrc && !IS_ERR(rclksrc)) + if (rclksrc && !IS_ERR(rclksrc)) i2s->rclk_srcrate = clk_get_rate(rclksrc); psr = i2s->rclk_srcrate / i2s->frmclk / rfs;