From patchwork Thu Feb 7 17:00:12 2019 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: 10801553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 737EA1575 for ; Thu, 7 Feb 2019 17:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D17A2E285 for ; Thu, 7 Feb 2019 17:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 517E82E25C; Thu, 7 Feb 2019 17:02:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E7D602E2C2 for ; Thu, 7 Feb 2019 17:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbfBGRBE (ORCPT ); Thu, 7 Feb 2019 12:01:04 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:32013 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbfBGRBC (ORCPT ); Thu, 7 Feb 2019 12:01:02 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190207170059epoutp0324555212c5b5a8791511f30bbb26779c~BI5K7Hotd2488224882epoutp03d; Thu, 7 Feb 2019 17:00:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190207170059epoutp0324555212c5b5a8791511f30bbb26779c~BI5K7Hotd2488224882epoutp03d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549558859; bh=z+2XzIlWDYBCqalO/VoQ/cstpDjX/5UQBwVI2/feHn4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ZMy46AnvkxqEsjzsh2EXA9cnxnmKkhSU7gTKXl4lUNHO/eNNLV6tbo3hPkgpqBdtW 18d1NKX9G+oRQyLuh75ZlpwH8xXKHP+IEt1fYCLK3waSQD4xR6V7hDG2wVRJKzU5Qs hC+XPLU0c3OwO8zvazNjdiSmjSNOjVgjIM8AoDBE= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190207170059epcas1p1ebfe29d0f3a0aa360595f54dcf68a488~BI5KsTfb71074510745epcas1p1M; Thu, 7 Feb 2019 17:00:59 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id D2.AE.04206.B446C5C5; Fri, 8 Feb 2019 02:00:59 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190207170058epcas1p4e2fadf4aae2ece3c47c0750a094a4fbb~BI5JmBIF12153821538epcas1p4f; Thu, 7 Feb 2019 17:00:58 +0000 (GMT) X-AuditID: b6c32a39-d7dff7000000106e-48-5c5c644b7751 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F9.C8.04015.A446C5C5; Fri, 8 Feb 2019 02:00:58 +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 <0PMK00MP9F8VXL10@mmp1.samsung.com>; Fri, 08 Feb 2019 02:00:58 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, krzk@kernel.org, sbkim73@samsung.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH 04/22] ASoC: samsung: i2s: Fix prescaler setting for the secondary DAI Date: Thu, 07 Feb 2019 18:00:12 +0100 Message-id: <20190207170028.720-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190207170028.720-1-s.nawrocki@samsung.com> MIME-version: 1.0 Content-transfer-encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmrq53SkyMQd89NYsrFw8xWWycsZ7V YurDJ2wW589vYLf4dqWDyeLyrjlsFjPO72OyWHvkLrvF4TftrBYXV3xhcuDy2PC5ic1j56y7 7B6bVnWyefRtWcXo8XmTXABrFJdNSmpOZllqkb5dAldGy8F5jAUb+SoOX+xjbmB8wN3FyMkh IWAi0XCji7GLkYtDSGAHo8TZH2dYIZzvjBLf715mham6uXcDO0RiN6PE4fkPWSCcX4wSk1p3 sIFUsQkYSvQe7WMEsUUExCRuz+lkBiliFmhhkpgzdymQw8EhLBAh8eiTDUgNi4CqxIc/fewg Nq+ApUTroQmMENvkJc73rgOLcwpYSdzav4MFokZQ4sfke2A2M1DNwSvPwY6QEDjAJnHzynwW iGYXidUv97KB7JIQkJa4dNQWIlwtsWt7NzNEfQejRMuF7cwQCWuJw8cvskIM5ZN497WHFaKX V6KjTQiixENiaetaaLD0MkqsPTqTbQKj1CwkN81CctMCRqZVjGKpBcW56anFhgWmesWJucWl eel6yfm5mxjBUa5luYPx2DmfQ4wCHIxKPLwXtGNihFgTy4orcw8xSnAwK4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190207170058epcas1p4e2fadf4aae2ece3c47c0750a094a4fbb CMS-TYPE: 101P X-CMS-RootMailID: 20190207170058epcas1p4e2fadf4aae2ece3c47c0750a094a4fbb References: <20190207170028.720-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 Make sure i2s->rclk_srcrate is properly initialized also during playback through the secondary DAI. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 9d3dcb2204fe..d5ddad23d5e5 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -604,6 +604,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct i2s_dai *i2s = to_info(dai); + struct i2s_dai *other = get_other_dai(i2s); int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave; u32 mod, tmp = 0; unsigned long flags; @@ -661,7 +662,8 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, * CLK_I2S_RCLK_SRC clock is not exposed so we ensure any * clock configuration assigned in DT is not overwritten. */ - if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL) + if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL && + other->clk_data.clks == NULL) i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0, 0, SND_SOC_CLOCK_IN); break; @@ -699,6 +701,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct i2s_dai *i2s = to_info(dai); + struct i2s_dai *other = get_other_dai(i2s); u32 mod, mask = 0, val = 0; struct clk *rclksrc; unsigned long flags; @@ -784,6 +787,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, i2s->frmclk = params_rate(params); rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC]; + if (!rclksrc || IS_ERR(rclksrc)) + rclksrc = other->clk_table[CLK_I2S_RCLK_SRC]; + if (rclksrc && !IS_ERR(rclksrc)) i2s->rclk_srcrate = clk_get_rate(rclksrc);