From patchwork Wed Mar 7 17:01:20 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: 10264497 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 726DD602BD for ; Wed, 7 Mar 2018 17:01:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B6782970E for ; Wed, 7 Mar 2018 17:01:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F86D29734; Wed, 7 Mar 2018 17:01:37 +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 0FD402970E for ; Wed, 7 Mar 2018 17:01:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933487AbeCGRBf (ORCPT ); Wed, 7 Mar 2018 12:01:35 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:38697 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933468AbeCGRBe (ORCPT ); Wed, 7 Mar 2018 12:01:34 -0500 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180307170132epoutp047b24b95c64115191527025f1e218b2d7~ZsgcTRn6_1951519515epoutp04h; Wed, 7 Mar 2018 17:01:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180307170132epoutp047b24b95c64115191527025f1e218b2d7~ZsgcTRn6_1951519515epoutp04h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520442092; bh=RHb0Wlp8gavrbiyt/PlwIRbjQcxnfmYxbL9gMMREzM8=; h=From:To:Cc:Subject:Date:References:From; b=gYIPcGLkVnGBRu7MkgPHZ9AaVFpbKYumj3LOjiizOK7BWH1/MIsmf/A+sGPtzLlJj A4J+Z6HBdM86rYBDO2oObGzvII0Gp0qu9nTdaJ1UlAsU0iTtVUlHzbXgeTc+/7Avfc PDwiIbtAViars94zQXKxCi0JCNv2GiwbmvUASPGQ= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180307170132epcas1p4ecac17e37ced5ac1bc6911ed84d6449f~Zsgbsc9kC0065500655epcas1p4s; Wed, 7 Mar 2018 17:01:32 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id D0.25.04037.BEA10AA5; Thu, 8 Mar 2018 02:01:31 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180307170131epcas1p3875d351d5469f8fbfb1135b3e41f62df~ZsgbNrVLw2221622216epcas1p3f; Wed, 7 Mar 2018 17:01:31 +0000 (GMT) X-AuditID: b6c32a39-467ff70000000fc5-1d-5aa01aebb0d4 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C6.8E.03826.BEA10AA5; Thu, 8 Mar 2018 02:01:31 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P58009NUCMAPT10@mmp1.samsung.com>; Thu, 08 Mar 2018 02:01:31 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Sylwester Nawrocki Subject: [PATCH 2/6] ASoC: samsung: i2s: Fix rclk_srcrate handling Date: Wed, 07 Mar 2018 18:01:20 +0100 Message-id: <20180307170120.13943-1-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsWy7bCmge5rqQVRBqce6llcuXiIyWLjjPWs FlMfPmGz+Halg8lixvl9TBZrj9xltzj8pp3Vgd1jw+cmNo+ds+6ye2xa1cnm0bdlFaPH501y AaxRXDYpqTmZZalF+nYJXBmzf55lL7jCUfFp1i+mBsYZ7F2MnBwSAiYSGw5PZe1i5OIQEtjB KHHqSzsLhPOdUWLjuq9sMFVr1jyHqtrNKNHR/4wJwvnFKHF+/RRWkCo2AUOJ3qN9jCC2iICY xO05ncwgRcwCexglrjavYwZJCAs4SRx/1Q5UxMHBIqAqMblNAyTMK2At0fD/BtRN8hLvF9xn BOmVEPjIKjF/y1aoM1wkVh69wQhhC0u8Or6FHWSOhIC0xKWjthDhaonOti52iN4WRok/0y5B 9VpLHD5+EexQZgE+iXdfe1ghenklOtqEIEo8JI7sWswEYTtK9Mz8xAJiCwnESszr38A2gVFy ASPDKkax1ILi3PTUYsMCU73ixNzi0rx0veT83E2M4OjTstzBeOyczyFGAQ5GJR7eAz/nRwmx JpYVV+YeYpTgYFYS4X3yByjEm5JYWZValB9fVJqTWnyIUZqDRUmcNyDAJUpIID2xJDU7NbUg tQgmy8TBKdXAuLVxcht/31GeCydi4pxu/Lz/mZmlxNM82dYtR29e6u+rsr9/LX34NCc56HF6 yPmO/MOeLCZbTqkV+E7wL58f8j/pH89t59uBPulPm1fZTZ72w6aZ++JMD6WKB2UbvXtrApN4 V6bti9c7ML3/3DaGE3qir9+qO7DVnExzP7gywfrz7cWdP8SklFiKMxINtZiLihMBt81Lc7oC AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t9jAd3XUguiDLaclra4cvEQk8XGGetZ LaY+fMJm8e1KB5PFjPP7mCzWHrnLbnH4TTurA7vHhs9NbB47Z91l99i0qpPNo2/LKkaPz5vk AlijuGxSUnMyy1KL9O0SuDJm/zzLXnCFo+LTrF9MDYwz2LsYOTkkBEwk1qx5ztrFyMUhJLCT UWLNoi2sIAkhgV+MEo/fmoLYbAKGEr1H+xhBbBEBMYnbczqZQRqYBfYwSvTvaAebJCzgJHH8 VTtQEQcHi4CqxOQ2DZAwr4C1RMP/G1DL5CXeL7jPOIGRawEjwypGydSC4tz03GKjAsO81HK9 4sTc4tK8dL3k/NxNjMCg2HZYq28H4/0l8YcYBTgYlXh4Jf7MjxJiTSwrrsw9xCjBwawkwvsE JMSbklhZlVqUH19UmpNafIhRmoNFSZz3dt6xSCGB9MSS1OzU1ILUIpgsEwenVANj/rMfkjZT lGapeF/yKme+nvDx90WJ7Ls8zhv4Z58zZ3q12/1j+vkLido38r9kxW56uik5g6v+25ILwRa+ q17fe3Vd/apcwPeVn6RMJL53/xX2nnfjdQlj5q4/DXdt+UO/L5WTalIw6rb8UOKxvk9lirKw 69P8Q1Nf7Po/Z9vfjbMPejre/JY1Q4mlOCPRUIu5qDgRAAiQQEsGAgAA X-CMS-MailID: 20180307170131epcas1p3875d351d5469f8fbfb1135b3e41f62df X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180307170131epcas1p3875d351d5469f8fbfb1135b3e41f62df X-RootMTR: 20180307170131epcas1p3875d351d5469f8fbfb1135b3e41f62df References: 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 the RCLK frequency from the CLK_I2S_RCLK_SRC, when this clock is available. Fixes: e1417fdf3011 "ASoC: samsung: i2s: Ensure the RCLK rate is properly determined" Signed-off-by: Sylwester Nawrocki --- 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 b6407fbabdd1..f914ed45db7d 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -887,7 +887,7 @@ static int config_setup(struct i2s_dai *i2s) if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { struct clk *rclksrc = i2s->clk_table[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;