From patchwork Tue Feb 12 18:03:22 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: 10808603 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 7020E1575 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E39B2C2F1 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50F6C2C39D; Tue, 12 Feb 2019 19:21:25 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 174F02C2F1 for ; Tue, 12 Feb 2019 19:21:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6051A2678FD; Tue, 12 Feb 2019 19:04:54 +0100 (CET) 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 DA56326782E; Tue, 12 Feb 2019 19:04:50 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 21D3E267482 for ; Tue, 12 Feb 2019 19:04:45 +0100 (CET) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180442epoutp014b59f453913bcb32b06d5f37974de684~Cr-OrSlqI1899118991epoutp01p; Tue, 12 Feb 2019 18:04:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180442epoutp014b59f453913bcb32b06d5f37974de684~Cr-OrSlqI1899118991epoutp01p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994682; bh=q9Hr6cqUHu60VZm6oGMQa2TMYD/ekH2g/Wu0LvH9nUg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=gayUpsTpezkR/nxSWb6Lz2rAQrc/BJ68I9bPaiSQi9xuZaHHslxzEB6WI4ALl/C0L uq0aiasA6QMrJ660Iaq0toW93PUf4PEEkFmf8XvpRCF2y6lGUbOOb/LGX5JTkqX9PY mKtC+9F/zSHo+g86kOGP4ASUc3zGvN71FUbSic7c= Received: from epsmges2p4.samsung.com (unknown [182.195.42.72]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20190212180442epcas2p484a1e7a6cee09337b09c27c5c95f04a8~Cr-OInO4N3062430624epcas2p4k; Tue, 12 Feb 2019 18:04:42 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id A0.1D.04093.ABA036C5; Wed, 13 Feb 2019 03:04:42 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180441epcas2p120393a84b851b38023d197ba2b0af820~Cr-NsegJo0768707687epcas2p1n; Tue, 12 Feb 2019 18:04:41 +0000 (GMT) X-AuditID: b6c32a48-173ff70000000ffd-b6-5c630aba8ff9 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id A6.30.03689.9BA036C5; Wed, 13 Feb 2019 03:04:41 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:04:41 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:22 +0100 Message-id: <20190212180342.32040-2-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7bCmhe4uruQYgwUnuS2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZO6/xFXTKV8zf0cPUwLhFsouRk0NC wETiz/VVLF2MXBxCAjsYJTavucQIkhAS+M4o8eAiL0zRz9Ov2SGKNjBKLDt/gQnC+cUoMX/a dRaQKjYBQ4neo31g3SICYhK353QygxQxC7QwScyZuxTI4eAQFgiVePE5FKSGRUBV4u6la+wg Nq+AtcT+mx/YILbJS5zvXQcW5xSwkXi28BsLRI2gxI/J98BsZqCag1ees0DUH2GTuHC2CsJ2 kZj4/gsThC0t8WzVRkYIu1pi1/ZusHskBDoYJVoubGeGSFhLHD5+kRViKJ9Ex+G/7CB3Sgjw SnS0CUGUeEisXbQB6uF+RomPK6+wTGCUmoXkpllIblrAyLSKUSy1oDg3PbXYqMBErzgxt7g0 L10vOT93EyM4wrU8djAeOOdziFGAg1GJh3fF0aQYIdbEsuLK3EOMEhzMSiK8aczJMUK8KYmV ValF+fFFpTmpxYcYpTlYlMR5H0rPjRYSSE8sSc1OTS1ILYLJMnFwSjUwuoh8vjCrY7XzqR3p waevPfrKWV69QFsqo2b9lzv8x9TYbzeoFm9rMPf3vXLg6bxozdx3DzXFfs0+dsFFeovgX81M u33Xb9RdXFb2s/buNBHxasUX9e982Xc6nFMSnMDUL5J2jEXd9lfXyuA/F87tDnUSPrf/ReWT 2HVchx1O1JafsGeYzHz1ixJLcUaioRZzUXEiAPYPuGLsAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd2dXMkxBl9f61lcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgydl7jK+iUr5i/o4epgXGLZBcjJ4eE gInEz9Ov2bsYuTiEBNYxSjyd3s8G4fxilHh/Zg0bSBWbgKFE79E+RhBbREBM4vacTmaQImaB JiaJXbcvsoMkhAVCJY6fesEEYrMIqErcvXQNLM4rYC2x/+YHNoh18hLne9eBxTkFbCSeLfzG 0sXIAbTNWuLKJluIckGJH5PvsYDYzEDlB688Z5nAyDcLSWoWktQCRqZVjJKpBcW56bnFRgVG eanlesWJucWleel6yfm5mxiBIbztsFb/DsbHS+IPMQpwMCrx8K44mhQjxJpYVlyZe4hRgoNZ SYQ3jTk5Rog3JbGyKrUoP76oNCe1+BCjNAeLkjgvf/6xSCGB9MSS1OzU1ILUIpgsEwenVAPj kmMnf52NifddveuVsbnib8H0pzeLE5xdJ21Kiz7wbeaus6nC/57uTv/YOu/CzmKXCXMUdQ+V 9S9d4rp399zMTucy83fn2uptIya9K1U4dEuweb98TPa8A9rSIvwcJ2zWRIvzuczcfdtuHdOc Hy+rE7bJb92z8oHMdq6w1TYbpJm6gtZ6XAu8pMRSnJFoqMVcVJwIAAkf+mJdAgAA X-CMS-MailID: 20190212180441epcas2p120393a84b851b38023d197ba2b0af820 CMS-TYPE: 102P X-CMS-RootMailID: 20190212180441epcas2p120393a84b851b38023d197ba2b0af820 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 01/21] ASoC: samsung: i2s: Restore support for the secondary PCM 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces again registration of additional platform device as we still need it for registering the secondary dmaengine PCM component. This patch in most part is a revert of changes done in commit be2c92eb64023e ("ASoC: samsung: i2s: Remove virtual device for secondary DAI") Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 52 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 4bc3b181f1c2..273620914471 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -109,6 +109,7 @@ static DEFINE_SPINLOCK(lock); struct samsung_i2s_priv { struct platform_device *pdev; + struct platform_device *pdev_sec; /* Spinlock protecting access to the device's registers */ spinlock_t spinlock; @@ -1312,6 +1313,34 @@ static int i2s_register_clock_provider(struct platform_device *pdev) return ret; } +/* Create platform device for the secondary PCM */ +static int i2s_create_secondary_device(struct samsung_i2s_priv *priv) +{ + struct platform_device *pdev; + int ret; + + pdev = platform_device_register_simple("samsung-i2s-sec", -1, NULL, 0); + if (!pdev) + return -ENOMEM; + + ret = device_attach(&pdev->dev); + if (ret < 0) { + dev_info(&pdev->dev, "device_attach() failed\n"); + return ret; + } + + priv->pdev_sec = pdev; + + return 0; +} + +static void i2s_delete_secondary_device(struct samsung_i2s_priv *priv) +{ + if (priv->pdev_sec) { + platform_device_del(priv->pdev_sec); + priv->pdev_sec = NULL; + } +} static int samsung_i2s_probe(struct platform_device *pdev) { struct i2s_dai *pri_dai, *sec_dai = NULL; @@ -1329,13 +1358,15 @@ static int samsung_i2s_probe(struct platform_device *pdev) i2s_dai_data = (struct samsung_i2s_dai_data *) platform_get_device_id(pdev)->driver_data; + /* Nothing to do if it is the secondary device probe */ + if (!i2s_dai_data) + return 0; + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; quirks = np ? i2s_dai_data->quirks : i2s_pdata->type.quirks; - quirks &= ~(QUIRK_SEC_DAI | QUIRK_SUPPORTS_IDMA); - num_dais = (quirks & QUIRK_SEC_DAI) ? 2 : 1; priv->pdev = pdev; @@ -1425,8 +1456,13 @@ static int samsung_i2s_probe(struct platform_device *pdev) sec_dai->pri_dai = pri_dai; pri_dai->sec_dai = sec_dai; - ret = samsung_asoc_dma_platform_register(&pdev->dev, - sec_dai->filter, "tx-sec", NULL, NULL); + ret = i2s_create_secondary_device(priv); + if (ret < 0) + goto err_disable_clk; + + ret = samsung_asoc_dma_platform_register(&priv->pdev_sec->dev, + sec_dai->filter, "tx-sec", NULL, + &pdev->dev); if (ret < 0) goto err_disable_clk; @@ -1461,6 +1497,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); err_disable_clk: clk_disable_unprepare(pri_dai->clk); + i2s_delete_secondary_device(priv); return ret; } @@ -1469,12 +1506,17 @@ static int samsung_i2s_remove(struct platform_device *pdev) struct samsung_i2s_priv *priv = dev_get_drvdata(&pdev->dev); struct i2s_dai *pri_dai = samsung_i2s_get_pri_dai(&pdev->dev); + /* The secondary device has no driver data assigned */ + if (!priv) + return 0; + pm_runtime_get_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); i2s_unregister_clock_provider(pdev); clk_disable_unprepare(pri_dai->clk); pm_runtime_put_noidle(&pdev->dev); + i2s_delete_secondary_device(priv); return 0; } @@ -1572,6 +1614,8 @@ static const struct platform_device_id samsung_i2s_driver_ids[] = { { .name = "samsung-i2s", .driver_data = (kernel_ulong_t)&i2sv3_dai_type, + }, { + .name = "samsung-i2s-sec", }, {}, }; From patchwork Tue Feb 12 18:03:23 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: 10808605 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 90C841390 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F6152C392 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73A242C2F1; Tue, 12 Feb 2019 19:21:25 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2457B2C392 for ; Tue, 12 Feb 2019 19:21:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5901B267905; Tue, 12 Feb 2019 19:04:56 +0100 (CET) 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 BC2BF26789E; Tue, 12 Feb 2019 19:04:51 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id 10261267783 for ; Tue, 12 Feb 2019 19:04:48 +0100 (CET) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190212180446epoutp024a3e30da672a930af740052c1694967d~Cr-RxF-3d2786327863epoutp02y; Tue, 12 Feb 2019 18:04:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190212180446epoutp024a3e30da672a930af740052c1694967d~Cr-RxF-3d2786327863epoutp02y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994686; bh=UQOGlCQYEWvdf5BnPLhNmIo2HtWFTdnXgP/0q22nlSc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=eNZ0A+/t4z1xSGF/b++VECAXqv7BCzBxc8KwqmpZHWxYaaAzhGzfeDjW1CnG+nUDV 89V2TYShs/hDPWCSC+ekoOSzEyKGdpnK62p/u4cq8pDLHu4plvnOhbsWW+89gZFVLg iSpEK0UW0TRGnmQkZywicDiTvfaQkcCENpdZGh5M= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180445epcas1p42abef04ceac220271aa436a3ad64138c~Cr-RU8Lz-0414104141epcas1p4H; Tue, 12 Feb 2019 18:04:45 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id D6.7E.04206.DBA036C5; Wed, 13 Feb 2019 03:04:45 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180445epcas1p15aebbe7d7b11ce36f5d20c6534ba5903~Cr-RDOym11361213612epcas1p1t; Tue, 12 Feb 2019 18:04:45 +0000 (GMT) X-AuditID: b6c32a39-d7dff7000000106e-b4-5c630abdf73a Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 70.11.04015.DBA036C5; Wed, 13 Feb 2019 03:04:45 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:04:45 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:23 +0100 Message-id: <20190212180342.32040-3-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7bCmge5eruQYg7Xz1S2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZ/Q+nMxf8sqq43d3M1sD4w6CLkZND QsBE4srOyyxdjFwcQgI7GCU+7LvJBuF8Z5SY9PUGC0xV/9cN7BCJDSCJN8wQzi9GiYa7f5hA qtgEDCV6j/YxgtgiAmISt+d0ghUxC7QwScyZu5QZJCEskCZx8PhnVhCbRUBVYuK+i2AreAWs JTb+PwC1Tl7ifO86dhCbU8BG4tnCb1A1ghI/Jt8Ds5mBag5eeQ52uITAATaJpfs62SGaXST2 HpkBtIADyJaWuHTUFiJcLbFrezczRH0Ho0TLhe3MEAlricPHL7JCDOWTePe1B6qXV6KjTQii xENi+evvUO/3M0r82rCCdQKj1CwkN81CctMCRqZVjGKpBcW56anFhgWmesWJucWleel6yfm5 mxjBca5luYPx2DmfQ4wCHIxKPLwrjibFCLEmlhVX5h5ilOBgVhLhTWNOjhHiTUmsrEotyo8v Ks1JLT7EKM3BoiTOu97BOUZIID2xJDU7NbUgtQgmy8TBKdXAmHHgb1G4TP35amkW1r+cGVFH nxpPnm0VpcIoc7f6lvL+p5Z1yxgm5wcXdH/sWSDt9D3FaVbOpCKmLduuyNQwvUtntliRsjP5 hsxprR/VUVKb+v/pfH6Uu1c98nfsU8F9Hc6W+pLXv2c+WRPTeIoh2zym0W+f06G9Z49fuPvb +abKV45nk3fHK7EUZyQaajEXFScCALPqkirvAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd29XMkxBtM/iVpcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgy+h9OZy74ZVVxu7uZrYHxh0EXIyeH hICJRP/XDexdjFwcQgLrGCVOT33HDOH8YpR42dzFBlLFJmAo0Xu0jxHEFhEQk7g9pxOsiFmg iUli1+2L7CAJYYE0iVeT1oM1sAioSkzcd5EFxOYVsJbY+P8AC8Q6eYnzvevA6jkFbCSeLfwG FOcA2mYtcWWTLUS5oMSPyffAypmByg9eec4ygZFvFpLULCSpBYxMqxglUwuKc9Nzi40KDPNS y/WKE3OLS/PS9ZLzczcxAoN422Gtvh2M95fEH2IU4GBU4uFdcTQpRog1say4MvcQowQHs5II bxpzcowQb0piZVVqUX58UWlOavEhRmkOFiVx3tt5xyKFBNITS1KzU1MLUotgskwcnFINjIqR RouF9KTL+KzkPgo+0dDbdUtx6T9uh6/sH9fN/nwq7zL35Gt+J09pMv1u6p6t8el4baKplJLF T7Yftb0GLKtKAmcGOywOrJn1NWLL72vJju2W79a9rTkrliq/19c+rDnsytbUy9IOxpG3t+2b 7vM4lNWxY39F/twNtqtX173pr9Pu9/9wRYmlOCPRUIu5qDgRABrZfgZeAgAA X-CMS-MailID: 20190212180445epcas1p15aebbe7d7b11ce36f5d20c6534ba5903 CMS-TYPE: 101P X-CMS-RootMailID: 20190212180445epcas1p15aebbe7d7b11ce36f5d20c6534ba5903 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 02/21] ASoC: samsung: i2s: Move clk supplier data to common driver data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Having the clocks provider data in struct samsung_i2s_priv, i.e. per the I2S controller instance, rather than per CPU DAI better models the hardware and simplifies the code a little. The clock provider is common for both DAIs. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 68 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 273620914471..fffc76ab60da 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -99,9 +99,7 @@ struct i2s_dai { spinlock_t *lock; - /* Below fields are only valid if this is the primary FIFO */ - struct clk *clk_table[3]; - struct clk_onecell_data clk_data; + struct samsung_i2s_priv *priv; }; /* Lock for cross i/f checks */ @@ -118,6 +116,10 @@ struct samsung_i2s_priv { struct i2s_dai *dai; struct snd_soc_dai_driver *dai_drv; int num_dais; + + /* The clock provider's data */ + struct clk *clk_table[3]; + struct clk_onecell_data clk_data; }; struct i2s_dai *samsung_i2s_get_pri_dai(struct device *dev) @@ -625,11 +627,10 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, return ret; } -static int i2s_set_fmt(struct snd_soc_dai *dai, - unsigned int fmt) +static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); 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; @@ -687,8 +688,7 @@ 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 && - other->clk_data.clks == NULL) + if (i2s->rclk_srcrate == 0 && priv->clk_data.clks == NULL) i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0, 0, SND_SOC_CLOCK_IN); break; @@ -725,8 +725,8 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, static int i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(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; @@ -811,10 +811,7 @@ 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]; - + rclksrc = priv->clk_table[CLK_I2S_RCLK_SRC]; if (rclksrc && !IS_ERR(rclksrc)) i2s->rclk_srcrate = clk_get_rate(rclksrc); @@ -1221,31 +1218,30 @@ static int i2s_runtime_resume(struct device *dev) } #endif /* CONFIG_PM */ -static void i2s_unregister_clocks(struct i2s_dai *i2s) +static void i2s_unregister_clocks(struct samsung_i2s_priv *priv) { int i; - for (i = 0; i < i2s->clk_data.clk_num; i++) { - if (!IS_ERR(i2s->clk_table[i])) - clk_unregister(i2s->clk_table[i]); + for (i = 0; i < priv->clk_data.clk_num; i++) { + if (!IS_ERR(priv->clk_table[i])) + clk_unregister(priv->clk_table[i]); } } -static void i2s_unregister_clock_provider(struct platform_device *pdev) +static void i2s_unregister_clock_provider(struct samsung_i2s_priv *priv) { - struct i2s_dai *i2s = samsung_i2s_get_pri_dai(&pdev->dev); - - of_clk_del_provider(pdev->dev.of_node); - i2s_unregister_clocks(i2s); + of_clk_del_provider(priv->pdev->dev.of_node); + i2s_unregister_clocks(priv); } -static int i2s_register_clock_provider(struct platform_device *pdev) + +static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) { const char * const i2s_clk_desc[] = { "cdclk", "rclk_src", "prescaler" }; const char *clk_name[2] = { "i2s_opclk0", "i2s_opclk1" }; const char *p_names[2] = { NULL }; - struct device *dev = &pdev->dev; + struct device *dev = &priv->pdev->dev; struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); const struct samsung_i2s_variant_regs *reg_info = i2s->variant_regs; const char *i2s_clk_name[ARRAY_SIZE(i2s_clk_desc)]; @@ -1277,37 +1273,37 @@ static int i2s_register_clock_provider(struct platform_device *pdev) u32 val = readl(i2s->addr + I2SPSR); writel(val | PSR_PSREN, i2s->addr + I2SPSR); - i2s->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev, + priv->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev, i2s_clk_name[CLK_I2S_RCLK_SRC], p_names, ARRAY_SIZE(p_names), CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, i2s->addr + I2SMOD, reg_info->rclksrc_off, 1, 0, i2s->lock); - i2s->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev, + priv->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev, i2s_clk_name[CLK_I2S_RCLK_PSR], i2s_clk_name[CLK_I2S_RCLK_SRC], CLK_SET_RATE_PARENT, i2s->addr + I2SPSR, 8, 6, 0, i2s->lock); p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR]; - i2s->clk_data.clk_num = 2; + priv->clk_data.clk_num = 2; } - i2s->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev, + priv->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev, i2s_clk_name[CLK_I2S_CDCLK], p_names[0], CLK_SET_RATE_PARENT, i2s->addr + I2SMOD, reg_info->cdclkcon_off, CLK_GATE_SET_TO_DISABLE, i2s->lock); - i2s->clk_data.clk_num += 1; - i2s->clk_data.clks = i2s->clk_table; + priv->clk_data.clk_num += 1; + priv->clk_data.clks = priv->clk_table; ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get, - &i2s->clk_data); + &priv->clk_data); if (ret < 0) { dev_err(dev, "failed to add clock provider: %d\n", ret); - i2s_unregister_clocks(i2s); + i2s_unregister_clocks(priv); } return ret; @@ -1426,6 +1422,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai->dma_capture.addr_width = 4; pri_dai->quirks = quirks; pri_dai->variant_regs = i2s_dai_data->i2s_variant_regs; + pri_dai->priv = priv; if (quirks & QUIRK_PRI_6CHAN) pri_dai->drv->playback.channels_max = 6; @@ -1454,6 +1451,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) sec_dai->quirks = quirks; sec_dai->idma_playback.addr = idma_addr; sec_dai->pri_dai = pri_dai; + sec_dai->priv = priv; pri_dai->sec_dai = sec_dai; ret = i2s_create_secondary_device(priv); @@ -1485,11 +1483,11 @@ static int samsung_i2s_probe(struct platform_device *pdev) pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); - ret = i2s_register_clock_provider(pdev); + ret = i2s_register_clock_provider(priv); if (ret < 0) goto err_disable_pm; - pri_dai->op_clk = clk_get_parent(pri_dai->clk_table[CLK_I2S_RCLK_SRC]); + pri_dai->op_clk = clk_get_parent(priv->clk_table[CLK_I2S_RCLK_SRC]); return 0; @@ -1513,7 +1511,7 @@ static int samsung_i2s_remove(struct platform_device *pdev) pm_runtime_get_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - i2s_unregister_clock_provider(pdev); + i2s_unregister_clock_provider(priv); clk_disable_unprepare(pri_dai->clk); pm_runtime_put_noidle(&pdev->dev); i2s_delete_secondary_device(priv); From patchwork Tue Feb 12 18:03:24 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: 10808607 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 C48C817E0 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B23EF2C395 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A65EE2C392; Tue, 12 Feb 2019 19:21:25 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3719B2C395 for ; Tue, 12 Feb 2019 19:21:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ECB92267910; Tue, 12 Feb 2019 19:04:58 +0100 (CET) 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 BFF492678D2; Tue, 12 Feb 2019 19:04:56 +0100 (CET) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by alsa0.perex.cz (Postfix) with ESMTP id 5630A2678D2 for ; Tue, 12 Feb 2019 19:04:53 +0100 (CET) Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190212180450epoutp047d61cdca3b165f86d59c697219bb1dac~Cr-V410rP1944219442epoutp04N; Tue, 12 Feb 2019 18:04:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190212180450epoutp047d61cdca3b165f86d59c697219bb1dac~Cr-V410rP1944219442epoutp04N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994690; bh=hDFH6nAvYV0mV9T/urICuXj+l++l2fNaDp5UXV8K44s=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ovhNKDzxmUvfKwcRFq3Dqye0wU3fQKkDBuPwwpQhl68IP2MOPurCPVLMwPxxtfzxr 68Ngass5aX08ACHY23DT3nbf5ZCwbp0hEO/TfKKuFl6x8kk1AjuPHbxFMCUU1Ppqs8 YzOxOBXqj/g8ERljkUK/WAtyQJtlzsxa7bqqmmmM= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190212180449epcas1p24f41ae3d67b8e495f616c010fee0e18b~Cr-Ur2knH0550005500epcas1p2v; Tue, 12 Feb 2019 18:04:49 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 28.7E.04206.1CA036C5; Wed, 13 Feb 2019 03:04:49 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190212180449epcas1p232598bff05255c7f9c582a16b27797c7~Cr-UZ2QE_1433014330epcas1p2F; Tue, 12 Feb 2019 18:04:49 +0000 (GMT) X-AuditID: b6c32a39-d7dff7000000106e-bc-5c630ac1dc83 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 21.11.04015.0CA036C5; Wed, 13 Feb 2019 03:04:48 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:04:48 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:24 +0100 Message-id: <20190212180342.32040-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmnu5BruQYg83t/BZXLh5istg4Yz2r xdSHT9gszp/fwG7x7UoHk8XlXXPYLGac38dksfbIXXaLw2/aWS0urvjC5MDlseFzE5vHzll3 2T02repk8+jbsorR4/MmuQDWKC6blNSczLLUIn27BK6MnfduMhYsFKr43vSQpYFxLn8XIyeH hICJxKmPT1i7GLk4hAR2MEpMm3iPDcL5ziix9GwbC0zVlPXd7BCJDYwSS163QlX9YpTY0P6H FaSKTcBQovdoHyOILSIgJnF7TiczSBGzQAuTxJy5S5lBEsIC4RILZj1lArFZBFQlVq09wAZi 8wpYS1y8/5gNYp28xPnedewgNqeAjcSzhd9YIGoEJX5MvgdmMwPVHLzynAVkgYTAETaJsydX AjVzADkuEt8PakKY0hKXjtpCjKyW2LW9mxmivINRouXCdmaIhLXE4eMXWSFm8km8+9rDCtHL K9HRJgRR4iHR+HopE8TD/YwSb/88YprAKDULyUmzkJy0gJFpFaNYakFxbnpqsWGBqV5xYm5x aV66XnJ+7iZGcJRrWe5gPHbO5xCjAAejEg/viqNJMUKsiWXFlbmHGCU4mJVEeNOYk2OEeFMS K6tSi/Lji0pzUosPMUpzsCiJ8653cI4REkhPLEnNTk0tSC2CyTJxcEo1MBp5zOZr2deddrii aRtv2aQZL46sTWK8v0U+R3GOzueZG3umb7ma+/Xw5WMcKZuDT4Q5um/0r2bbylu2cmN2/7np fR/OXXntFsjf1a3UZcss7PWza+/sgAN/dl2JWOK38KDVhv/n1vNl3HS7un5O/5+JvxanvNcT ZEjfv7qlaK7U0Q9GbpNW+SgrsRRnJBpqMRcVJwIAAoQpnO4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd0DXMkxBpuXm1tcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgydt67yViwUKjie9NDlgbGufxdjJwc EgImElPWd7N3MXJxCAmsY5T4PWcDM4Tzi1Fixrtz7CBVbAKGEr1H+xhBbBEBMYnbczrBipgF mpgkdt2+CFTEwSEsEC7x94gdSA2LgKrEqrUH2EBsXgFriYv3H7NBbJOXON+7Dmwmp4CNxLOF 31hAWoWAaq5ssoUoF5T4MfkeC4jNDFR+8MpzlgmMfLOQpGYhSS1gZFrFKJlaUJybnltsVGCY l1quV5yYW1yal66XnJ+7iREYwtsOa/XtYLy/JP4QowAHoxIP74qjSTFCrIllxZW5hxglOJiV RHjTmJNjhHhTEiurUovy44tKc1KLDzFKc7AoifPezjsWKSSQnliSmp2aWpBaBJNl4uCUamA0 OrdCk7v7pOmuHj9XP8+tVy2KCpT9lj4W/L1vjVkBi7oS++mNlyakPL1gdPRry46pbqtuiPUL fT1Y/NtWWO7ilgfrd7F93jrz0ePCLNddUoesqkSLpe/Z7riaGW32MyFjHY+26A/JrPJnmqey XK5u6H8f5i+s12r94/OEr6szJVYIdAdv3NmhxFKckWioxVxUnAgAEp2RF10CAAA= X-CMS-MailID: 20190212180449epcas1p232598bff05255c7f9c582a16b27797c7 CMS-TYPE: 101P X-CMS-RootMailID: 20190212180449epcas1p232598bff05255c7f9c582a16b27797c7 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 03/21] ASoC: samsung: i2s: Add widgets and routes for DPCM support 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds DAPM widgets required to model the internal mixer of the I2S controller merging audio streams from the primary and from the secondary PCM interface. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index fffc76ab60da..29bcfca20572 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1116,8 +1116,31 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { .delay = i2s_delay, }; +static const struct snd_soc_dapm_widget samsung_i2s_widgets[] = { + /* Backend DAI */ + SND_SOC_DAPM_AIF_OUT("Mixer DAI TX", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("Mixer DAI RX", NULL, 0, SND_SOC_NOPM, 0, 0), + + /* Playback Mixer */ + SND_SOC_DAPM_MIXER("Playback Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), +}; + +static const struct snd_soc_dapm_route samsung_i2s_dapm_routes[] = { + { "Playback Mixer", NULL, "Primary" }, + { "Playback Mixer", NULL, "Secondary" }, + + { "Mixer DAI TX", NULL, "Playback Mixer" }, + { "Playback Mixer", NULL, "Mixer DAI RX" }, +}; + static const struct snd_soc_component_driver samsung_i2s_component = { - .name = "samsung-i2s", + .name = "samsung-i2s", + + .dapm_widgets = samsung_i2s_widgets, + .num_dapm_widgets = ARRAY_SIZE(samsung_i2s_widgets), + + .dapm_routes = samsung_i2s_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(samsung_i2s_dapm_routes), }; #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ @@ -1129,6 +1152,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, int num_dais) { static const char *dai_names[] = { "samsung-i2s", "samsung-i2s-sec" }; + static const char *stream_names[] = { "Primary", "Secondary" }; struct snd_soc_dai_driver *dai_drv; struct i2s_dai *dai; int i; @@ -1158,6 +1182,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, dai_drv->playback.channels_max = 2; dai_drv->playback.rates = i2s_dai_data->pcm_rates; dai_drv->playback.formats = SAMSUNG_I2S_FMTS; + dai_drv->playback.stream_name = stream_names[i]; dai_drv->id = i + 1; dai_drv->name = dai_names[i]; From patchwork Tue Feb 12 18:03:25 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: 10808609 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 D56D818A6 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3D722C2F1 for ; Tue, 12 Feb 2019 19:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B68C42C3A2; Tue, 12 Feb 2019 19:21:25 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58F8C2C397 for ; Tue, 12 Feb 2019 19:21:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E1300267960; Tue, 12 Feb 2019 19:05:02 +0100 (CET) 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 447CF267911; Tue, 12 Feb 2019 19:04:58 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by alsa0.perex.cz (Postfix) with ESMTP id 858F1267910 for ; Tue, 12 Feb 2019 19:04:55 +0100 (CET) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190212180453epoutp0329e053f933681489a382eb301d098490~Cr-Yhs3Fu2783327833epoutp03b; Tue, 12 Feb 2019 18:04:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190212180453epoutp0329e053f933681489a382eb301d098490~Cr-Yhs3Fu2783327833epoutp03b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994693; bh=TtQx0G720ISMtzrhrffDlH6r+gc+72B0lf9feRyYaAs=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=BvOcpNFDVnOmvbBY7RTDQqZ824Svh3JrXr86sEH1Uw4IwCZO76Uz+sgweEhEf+MyA zZM43uKg0syIj/mE1m/QO7lAPJm0VLll35rQMwUFn98pRqrmhUuETqXp/Tdgip9yaU w/Gn35tUYwrY0KvpECHagbILxapnEqnZQ3cofPKo= Received: from epsmges2p3.samsung.com (unknown [182.195.42.71]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20190212180452epcas2p205583b1d6554d72f891e3bf7e512ac73~Cr-YA-_6T2848628486epcas2p2J; Tue, 12 Feb 2019 18:04:52 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id BE.29.04134.4CA036C5; Wed, 13 Feb 2019 03:04:52 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20190212180452epcas2p2f162435a99743c654320219dd25f880b~Cr-XqWIZo1862418624epcas2p2E; Tue, 12 Feb 2019 18:04:52 +0000 (GMT) X-AuditID: b6c32a47-8abff70000001026-46-5c630ac4d149 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 87.30.03689.4CA036C5; Wed, 13 Feb 2019 03:04:52 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:04:52 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:25 +0100 Message-id: <20190212180342.32040-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmue4RruQYg0cHjSyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZWxbMYynolq9Y/vUQUwPjBckuRg4O CQETiaYbWV2MXBxCAjsYJTa9+cIC4XxnlLgw5xZjFyMnWFHrsnlsEIkNjBKz/vxhh3B+MUoc WvWVGaSKTcBQovdoH1iHiICYxO05ncwgRcwCLUwSc+YuBSsSFkiU+Lb6DiPIbhYBVYnGOW4g YV4Ba4k1ve+htslLnO9dxw5icwrYSDxb+I0FokZQ4sfke2A2M1DNwSvPwU6VEDjCJtE37ygL RLOLxNamx0wQtrTEs1UboYZWS+za3s0M0dDBKNFyYTszRMJa4vDxi6wQU/kkOg7/ZYcEDK9E R5sQRImHxL5FX6De72eU+HH/KssERqlZSI6aheSoBYxMqxjFUguKc9NTi40KjPWKE3OLS/PS 9ZLzczcxgqNcy30H47ZzPocYBTgYlXh4VxxNihFiTSwrrsw9xCjBwawkwpvGnBwjxJuSWFmV WpQfX1Sak1p8iFGag0VJnPeh9NxoIYH0xJLU7NTUgtQimCwTB6dUA+O0F84MjK7dtyvTtScW Ol2Z/ENoeebMDfkxnPwpcZ6hKheMtz+8vXrrlRUrghLyG1SWrbd+9rdlnvfe+D5HJn6ttZeV txTMyMu/5r3m1V4LsQfhgt+KajiOL5x5jMen7aXV4pIjywqUp/dGVimtWnLgeuIBO6N2tU1N x0NjAh8Zvyv8t2m1/y4lluKMREMt5qLiRAD1UHxZ7gIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQd0jXMkxBvu7ZC2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZWxbMYynolq9Y/vUQUwPjBckuRk4O CQETidZl89hAbCGBdYwSzYuTuhi5gOxfjBILPs9mBkmwCRhK9B7tYwSxRQTEJG7P6WQGKWIW aGKS2HX7IjtIQlggUeLb6jtARRwcLAKqEo1z3EDCvALWEmt63zNCLJOXON+7DqycU8BG4tnC bywg5UJANVc22UKUC0r8mHyPBcRmBio/eOU5ywRGvllIUrOQpBYwMq1ilEwtKM5Nzy02KjDK Sy3XK07MLS7NS9dLzs/dxAgM4G2Htfp3MD5eEn+IUYCDUYmHd8XRpBgh1sSy4srcQ4wSHMxK IrxpzMkxQrwpiZVVqUX58UWlOanFhxilOViUxHn5849FCgmkJ5akZqemFqQWwWSZODilGhiz szI75rXYfn8nvV99YyyDltyGw9OXuj9/2ly9w+3Yv4Cjx8Wu3u+8W+mwrNk4Qqj5te6XsHVT a459lc9NXbosjW2tvvWfXu15jdpRz+aYfVjmeGtn16SGmy3TghafmniEp63Y7YRS/nzfSgMN uQWz/DflefYpuW9s52+YVRfuollacnOzXKoSS3FGoqEWc1FxIgCvNKfIXAIAAA== X-CMS-MailID: 20190212180452epcas2p2f162435a99743c654320219dd25f880b CMS-TYPE: 102P X-CMS-RootMailID: 20190212180452epcas2p2f162435a99743c654320219dd25f880b References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 04/21] ASoC: samsung: i2s: Move core clk to the driver common data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The core clock is also common for both CPU DAIs so move it to the driver's private data structure. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 29bcfca20572..159c19fdb662 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -71,8 +71,6 @@ struct i2s_dai { * 0 indicates CPU driver is free to choose any value. */ unsigned rfs, bfs; - /* I2S Controller's core clock */ - struct clk *clk; /* Clock for generating I2S signals */ struct clk *op_clk; /* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */ @@ -117,6 +115,9 @@ struct samsung_i2s_priv { struct snd_soc_dai_driver *dai_drv; int num_dais; + /* The I2S controller's core clock */ + struct clk *clk; + /* The clock provider's data */ struct clk *clk_table[3]; struct clk_onecell_data clk_data; @@ -1205,6 +1206,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, #ifdef CONFIG_PM static int i2s_runtime_suspend(struct device *dev) { + struct samsung_i2s_priv *priv = dev_get_drvdata(dev); struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); i2s->suspend_i2smod = readl(i2s->addr + I2SMOD); @@ -1213,24 +1215,25 @@ static int i2s_runtime_suspend(struct device *dev) if (i2s->op_clk) clk_disable_unprepare(i2s->op_clk); - clk_disable_unprepare(i2s->clk); + clk_disable_unprepare(priv->clk); return 0; } static int i2s_runtime_resume(struct device *dev) { + struct samsung_i2s_priv *priv = dev_get_drvdata(dev); struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); int ret; - ret = clk_prepare_enable(i2s->clk); + ret = clk_prepare_enable(priv->clk); if (ret) return ret; if (i2s->op_clk) { ret = clk_prepare_enable(i2s->op_clk); if (ret) { - clk_disable_unprepare(i2s->clk); + clk_disable_unprepare(priv->clk); return ret; } } @@ -1428,13 +1431,13 @@ static int samsung_i2s_probe(struct platform_device *pdev) regs_base = res->start; - pri_dai->clk = devm_clk_get(&pdev->dev, "iis"); - if (IS_ERR(pri_dai->clk)) { + priv->clk = devm_clk_get(&pdev->dev, "iis"); + if (IS_ERR(priv->clk)) { dev_err(&pdev->dev, "Failed to get iis clock\n"); - return PTR_ERR(pri_dai->clk); + return PTR_ERR(priv->clk); } - ret = clk_prepare_enable(pri_dai->clk); + ret = clk_prepare_enable(priv->clk); if (ret != 0) { dev_err(&pdev->dev, "failed to enable clock: %d\n", ret); return ret; @@ -1472,7 +1475,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) sec_dai->dma_playback.addr_width = 4; sec_dai->addr = pri_dai->addr; - sec_dai->clk = pri_dai->clk; sec_dai->quirks = quirks; sec_dai->idma_playback.addr = idma_addr; sec_dai->pri_dai = pri_dai; @@ -1519,7 +1521,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) err_disable_pm: pm_runtime_disable(&pdev->dev); err_disable_clk: - clk_disable_unprepare(pri_dai->clk); + clk_disable_unprepare(priv->clk); i2s_delete_secondary_device(priv); return ret; } @@ -1527,7 +1529,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) static int samsung_i2s_remove(struct platform_device *pdev) { struct samsung_i2s_priv *priv = dev_get_drvdata(&pdev->dev); - struct i2s_dai *pri_dai = samsung_i2s_get_pri_dai(&pdev->dev); /* The secondary device has no driver data assigned */ if (!priv) @@ -1537,7 +1538,7 @@ static int samsung_i2s_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); i2s_unregister_clock_provider(priv); - clk_disable_unprepare(pri_dai->clk); + clk_disable_unprepare(priv->clk); pm_runtime_put_noidle(&pdev->dev); i2s_delete_secondary_device(priv); From patchwork Tue Feb 12 18:03:26 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: 10808571 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 0F4B417E0 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF0B52C48F for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C92BE2C440; Tue, 12 Feb 2019 19:01:25 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CCCF2C2C8 for ; Tue, 12 Feb 2019 19:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9ED4E267962; Tue, 12 Feb 2019 19:05:09 +0100 (CET) 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 82225267968; Tue, 12 Feb 2019 19:05:07 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by alsa0.perex.cz (Postfix) with ESMTP id 34FE526780A for ; Tue, 12 Feb 2019 19:04:58 +0100 (CET) Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190212180456epoutp03b9c2b536d9694dab472d8e15174be555~Cr-by3lnn0209402094epoutp03w; Tue, 12 Feb 2019 18:04:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190212180456epoutp03b9c2b536d9694dab472d8e15174be555~Cr-by3lnn0209402094epoutp03w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994696; bh=d+DjveLKWf8YjBTzYoyAj2aNg7G8jSisA+BE3p8Kh5E=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=pyVNB9z7MGBc0i8NzbOPt004YZCBzZYtx/n69EZ1CH7G+UicgnEibQ0qj/gF7ZTsu jjEb/3WOenSg3R5GuMKjdR4RsFV5piKjhdLCq0OAcF+rlDBaMFfDnWzL9s8Uo64vcX sRibATWvZZFf1TkcKIWvh0v7G4RK2dK028sZJZnQ= Received: from epsmges1p4.samsung.com (unknown [182.195.42.56]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190212180456epcas1p2a45b4cc02a887cc6250a7c6a0437368e~Cr-bjn7Qt1433014330epcas1p2I; Tue, 12 Feb 2019 18:04:56 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.89.04288.8CA036C5; Wed, 13 Feb 2019 03:04:56 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180456epcas1p1fd8b2fb8101d4848e56911f16fa4ffef~Cr-bBEuil1881518815epcas1p1u; Tue, 12 Feb 2019 18:04:56 +0000 (GMT) X-AuditID: b6c32a38-bf7ff700000010c0-fe-5c630ac85820 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D1.11.04015.7CA036C5; Wed, 13 Feb 2019 03:04:56 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:04:55 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:26 +0100 Message-id: <20190212180342.32040-6-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7bCmge4JruQYg4VTVCyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZU9ZIFsw0qdg/YylbA2ObZhcjJ4eE gInEz5OXmbsYuTiEBHYwSsxsn88O4XxnlGhY+4IVpurblwNQVRsYJQ6vPcMC4fxilNixdBE7 SBWbgKFE79E+RhBbREBM4vacTrAOZoEWJok5c5cygySEBeIl5t1cDjSWg4NFQFWif60RSJhX wFpiwrm3UNvkJc73rgObySlgI/Fs4TcWiBpBiR+T74HZzEA1B688BztCQuAIm0Tnm4lQzS4S 126+B5svISAtcemoLUS4WmLX9m5miPoORomWC9uZIRLWEoePX2SFGMon8e5rD1Qvr0RHmxBE iYfE8nkLoL7vZ5RY/eoD2wRGqVlIbpqF5KYFjEyrGMVSC4pz01OLDQtM9IoTc4tL89L1kvNz NzGCY1zLYgfjnnM+hxgFOBiVeHhXHE2KEWJNLCuuzD3EKMHBrCTCm8acHCPEm5JYWZValB9f VJqTWnyIUZqDRUmcd72Dc4yQQHpiSWp2ampBahFMlomDU6qBMehXnWhcwOVL9uy6C5olfjQb 5k2ta/5TLH70bYjAEc2aT7dDf5p9V3qzc4L2w+Ctl4Lkl9qzPOW6on/5A5ftrZWNZverPgU8 2R6641XcqfSfrvNO6HRxc9pPvJ0XI7nycZK/hMSvc+yibtbfr8QbrFgsNd8i3EZ1mvoLQVkd xQa98pQfs1amK7EUZyQaajEXFScCAEBGFZjtAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQd0TXMkxBks/MVlcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgypqyRLJhpUrF/xlK2BsY2zS5GTg4J AROJb18OMHcxcnEICaxjlNh45TMbhPOLUeLCg/msIFVsAoYSvUf7GEFsEQExidtzOsE6mAWa mCR23b7IDpIQFoiXWHXiOVA3BweLgKpE/1ojkDCvgLXEhHNvWSG2yUuc710HVs4pYCPxbOE3 FpByIaCaK5tsIcoFJX5MvscCYjMDlR+88pxlAiPfLCSpWUhSCxiZVjFKphYU56bnFhsVGOal lusVJ+YWl+al6yXn525iBAbwtsNafTsY7y+JP8QowMGoxMO74mhSjBBrYllxZe4hRgkOZiUR 3jTm5Bgh3pTEyqrUovz4otKc1OJDjNIcLErivLfzjkUKCaQnlqRmp6YWpBbBZJk4OKUaGJP+ r1x/I7fJb9KN3k9R+4xMuueWn5WYNsu8rvjhJb6ERRyLLvh/K35gt/SBrvzl7enp2tU/p920 ODbtS/MvBoay/siv1yeU6GYxnHwYyP13wt2la9ZGL/3xTyRCTfjL0uRL5hU7WBTMe80bgh12 XZzb43ukQfb08eVbFOYn/E2fpmk74yLTXk8lluKMREMt5qLiRAAJf8CaXAIAAA== X-CMS-MailID: 20190212180456epcas1p1fd8b2fb8101d4848e56911f16fa4ffef CMS-TYPE: 101P X-CMS-RootMailID: 20190212180456epcas1p1fd8b2fb8101d4848e56911f16fa4ffef References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 05/21] ASoC: samsung: i2s: Move opclk data to common driver data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The clock for generating I2S signals is also common for both CPU DAIs so move it to the driver's common data structure. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 70 +++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 159c19fdb662..d8414d781f83 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -62,8 +62,6 @@ struct i2s_dai { struct platform_device *pdev; /* Memory mapped SFR region */ void __iomem *addr; - /* Rate of RCLK source clock */ - unsigned long rclk_srcrate; /* Frame Clock */ unsigned frmclk; /* @@ -71,8 +69,6 @@ struct i2s_dai { * 0 indicates CPU driver is free to choose any value. */ unsigned rfs, bfs; - /* Clock for generating I2S signals */ - struct clk *op_clk; /* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */ struct i2s_dai *pri_dai; /* Pointer to the Secondary_Fifo if it has one, NULL otherwise */ @@ -118,6 +114,12 @@ struct samsung_i2s_priv { /* The I2S controller's core clock */ struct clk *clk; + /* Clock for generating I2S signals */ + struct clk *op_clk; + + /* Rate of RCLK source clock */ + unsigned long rclk_srcrate; + /* The clock provider's data */ struct clk *clk_table[3]; struct clk_onecell_data clk_data; @@ -496,9 +498,10 @@ static inline void i2s_fifo(struct i2s_dai *i2s, u32 flush) writel(readl(fic) & ~flush, fic); } -static int i2s_set_sysclk(struct snd_soc_dai *dai, - int clk_id, unsigned int rfs, int dir) +static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, + int dir) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); struct i2s_dai *other = get_other_dai(i2s); const struct samsung_i2s_variant_regs *i2s_regs = i2s->variant_regs; @@ -554,44 +557,39 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, clk_id = 1; if (!any_active(i2s)) { - if (i2s->op_clk && !IS_ERR(i2s->op_clk)) { + if (priv->op_clk && !IS_ERR(priv->op_clk)) { if ((clk_id && !(mod & rsrc_mask)) || (!clk_id && (mod & rsrc_mask))) { - clk_disable_unprepare(i2s->op_clk); - clk_put(i2s->op_clk); + clk_disable_unprepare(priv->op_clk); + clk_put(priv->op_clk); } else { - i2s->rclk_srcrate = - clk_get_rate(i2s->op_clk); + priv->rclk_srcrate = + clk_get_rate(priv->op_clk); goto done; } } if (clk_id) - i2s->op_clk = clk_get(&i2s->pdev->dev, + priv->op_clk = clk_get(&i2s->pdev->dev, "i2s_opclk1"); else - i2s->op_clk = clk_get(&i2s->pdev->dev, + priv->op_clk = clk_get(&i2s->pdev->dev, "i2s_opclk0"); - if (WARN_ON(IS_ERR(i2s->op_clk))) { - ret = PTR_ERR(i2s->op_clk); - i2s->op_clk = NULL; + if (WARN_ON(IS_ERR(priv->op_clk))) { + ret = PTR_ERR(priv->op_clk); + priv->op_clk = NULL; goto err; } - ret = clk_prepare_enable(i2s->op_clk); + ret = clk_prepare_enable(priv->op_clk); if (ret) { - clk_put(i2s->op_clk); - i2s->op_clk = NULL; + clk_put(priv->op_clk); + priv->op_clk = NULL; goto err; } - i2s->rclk_srcrate = clk_get_rate(i2s->op_clk); + priv->rclk_srcrate = clk_get_rate(priv->op_clk); - /* Over-ride the other's */ - if (other) { - other->op_clk = i2s->op_clk; - other->rclk_srcrate = i2s->rclk_srcrate; - } } else if ((!clk_id && (mod & rsrc_mask)) || (clk_id && !(mod & rsrc_mask))) { dev_err(&i2s->pdev->dev, @@ -600,8 +598,6 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, goto err; } else { /* Call can't be on the active DAI */ - i2s->op_clk = other->op_clk; - i2s->rclk_srcrate = other->rclk_srcrate; goto done; } @@ -689,7 +685,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) * 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 && priv->clk_data.clks == NULL) + if (priv->rclk_srcrate == 0 && priv->clk_data.clks == NULL) i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0, 0, SND_SOC_CLOCK_IN); break; @@ -814,7 +810,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, rclksrc = priv->clk_table[CLK_I2S_RCLK_SRC]; if (rclksrc && !IS_ERR(rclksrc)) - i2s->rclk_srcrate = clk_get_rate(rclksrc); + priv->rclk_srcrate = clk_get_rate(rclksrc); return 0; } @@ -872,6 +868,7 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, static int config_setup(struct i2s_dai *i2s) { + struct samsung_i2s_priv *priv = i2s->priv; struct i2s_dai *other = get_other_dai(i2s); unsigned rfs, bfs, blc; u32 psr; @@ -920,11 +917,11 @@ static int config_setup(struct i2s_dai *i2s) return 0; if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { - psr = i2s->rclk_srcrate / i2s->frmclk / rfs; + psr = priv->rclk_srcrate / i2s->frmclk / rfs; writel(((psr - 1) << 8) | PSR_PSREN, i2s->addr + I2SPSR); dev_dbg(&i2s->pdev->dev, "RCLK_SRC=%luHz PSR=%u, RCLK=%dfs, BCLK=%dfs\n", - i2s->rclk_srcrate, psr, rfs, bfs); + priv->rclk_srcrate, psr, rfs, bfs); } return 0; @@ -1067,7 +1064,6 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) /* Reset any constraint on RFS and BFS */ i2s->rfs = 0; i2s->bfs = 0; - i2s->rclk_srcrate = 0; spin_lock_irqsave(i2s->lock, flags); i2s_txctrl(i2s, 0); @@ -1213,8 +1209,8 @@ static int i2s_runtime_suspend(struct device *dev) i2s->suspend_i2scon = readl(i2s->addr + I2SCON); i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); - if (i2s->op_clk) - clk_disable_unprepare(i2s->op_clk); + if (priv->op_clk) + clk_disable_unprepare(priv->op_clk); clk_disable_unprepare(priv->clk); return 0; @@ -1230,8 +1226,8 @@ static int i2s_runtime_resume(struct device *dev) if (ret) return ret; - if (i2s->op_clk) { - ret = clk_prepare_enable(i2s->op_clk); + if (priv->op_clk) { + ret = clk_prepare_enable(priv->op_clk); if (ret) { clk_disable_unprepare(priv->clk); return ret; @@ -1514,7 +1510,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (ret < 0) goto err_disable_pm; - pri_dai->op_clk = clk_get_parent(priv->clk_table[CLK_I2S_RCLK_SRC]); + priv->op_clk = clk_get_parent(priv->clk_table[CLK_I2S_RCLK_SRC]); return 0; From patchwork Tue Feb 12 18:03:27 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: 10808569 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 04F06746 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1CD02C459 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C03AF2C2C4; Tue, 12 Feb 2019 19:01:25 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5889B2C2C4 for ; Tue, 12 Feb 2019 19:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 641F2267925; Tue, 12 Feb 2019 19:05:15 +0100 (CET) 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 9F9D6267963; Tue, 12 Feb 2019 19:05:12 +0100 (CET) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by alsa0.perex.cz (Postfix) with ESMTP id 5852E2678A2 for ; Tue, 12 Feb 2019 19:05:03 +0100 (CET) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190212180501epoutp04f1e4bf38b5f7072786c67c508800fa59~Cr-fooQNT2257622576epoutp04r; Tue, 12 Feb 2019 18:05:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190212180501epoutp04f1e4bf38b5f7072786c67c508800fa59~Cr-fooQNT2257622576epoutp04r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994701; bh=VLiyEtP9myrodprY+LqJ/odGrX0oLgdq+HoVSWlG+UA=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=kd6jRrxGicPWVXP+HJ5ZbEo7JxWsmbvA+rwkv8cjUCIHOlIvDDkXPgvM+JEiap72B bmbe/1tPFqu90xNMi5/VDCB7f9SEXQjHC76qTaf2gIbkrUFV1kqs1XmXToaZcfKlgI i1QPBZdsIKGaDKf8gruXKRW1ctbZR5ZLAbQyW0OQ= Received: from epsmges2p2.samsung.com (unknown [182.195.42.70]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180500epcas2p17be266806f2ddfcf72783c6f3494d7d9~Cr-evhjy71625716257epcas2p1B; Tue, 12 Feb 2019 18:05:00 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id E5.4C.04136.BCA036C5; Wed, 13 Feb 2019 03:04:59 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20190212180459epcas2p2b5f273e37ab86a26bd7292bbcb557aa1~Cr-eXq7pa2848628486epcas2p2M; Tue, 12 Feb 2019 18:04:59 +0000 (GMT) X-AuditID: b6c32a46-2a7ff70000001028-67-5c630acb14fe Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 38.30.03689.BCA036C5; Wed, 13 Feb 2019 03:04:59 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:04:59 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:27 +0100 Message-id: <20190212180342.32040-7-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7bCmme5pruQYg1W/rC2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZC37+YCtoFapYN+cTSwNjC38XIyeH hICJxMLZN9m7GLk4hAR2MEpsXTeFGcL5ziixu/kbG0zVw127GSESGxglTj9bwgSSEBL4xSjx 8ngdiM0mYCjRe7SPEcQWERCTuD2nE2wSs0ALk8ScuUuZQRLCAikS1xu/gDWzCKhK7Fq7mR3E 5hWwlrj4oIcRYpu8xPnedWBxTgEbiWcLv7FA1AhK/Jh8D8xmBqo5eOU5C8gCCYEjbBIPe9pY IJpdJN7eXc0EYUtLPFu1EWpotcSu7d3MEA0djBItF7YzQySsJQ4fv8gKMZVPouPwX6DNHEBx XomONiGIEg+JkzdmQAOpn1Gis20W+wRGqVlIjpqF5KgFjEyrGMVSC4pz01OLjQqM9IoTc4tL 89L1kvNzNzGC41zLbQfjknM+hxgFOBiVeHhXHE2KEWJNLCuuzD3EKMHBrCTCm8acHCPEm5JY WZValB9fVJqTWnyIUZqDRUmc96H03GghgfTEktTs1NSC1CKYLBMHp1QDo8abNz4idd8yws97 i04Pr/Lj+CGQvU9/R/llxYIFpX/nXbKXEbltI2rw2sT9lf9LrRKxtuD9z3vzV3JuL7h/49DU QwVtuvyC7Kqi77Xy089czbr1N/jG7cs558LNzqf1/mb/kSS4hl3Y/av/8d5ni+31PiW7WUtZ /p64bunGqYypc87vPCBTpsRSnJFoqMVcVJwIAKS/g/PvAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd3TXMkxBnfPq1pcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyFvz8wVbQKlSxbs4nlgbGFv4uRk4O CQETiYe7djN2MXJxCAmsY5T4+vkzC4Tzi1Fi8vsLzCBVbAKGEr1H+xhBbBEBMYnbczqZQYqY BZqYJHbdvsgOkhAWSJG43viFCcRmEVCV2LV2M1icV8Ba4uKDHkaIdfIS53vXgcU5BWwkni38 BrSNA2ibtcSVTbYQ5YISPybfYwGxmYHKD155zjKBkW8WktQsJKkFjEyrGCVTC4pz03OLjQqM 8lLL9YoTc4tL89L1kvNzNzECg3jbYa3+HYyPl8QfYhTgYFTi4V1xNClGiDWxrLgy9xCjBAez kghvGnNyjBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFe/vxjkUIC6YklqdmpqQWpRTBZJg5OqQZG JueDDlNbvlfyVpgW/or7fbx7N8uGqD17E9wlJhmeU3iafO7ZRnaxNx151e11vz/KTtgRuibt 9K3zSpNn/p+xcqVqfKNLRvHp79sOvhFmvepf+VyQ7866Hb/3/VKbtirlt/+cA6vkHrWpJJ2Z et5f8V7WzWtZC4Rn9iwusnCfMkNuvriJaOOh/UosxRmJhlrMRcWJAISkEpxeAgAA X-CMS-MailID: 20190212180459epcas2p2b5f273e37ab86a26bd7292bbcb557aa1 CMS-TYPE: 102P X-CMS-RootMailID: 20190212180459epcas2p2b5f273e37ab86a26bd7292bbcb557aa1 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 06/21] ASoC: samsung: i2s: Move registers cache to common driver data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP There is no need to keep the PM suspend/resume register cache separate for each DAI as those registers are common, move related i2s_dai data structure to the driver's common data structure. This will allow us to simplify the code a little eventually and to make it easier to follow. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index d8414d781f83..72f0cb7abb30 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -86,9 +86,6 @@ struct i2s_dai { struct snd_dmaengine_dai_dma_data idma_playback; dma_filter_fn filter; u32 quirks; - u32 suspend_i2smod; - u32 suspend_i2scon; - u32 suspend_i2spsr; const struct samsung_i2s_variant_regs *variant_regs; spinlock_t *lock; @@ -120,6 +117,11 @@ struct samsung_i2s_priv { /* Rate of RCLK source clock */ unsigned long rclk_srcrate; + /* Cache of selected I2S registers for system suspend */ + u32 suspend_i2smod; + u32 suspend_i2scon; + u32 suspend_i2spsr; + /* The clock provider's data */ struct clk *clk_table[3]; struct clk_onecell_data clk_data; @@ -1205,9 +1207,9 @@ static int i2s_runtime_suspend(struct device *dev) struct samsung_i2s_priv *priv = dev_get_drvdata(dev); struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); - i2s->suspend_i2smod = readl(i2s->addr + I2SMOD); - i2s->suspend_i2scon = readl(i2s->addr + I2SCON); - i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); + priv->suspend_i2smod = readl(i2s->addr + I2SMOD); + priv->suspend_i2scon = readl(i2s->addr + I2SCON); + priv->suspend_i2spsr = readl(i2s->addr + I2SPSR); if (priv->op_clk) clk_disable_unprepare(priv->op_clk); @@ -1234,9 +1236,9 @@ static int i2s_runtime_resume(struct device *dev) } } - writel(i2s->suspend_i2scon, i2s->addr + I2SCON); - writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); - writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR); + writel(priv->suspend_i2scon, i2s->addr + I2SCON); + writel(priv->suspend_i2smod, i2s->addr + I2SMOD); + writel(priv->suspend_i2spsr, i2s->addr + I2SPSR); return 0; } From patchwork Tue Feb 12 18:03:28 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: 10808591 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 DCB3917E0 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C780A2C2C4 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB6632C2C8; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF7412C457 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2135226797E; Tue, 12 Feb 2019 19:05:20 +0100 (CET) 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 557C4267989; Tue, 12 Feb 2019 19:05:18 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by alsa0.perex.cz (Postfix) with ESMTP id 6689D26794B for ; Tue, 12 Feb 2019 19:05:06 +0100 (CET) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190212180504epoutp03c5da906f7b0bf7b5b998abb3f79ccb6c~Cr-irvbzU0209002090epoutp03n; Tue, 12 Feb 2019 18:05:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190212180504epoutp03c5da906f7b0bf7b5b998abb3f79ccb6c~Cr-irvbzU0209002090epoutp03n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994704; bh=5PbnO/4hoOwiEvydy0f/poJkVEQ2JE04lvvQ9lQBCIU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=EHcwWVlRUL7XS/Ih32f9nQObbWp9c8Hg66ygUvaTCLQ49inQmoE6KjrezGJep9f1w EJlem5gkriZFOIktEG79QBXcA1S47ImC0DT75UvCZAFF3h2oylGN7Ppjary64HPAMm /A8716GqFhO37vouy7eYmGtkoUbTacI2XqmoSPOU= Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180503epcas1p4127efd2fb559ecb51dc6e447210d0c6a~Cr-iAeytU0204002040epcas1p43; Tue, 12 Feb 2019 18:05:03 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 41.BF.04074.FCA036C5; Wed, 13 Feb 2019 03:05:03 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190212180503epcas1p377484a3f7fd98a8fa7199ab2a126b9e8~Cr-huOekR0781607816epcas1p35; Tue, 12 Feb 2019 18:05:03 +0000 (GMT) X-AuditID: b6c32a35-297ff70000000fea-6e-5c630acfaac4 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 82.11.04015.FCA036C5; Wed, 13 Feb 2019 03:05:03 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:03 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:28 +0100 Message-id: <20190212180342.32040-8-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7bCmge55ruQYg73nFS2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZW7ZeYipYkF7RsmEvYwNje0gXIweH hICJxPGDJl2MXBxCAjsYJab1n2LrYuQEcr4zShyeUwBig9RM/b2RBaJoA6PEvxeHmSGcX4wS fxoWsYBUsQkYSvQe7WMEsUUExCRuz+kEK2IWaGGSmDN3KTNIQlggQWLp79fMIKtZBFQltl9K AQnzClhLPFi0kxVim7zE+d517CA2p4CNxLOF31ggagQlfky+B2YzA9UcvPIc7CIJgQNsEs8b JrBANLtInH72mBniNWmJS0dtIcLVEru2dzND1HcwSrRc2M4MkbCWOHz8IivEUD6Jd197WCF6 eSU62oQgSjwkvp7cyAbxcD+jxKQJX5gmMErNQnLTLCQ3LWBkWsUollpQnJueWmxYYKhXnJhb XJqXrpecn7uJERzhWqY7GKec8znEKMDBqMTDu+JoUowQa2JZcWXuIUYJDmYlEd405uQYId6U xMqq1KL8+KLSnNTiQ4zSHCxK4rzrHZxjhATSE0tSs1NTC1KLYLJMHJxSDYxuc3Kzdtr8fuUR Wab1SlAmTvjrPeM9rQ9WSnbNSvE7fNHy78bbNjpObH6R6VaLPrnuX9cvYs714nT25JY7KXvt H2Vz2Yv+0RKc+3SyouLmyCPn4/tOvE9oWeTfIV038apma513zendVY5h155vmpD6RM2svXXK jWtbr/Sw8t9I0OHZk7NF5IcSS3FGoqEWc1FxIgACfdz/7AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQd3zXMkxBq+ecVlcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgytmy9xFSwIL2iZcNexgbG9pAuRk4O CQETiam/N7J0MXJxCAmsY5S4sXQ/G0hCSOAXkPPMGcRmEzCU6D3axwhiiwiISdye08kM0sAs 0MQksev2RXaQhLBAgsSMh8+Bijg4WARUJbZfSgEJ8wpYSzxYtJMVYpm8xPnedWDlnAI2Es8W fmMBKRcCqrmyyRaiXFDix+R7LCA2M1D5wSvPWSYw8s1CkpqFJLWAkWkVo2RqQXFuem6xUYFh Xmq5XnFibnFpXrpecn7uJkZgAG87rNW3g/H+kvhDjAIcjEo8vCuOJsUIsSaWFVfmHmKU4GBW EuFNY06OEeJNSaysSi3Kjy8qzUktPsQozcGiJM57O+9YpJBAemJJanZqakFqEUyWiYNTqoFR df7CmfLihYapWxb96bpbY1Y/y+CDjdGfHYz8kWGWP/UdlGtM33jIsoRd8deqXutiL7Cce3JL dG7rbA2Nhsd/HVv2rv6h+efw1onHctQf/uG1mDt1q1DH3KJNmj+t/5U2ZJX7FdzmFWSury5T CX3Gq5+oyMr/14Y3KVZ+89qIe96KKamWNkosxRmJhlrMRcWJAObQAztcAgAA X-CMS-MailID: 20190212180503epcas1p377484a3f7fd98a8fa7199ab2a126b9e8 CMS-TYPE: 101P X-CMS-RootMailID: 20190212180503epcas1p377484a3f7fd98a8fa7199ab2a126b9e8 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 07/21] ASoC: samsung: i2s: Move SFR pointer to common driver data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The SFR region is common for both DAIs so move related data structure field from struct i2s_dai to the common driver data structure. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 105 ++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 47 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 72f0cb7abb30..05f1de208307 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -60,8 +60,7 @@ struct samsung_i2s_dai_data { struct i2s_dai { /* Platform device for this DAI */ struct platform_device *pdev; - /* Memory mapped SFR region */ - void __iomem *addr; + /* Frame Clock */ unsigned frmclk; /* @@ -100,6 +99,9 @@ struct samsung_i2s_priv { struct platform_device *pdev; struct platform_device *pdev_sec; + /* Memory mapped SFR region */ + void __iomem *addr; + /* Spinlock protecting access to the device's registers */ spinlock_t spinlock; @@ -143,7 +145,9 @@ static inline bool is_secondary(struct i2s_dai *i2s) /* If operating in SoC-Slave mode */ static inline bool is_slave(struct i2s_dai *i2s) { - u32 mod = readl(i2s->addr + I2SMOD); + struct samsung_i2s_priv *priv = i2s->priv; + + u32 mod = readl(priv->addr + I2SMOD); return (mod & (1 << i2s->variant_regs->mss_off)) ? true : false; } @@ -155,7 +159,7 @@ static inline bool tx_active(struct i2s_dai *i2s) if (!i2s) return false; - active = readl(i2s->addr + I2SCON); + active = readl(i2s->priv->addr + I2SCON); if (is_secondary(i2s)) active &= CON_TXSDMA_ACTIVE; @@ -193,7 +197,7 @@ static inline bool rx_active(struct i2s_dai *i2s) if (!i2s) return false; - active = readl(i2s->addr + I2SCON) & CON_RXDMA_ACTIVE; + active = readl(i2s->priv->addr + I2SCON) & CON_RXDMA_ACTIVE; return active ? true : false; } @@ -256,8 +260,10 @@ static inline bool is_manager(struct i2s_dai *i2s) /* Read RCLK of I2S (in multiples of LRCLK) */ static inline unsigned get_rfs(struct i2s_dai *i2s) { + struct samsung_i2s_priv *priv = i2s->priv; u32 rfs; - rfs = readl(i2s->addr + I2SMOD) >> i2s->variant_regs->rfs_off; + + rfs = readl(priv->addr + I2SMOD) >> i2s->variant_regs->rfs_off; rfs &= i2s->variant_regs->rfs_mask; switch (rfs) { @@ -275,7 +281,8 @@ static inline unsigned get_rfs(struct i2s_dai *i2s) /* Write RCLK of I2S (in multiples of LRCLK) */ static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs) { - u32 mod = readl(i2s->addr + I2SMOD); + struct samsung_i2s_priv *priv = i2s->priv; + u32 mod = readl(priv->addr + I2SMOD); int rfs_shift = i2s->variant_regs->rfs_off; mod &= ~(i2s->variant_regs->rfs_mask << rfs_shift); @@ -307,14 +314,16 @@ static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs) break; } - writel(mod, i2s->addr + I2SMOD); + writel(mod, priv->addr + I2SMOD); } /* Read Bit-Clock of I2S (in multiples of LRCLK) */ static inline unsigned get_bfs(struct i2s_dai *i2s) { + struct samsung_i2s_priv *priv = i2s->priv; u32 bfs; - bfs = readl(i2s->addr + I2SMOD) >> i2s->variant_regs->bfs_off; + + bfs = readl(priv->addr + I2SMOD) >> i2s->variant_regs->bfs_off; bfs &= i2s->variant_regs->bfs_mask; switch (bfs) { @@ -333,7 +342,8 @@ static inline unsigned get_bfs(struct i2s_dai *i2s) /* Write Bit-Clock of I2S (in multiples of LRCLK) */ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) { - u32 mod = readl(i2s->addr + I2SMOD); + struct samsung_i2s_priv *priv = i2s->priv; + u32 mod = readl(priv->addr + I2SMOD); int tdm = i2s->quirks & QUIRK_SUPPORTS_TDM; int bfs_shift = i2s->variant_regs->bfs_off; @@ -378,13 +388,13 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) return; } - writel(mod, i2s->addr + I2SMOD); + writel(mod, priv->addr + I2SMOD); } /* Sample-Size */ static inline int get_blc(struct i2s_dai *i2s) { - int blc = readl(i2s->addr + I2SMOD); + int blc = readl(i2s->priv->addr + I2SMOD); blc = (blc >> 13) & 0x3; @@ -398,7 +408,8 @@ static inline int get_blc(struct i2s_dai *i2s) /* TX Channel Control */ static void i2s_txctrl(struct i2s_dai *i2s, int on) { - void __iomem *addr = i2s->addr; + struct samsung_i2s_priv *priv = i2s->priv; + void __iomem *addr = priv->addr; int txr_off = i2s->variant_regs->txr_off; u32 con = readl(addr + I2SCON); u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); @@ -448,7 +459,8 @@ static void i2s_txctrl(struct i2s_dai *i2s, int on) /* RX Channel Control */ static void i2s_rxctrl(struct i2s_dai *i2s, int on) { - void __iomem *addr = i2s->addr; + struct samsung_i2s_priv *priv = i2s->priv; + void __iomem *addr = priv->addr; int txr_off = i2s->variant_regs->txr_off; u32 con = readl(addr + I2SCON); u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); @@ -485,9 +497,9 @@ static inline void i2s_fifo(struct i2s_dai *i2s, u32 flush) return; if (is_secondary(i2s)) - fic = i2s->addr + I2SFICS; + fic = i2s->priv->addr + I2SFICS; else - fic = i2s->addr + I2SFIC; + fic = i2s->priv->addr + I2SFIC; /* Flush the FIFO */ writel(readl(fic) | flush, fic); @@ -516,7 +528,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, pm_runtime_get_sync(dai->dev); spin_lock_irqsave(i2s->lock, flags); - mod = readl(i2s->addr + I2SMOD); + mod = readl(priv->addr + I2SMOD); spin_unlock_irqrestore(i2s->lock, flags); switch (clk_id) { @@ -613,9 +625,9 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, } spin_lock_irqsave(i2s->lock, flags); - mod = readl(i2s->addr + I2SMOD); + mod = readl(priv->addr + I2SMOD); mod = (mod & ~mask) | val; - writel(mod, i2s->addr + I2SMOD); + writel(mod, priv->addr + I2SMOD); spin_unlock_irqrestore(i2s->lock, flags); done: pm_runtime_put(dai->dev); @@ -698,7 +710,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) pm_runtime_get_sync(dai->dev); spin_lock_irqsave(i2s->lock, flags); - mod = readl(i2s->addr + I2SMOD); + mod = readl(priv->addr + I2SMOD); /* * Don't change the I2S mode if any controller is active on this * channel. @@ -714,7 +726,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) mod &= ~(sdf_mask | lrp_rlow | mod_slave); mod |= tmp; - writel(mod, i2s->addr + I2SMOD); + writel(mod, priv->addr + I2SMOD); spin_unlock_irqrestore(i2s->lock, flags); pm_runtime_put(dai->dev); @@ -801,9 +813,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, } spin_lock_irqsave(i2s->lock, flags); - mod = readl(i2s->addr + I2SMOD); + mod = readl(priv->addr + I2SMOD); mod = (mod & ~mask) | val; - writel(mod, i2s->addr + I2SMOD); + writel(mod, priv->addr + I2SMOD); spin_unlock_irqrestore(i2s->lock, flags); snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture); @@ -837,7 +849,7 @@ static int i2s_startup(struct snd_pcm_substream *substream, i2s->mode |= DAI_MANAGER; if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR)) - writel(CON_RSTCLR, i2s->addr + I2SCON); + writel(CON_RSTCLR, i2s->priv->addr + I2SCON); spin_unlock_irqrestore(&lock, flags); @@ -920,7 +932,7 @@ static int config_setup(struct i2s_dai *i2s) if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { psr = priv->rclk_srcrate / i2s->frmclk / rfs; - writel(((psr - 1) << 8) | PSR_PSREN, i2s->addr + I2SPSR); + writel(((psr - 1) << 8) | PSR_PSREN, priv->addr + I2SPSR); dev_dbg(&i2s->pdev->dev, "RCLK_SRC=%luHz PSR=%u, RCLK=%dfs, BCLK=%dfs\n", priv->rclk_srcrate, psr, rfs, bfs); @@ -1008,8 +1020,9 @@ static int i2s_set_clkdiv(struct snd_soc_dai *dai, static snd_pcm_sframes_t i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); - u32 reg = readl(i2s->addr + I2SFIC); + u32 reg = readl(priv->addr + I2SFIC); snd_pcm_sframes_t delay; const struct samsung_i2s_variant_regs *i2s_regs = i2s->variant_regs; @@ -1018,7 +1031,7 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) delay = FIC_RXCOUNT(reg); else if (is_secondary(i2s)) - delay = FICS_TXCOUNT(readl(i2s->addr + I2SFICS)); + delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS)); else delay = (reg >> i2s_regs->ftx0cnt_off) & 0x7f; @@ -1042,6 +1055,7 @@ static int i2s_resume(struct snd_soc_dai *dai) static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); struct i2s_dai *other = get_other_dai(i2s); unsigned long flags; @@ -1056,10 +1070,10 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) &i2s->dma_capture); if (i2s->quirks & QUIRK_NEED_RSTCLR) - writel(CON_RSTCLR, i2s->addr + I2SCON); + writel(CON_RSTCLR, priv->addr + I2SCON); if (i2s->quirks & QUIRK_SUPPORTS_IDMA) - idma_reg_addr_init(i2s->addr, + idma_reg_addr_init(priv->addr, i2s->sec_dai->idma_playback.addr); } @@ -1094,7 +1108,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) if (!is_secondary(i2s)) { if (i2s->quirks & QUIRK_NEED_RSTCLR) { spin_lock_irqsave(i2s->lock, flags); - writel(0, i2s->addr + I2SCON); + writel(0, i2s->priv->addr + I2SCON); spin_unlock_irqrestore(i2s->lock, flags); } } @@ -1205,11 +1219,10 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, static int i2s_runtime_suspend(struct device *dev) { struct samsung_i2s_priv *priv = dev_get_drvdata(dev); - struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); - priv->suspend_i2smod = readl(i2s->addr + I2SMOD); - priv->suspend_i2scon = readl(i2s->addr + I2SCON); - priv->suspend_i2spsr = readl(i2s->addr + I2SPSR); + priv->suspend_i2smod = readl(priv->addr + I2SMOD); + priv->suspend_i2scon = readl(priv->addr + I2SCON); + priv->suspend_i2spsr = readl(priv->addr + I2SPSR); if (priv->op_clk) clk_disable_unprepare(priv->op_clk); @@ -1221,7 +1234,6 @@ static int i2s_runtime_suspend(struct device *dev) static int i2s_runtime_resume(struct device *dev) { struct samsung_i2s_priv *priv = dev_get_drvdata(dev); - struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); int ret; ret = clk_prepare_enable(priv->clk); @@ -1236,9 +1248,9 @@ static int i2s_runtime_resume(struct device *dev) } } - writel(priv->suspend_i2scon, i2s->addr + I2SCON); - writel(priv->suspend_i2smod, i2s->addr + I2SMOD); - writel(priv->suspend_i2spsr, i2s->addr + I2SPSR); + writel(priv->suspend_i2scon, priv->addr + I2SCON); + writel(priv->suspend_i2smod, priv->addr + I2SMOD); + writel(priv->suspend_i2spsr, priv->addr + I2SPSR); return 0; } @@ -1296,21 +1308,21 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { /* Activate the prescaler */ - u32 val = readl(i2s->addr + I2SPSR); - writel(val | PSR_PSREN, i2s->addr + I2SPSR); + u32 val = readl(priv->addr + I2SPSR); + writel(val | PSR_PSREN, priv->addr + I2SPSR); priv->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev, i2s_clk_name[CLK_I2S_RCLK_SRC], p_names, ARRAY_SIZE(p_names), CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, - i2s->addr + I2SMOD, reg_info->rclksrc_off, + priv->addr + I2SMOD, reg_info->rclksrc_off, 1, 0, i2s->lock); priv->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev, i2s_clk_name[CLK_I2S_RCLK_PSR], i2s_clk_name[CLK_I2S_RCLK_SRC], CLK_SET_RATE_PARENT, - i2s->addr + I2SPSR, 8, 6, 0, i2s->lock); + priv->addr + I2SPSR, 8, 6, 0, i2s->lock); p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR]; priv->clk_data.clk_num = 2; @@ -1319,7 +1331,7 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) priv->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev, i2s_clk_name[CLK_I2S_CDCLK], p_names[0], CLK_SET_RATE_PARENT, - i2s->addr + I2SMOD, reg_info->cdclkcon_off, + priv->addr + I2SMOD, reg_info->cdclkcon_off, CLK_GATE_SET_TO_DISABLE, i2s->lock); priv->clk_data.clk_num += 1; @@ -1423,9 +1435,9 @@ static int samsung_i2s_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - pri_dai->addr = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(pri_dai->addr)) - return PTR_ERR(pri_dai->addr); + priv->addr = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(priv->addr)) + return PTR_ERR(priv->addr); regs_base = res->start; @@ -1472,7 +1484,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) } sec_dai->dma_playback.addr_width = 4; - sec_dai->addr = pri_dai->addr; sec_dai->quirks = quirks; sec_dai->idma_playback.addr = idma_addr; sec_dai->pri_dai = pri_dai; From patchwork Tue Feb 12 18:03:29 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: 10808599 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 B21FD17E0 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F2E22C2C4 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93DCF2C3F2; Tue, 12 Feb 2019 19:01:28 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCFCD2C456 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A09CF267975; Tue, 12 Feb 2019 19:05:23 +0100 (CET) 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 6BFB026798A; Tue, 12 Feb 2019 19:05:20 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id AEE8B267956 for ; Tue, 12 Feb 2019 19:05:10 +0100 (CET) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180508epoutp013e37eb201e49635ed67b56657deaec71~Cr-mWXnr11898018980epoutp01v; Tue, 12 Feb 2019 18:05:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180508epoutp013e37eb201e49635ed67b56657deaec71~Cr-mWXnr11898018980epoutp01v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994708; bh=NDv8LnYTqm5N2f0/VV3sghf31iqvfX+LBK6N+oIv4AY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=tBtU62oy3OFRD2smriJYOx52JbYUjMVcJ5ryl2JcTFut2zIkZyC/KDQmbpWHdt2A9 hav1VBIiv/jzG4Tnts038zxmaPT6JhTzITgSc0SXcN5yxn7zHl7OFXuP9nzbpNgB7H q/5ulO5vqVZHOMXxvvSiBUjL3GzWCBsFYyaCqb3o= Received: from epsmges2p3.samsung.com (unknown [182.195.42.71]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180507epcas2p129248caeb7c00bd1478db2dd4f353e15~Cr-lSzWwI1897218972epcas2p1I; Tue, 12 Feb 2019 18:05:07 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 26.39.04134.3DA036C5; Wed, 13 Feb 2019 03:05:07 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20190212180506epcas2p43d7efeaec4a4ff63d13e5f79b281707a~Cr-k-EVtz3271632716epcas2p4F; Tue, 12 Feb 2019 18:05:06 +0000 (GMT) X-AuditID: b6c32a47-8c3ff70000001026-61-5c630ad34937 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id E8.30.03689.2DA036C5; Wed, 13 Feb 2019 03:05:06 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:06 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:29 +0100 Message-id: <20190212180342.32040-9-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmqe5lruQYg742dosrFw8xWWycsZ7V YurDJ2wW589vYLf4dqWDyeLyrjlsFjPO72OyWHvkLrvF4TftrBYXV3xhcuDy2PC5ic1j56y7 7B6bVnWyefRtWcXo8XmTXABrFJdNSmpOZllqkb5dAlfGn736BXusKn5PXsXewLjEoIuRk0NC wERie/Ntpi5GLg4hgR2MEmuvPGGHcL4zSuxunsUGU/WvaRkzRGIDo8TbM/MZIZxfjBLH3u5l AaliEzCU6D3axwhiiwiISdye0wnWwSzQwiQxZ+5SZpCEsECixKvnTWBFLAKqEr0bXoA18wpY S2z6s4EZYp28xPnedewgNqeAjcSzhd+gagQlfky+B2YzA9UcvPKcBWSBhMABNon2rpOsXYwc QI6LxNKZKhBzpCWerdrICGFXS+za3s0MUd/BKNFyYTvUMmuJw8cvskIM5ZPoOPyXHWIOr0RH mxBEiYfErDfXWSA+7meU6Dm0gHkCo9QsJDfNQnLTAkamVYxiqQXFuempxUYFxnrFibnFpXnp esn5uZsYwVGu5b6Dcds5n0OMAhyMSjy8K44mxQixJpYVV+YeYpTgYFYS4U1jTo4R4k1JrKxK LcqPLyrNSS0+xCjNwaIkzvtQem60kEB6YklqdmpqQWoRTJaJg1OqgbH1E5fynG9yMm9e6X9Q MvZUvBGZJzrd3H/zamZZg2yhi631az3Z3HYo1fIXWrVK918/2mfQZVBkoJHoPnP2AU2eteKf 1845saCWMVOz3s7K3bj+9nf5m5Mkyyw+64tzbtggGrRIXXpbC5vJ7gnnJCYwyrzvZb5rLvv0 x92vurcXeEsKaq1dpcRSnJFoqMVcVJwIABppC6ruAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQd1LXMkxBofO6lpcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgy/uzVL9hjVfF78ir2BsYlBl2MnBwS AiYS/5qWMYPYQgLrGCWezM7oYuQCsn8xShx8M4MNJMEmYCjRe7SPEcQWERCTuD2nkxmkiFmg iUli1+2L7CAJYYFEiVfPm8CKWARUJXo3vGABsXkFrCU2/dnADLFNXuJ87zqwek4BG4lnC78B 1XAAbbOWuLLJFqJcUOLH5HtgrcxA5QevPGeZwMg3C0lqFpLUAkamVYySqQXFuem5xUYFRnmp 5XrFibnFpXnpesn5uZsYgQG87bBW/w7Gx0viDzEKcDAq8fCuOJoUI8SaWFZcmXuIUYKDWUmE N405OUaINyWxsiq1KD++qDQntfgQozQHi5I4L3/+sUghgfTEktTs1NSC1CKYLBMHp1QDY3y+ btmakNYzK3falv1evTDr5uHcQlb+7GedLSs+r6v0WhGnf9Te2U5R0dZ9zV+5e9P4ZZSP/9N8 s6fnzQeO3b9ipyUlzH502FT95UyfKDlhT7UgqYoytZCwpO21VavX8rPeCqi+mFJacrP1dU4Q x1MmjdwbrZwX1fOPbDTtF+84fV18qnudEktxRqKhFnNRcSIAs2VydFwCAAA= X-CMS-MailID: 20190212180506epcas2p43d7efeaec4a4ff63d13e5f79b281707a CMS-TYPE: 102P X-CMS-RootMailID: 20190212180506epcas2p43d7efeaec4a4ff63d13e5f79b281707a References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 08/21] ASoC: samsung: i2s: Drop spinlock pointer from i2s_dai data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP As we now have the 'priv' pointer in most of the places we can use priv->lock directly, dropping extra indirection in the SFR region spinlock access. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 51 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 05f1de208307..0da07975d59b 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -87,8 +87,6 @@ struct i2s_dai { u32 quirks; const struct samsung_i2s_variant_regs *variant_regs; - spinlock_t *lock; - struct samsung_i2s_priv *priv; }; @@ -103,7 +101,7 @@ struct samsung_i2s_priv { void __iomem *addr; /* Spinlock protecting access to the device's registers */ - spinlock_t spinlock; + spinlock_t lock; /* CPU DAIs and their corresponding drivers */ struct i2s_dai *dai; @@ -527,9 +525,9 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, pm_runtime_get_sync(dai->dev); - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); mod = readl(priv->addr + I2SMOD); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); switch (clk_id) { case SAMSUNG_I2S_OPCLK: @@ -624,11 +622,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, goto err; } - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); mod = readl(priv->addr + I2SMOD); mod = (mod & ~mask) | val; writel(mod, priv->addr + I2SMOD); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); done: pm_runtime_put(dai->dev); @@ -709,7 +707,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) } pm_runtime_get_sync(dai->dev); - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); mod = readl(priv->addr + I2SMOD); /* * Don't change the I2S mode if any controller is active on this @@ -717,7 +715,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) */ if (any_active(i2s) && ((mod & (sdf_mask | lrp_rlow | mod_slave)) != tmp)) { - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); pm_runtime_put(dai->dev); dev_err(&i2s->pdev->dev, "%s:%d Other DAI busy\n", __func__, __LINE__); @@ -727,7 +725,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) mod &= ~(sdf_mask | lrp_rlow | mod_slave); mod |= tmp; writel(mod, priv->addr + I2SMOD); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); pm_runtime_put(dai->dev); return 0; @@ -812,11 +810,11 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); mod = readl(priv->addr + I2SMOD); mod = (mod & ~mask) | val; writel(mod, priv->addr + I2SMOD); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture); @@ -944,6 +942,7 @@ static int config_setup(struct i2s_dai *i2s) static int i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); struct snd_soc_pcm_runtime *rtd = substream->private_data; struct i2s_dai *i2s = to_info(rtd->cpu_dai); @@ -954,10 +953,10 @@ static int i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: pm_runtime_get_sync(dai->dev); - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); if (config_setup(i2s)) { - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); return -EINVAL; } @@ -966,12 +965,12 @@ static int i2s_trigger(struct snd_pcm_substream *substream, else i2s_txctrl(i2s, 1); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); if (capture) { i2s_rxctrl(i2s, 0); @@ -981,7 +980,7 @@ static int i2s_trigger(struct snd_pcm_substream *substream, i2s_fifo(i2s, FIC_TXFLUSH); } - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); pm_runtime_put(dai->dev); break; } @@ -1081,13 +1080,13 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) i2s->rfs = 0; i2s->bfs = 0; - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); i2s_txctrl(i2s, 0); i2s_rxctrl(i2s, 0); i2s_fifo(i2s, FIC_TXFLUSH); i2s_fifo(other, FIC_TXFLUSH); i2s_fifo(i2s, FIC_RXFLUSH); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); /* Gate CDCLK by default */ if (!is_opened(other)) @@ -1107,9 +1106,9 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) if (!is_secondary(i2s)) { if (i2s->quirks & QUIRK_NEED_RSTCLR) { - spin_lock_irqsave(i2s->lock, flags); + spin_lock_irqsave(&priv->lock, flags); writel(0, i2s->priv->addr + I2SCON); - spin_unlock_irqrestore(i2s->lock, flags); + spin_unlock_irqrestore(&priv->lock, flags); } } @@ -1316,13 +1315,13 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) ARRAY_SIZE(p_names), CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, priv->addr + I2SMOD, reg_info->rclksrc_off, - 1, 0, i2s->lock); + 1, 0, &priv->lock); priv->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev, i2s_clk_name[CLK_I2S_RCLK_PSR], i2s_clk_name[CLK_I2S_RCLK_SRC], CLK_SET_RATE_PARENT, - priv->addr + I2SPSR, 8, 6, 0, i2s->lock); + priv->addr + I2SPSR, 8, 6, 0, &priv->lock); p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR]; priv->clk_data.clk_num = 2; @@ -1332,7 +1331,7 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) i2s_clk_name[CLK_I2S_CDCLK], p_names[0], CLK_SET_RATE_PARENT, priv->addr + I2SMOD, reg_info->cdclkcon_off, - CLK_GATE_SET_TO_DISABLE, i2s->lock); + CLK_GATE_SET_TO_DISABLE, &priv->lock); priv->clk_data.clk_num += 1; priv->clk_data.clks = priv->clk_table; @@ -1410,8 +1409,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai = &priv->dai[SAMSUNG_I2S_ID_PRIMARY - 1]; - spin_lock_init(&priv->spinlock); - pri_dai->lock = &priv->spinlock; + spin_lock_init(&priv->lock); if (!np) { if (i2s_pdata == NULL) { @@ -1473,7 +1471,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (quirks & QUIRK_SEC_DAI) { sec_dai = &priv->dai[SAMSUNG_I2S_ID_SECONDARY - 1]; - sec_dai->lock = &priv->spinlock; sec_dai->variant_regs = pri_dai->variant_regs; sec_dai->dma_playback.addr = regs_base + I2STXDS; sec_dai->dma_playback.chan_name = "tx-sec"; From patchwork Tue Feb 12 18:03:30 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: 10808601 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 B6337188E for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4B7A2C2E5 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9517A2C3A2; Tue, 12 Feb 2019 19:01:28 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6B142C43C for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1B39926789E; Tue, 12 Feb 2019 19:05:27 +0100 (CET) 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 6F0C8267482; Tue, 12 Feb 2019 19:05:25 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id 20BEE2678FF for ; Tue, 12 Feb 2019 19:05:13 +0100 (CET) Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190212180512epoutp02127c5ad9c26cf9669e537feb15308187~Cr-qSn6J22787127871epoutp028; Tue, 12 Feb 2019 18:05:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190212180512epoutp02127c5ad9c26cf9669e537feb15308187~Cr-qSn6J22787127871epoutp028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994712; bh=UkmSZnsE5QcuKLYcmxbeg+maMvm8fp/YtSoDCIzjnNA=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=vEHGWzeAY5B1sd+sI3tYzvrTz9Dg05TYAMQBFLZ0N15B1V6znZ+2I3FzoRS21NImm nukNgw0EsGFF5nXUkLcx1SHZFbaJdoy1K+LwhAYot0qUo/YHqKdXYoxHTM4I0B9/rc KfhJGE6/OwtbANeDB7LnTGxFkcqFkSVtBwjhsLyU= Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180511epcas1p4b86cd6e46e8dfa5a9c36d10fb02c1fa2~Cr-pJbiTz3232832328epcas1p49; Tue, 12 Feb 2019 18:05:11 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 04.BF.04074.7DA036C5; Wed, 13 Feb 2019 03:05:11 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180510epcas1p47878c53f4d053461d23e8697cde1a63a~Cr-oViG2i0414104141epcas1p4g; Tue, 12 Feb 2019 18:05:10 +0000 (GMT) X-AuditID: b6c32a35-297ff70000000fea-84-5c630ad76341 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 33.11.04015.6DA036C5; Wed, 13 Feb 2019 03:05:10 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:10 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:30 +0100 Message-id: <20190212180342.32040-10-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7bCmru51ruQYg33n+CyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZt5uWMha8NKvYMnUpSwPjJN0uRk4O CQETiXXfutlAbCGBHYwSb+ebdjFyAdnfGSWmrullgym6s+MzM0RiA6PEljNzmSA6fjFKLGis AbHZBAwleo/2MYLYIgJiErfndII1MAu0MEnMmbuUGSQhLJAisfvmFXYQm0VAVeLG02csIDav gI1E++T5UNvkJc73rgOr4QSKP1v4DapGUOLH5HtgNjNQzcErz1lAFkgIHGCTmPtlLjtEs4vE yQWTgZZxANnSEpeO2kKEqyV2be9mhqjvYJRoubCdGSJhLXH4+EVWiKF8Eu++9rBC9PJKdLQJ QZR4SKw6up0R4vt+Romtc+exTGCUmoXkpllIblrAyLSKUSy1oDg3PbXYsMBQrzgxt7g0L10v OT93EyM4xrVMdzBOOedziFGAg1GJh3fF0aQYIdbEsuLK3EOMEhzMSiK8aczJMUK8KYmVValF +fFFpTmpxYcYpTlYlMR51zs4xwgJpCeWpGanphakFsFkmTg4pRoYLXRUzr1Ykbdvv5XejR2X zqQ2/U2KN5gnz/XfjM9lwuMdMusubQ1Rz3TzuaVpJZcq8OSLau1u310fdUWOZKR+3javwz54 p+Fb9g1lq8WmN+ReW/zl24vLM7oEPH4vPePX/jm/St720r2nu2NOhPLMXn+QpWBbKGN4TemZ 6yLtmy6UP5+w2/CJsxJLcUaioRZzUXEiAGsRX9DtAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd1rXMkxBu3rhS2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZt5uWMha8NKvYMnUpSwPjJN0uRk4O CQETiTs7PjN3MXJxCAmsY5ToefaMEcL5xSjx/OFsZpAqNgFDid6jfYwgtoiAmMTtOZ1gHcwC TUwSu25fZAdJCAukSOy+eQXMZhFQlbjx9BkLiM0rYCPRPnk+G8Q6eYnzvevAajiB4s8WfgOq 4QDaZi1xZZMtRLmgxI/J98BamYHKD155zjKBkW8WktQsJKkFjEyrGCVTC4pz03OLjQoM81LL 9YoTc4tL89L1kvNzNzECg3jbYa2+HYz3l8QfYhTgYFTi4V1xNClGiDWxrLgy9xCjBAezkghv GnNyjBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe23nHIoUE0hNLUrNTUwtSi2CyTBycUg2M1Yu0 Lt6rX8dfcGmiden2jOV1PR4rGv3d/gRfX3+x05x9RnN+1TbDRqEdzowbKxX35UZuVbY6cVB/ xaqglfe2Tk6YUh3vuKNmrb3K3LTortk+T5rSPPN2fNI47Rh379ZS4//8GyfZ/n0mEeHZULk0 6PmdX3JGB5fvV3ldqa1/eEkkU1OFyXwjJZbijERDLeai4kQAl6g9hV4CAAA= X-CMS-MailID: 20190212180510epcas1p47878c53f4d053461d23e8697cde1a63a CMS-TYPE: 101P X-CMS-RootMailID: 20190212180510epcas1p47878c53f4d053461d23e8697cde1a63a References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 09/21] ASoC: samsung: i2s: Move IP variant data to common driver data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The IP variant data is another thing common for both DAIs, move it to the driver's common data structure. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 0da07975d59b..8352f610ce35 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -85,7 +85,6 @@ struct i2s_dai { struct snd_dmaengine_dai_dma_data idma_playback; dma_filter_fn filter; u32 quirks; - const struct samsung_i2s_variant_regs *variant_regs; struct samsung_i2s_priv *priv; }; @@ -122,6 +121,8 @@ struct samsung_i2s_priv { u32 suspend_i2scon; u32 suspend_i2spsr; + const struct samsung_i2s_variant_regs *variant_regs; + /* The clock provider's data */ struct clk *clk_table[3]; struct clk_onecell_data clk_data; @@ -146,7 +147,7 @@ static inline bool is_slave(struct i2s_dai *i2s) struct samsung_i2s_priv *priv = i2s->priv; u32 mod = readl(priv->addr + I2SMOD); - return (mod & (1 << i2s->variant_regs->mss_off)) ? true : false; + return (mod & (1 << priv->variant_regs->mss_off)) ? true : false; } /* If this interface of the controller is transmitting data */ @@ -261,8 +262,8 @@ static inline unsigned get_rfs(struct i2s_dai *i2s) struct samsung_i2s_priv *priv = i2s->priv; u32 rfs; - rfs = readl(priv->addr + I2SMOD) >> i2s->variant_regs->rfs_off; - rfs &= i2s->variant_regs->rfs_mask; + rfs = readl(priv->addr + I2SMOD) >> priv->variant_regs->rfs_off; + rfs &= priv->variant_regs->rfs_mask; switch (rfs) { case 7: return 192; @@ -281,9 +282,9 @@ static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs) { struct samsung_i2s_priv *priv = i2s->priv; u32 mod = readl(priv->addr + I2SMOD); - int rfs_shift = i2s->variant_regs->rfs_off; + int rfs_shift = priv->variant_regs->rfs_off; - mod &= ~(i2s->variant_regs->rfs_mask << rfs_shift); + mod &= ~(priv->variant_regs->rfs_mask << rfs_shift); switch (rfs) { case 192: @@ -321,8 +322,8 @@ static inline unsigned get_bfs(struct i2s_dai *i2s) struct samsung_i2s_priv *priv = i2s->priv; u32 bfs; - bfs = readl(priv->addr + I2SMOD) >> i2s->variant_regs->bfs_off; - bfs &= i2s->variant_regs->bfs_mask; + bfs = readl(priv->addr + I2SMOD) >> priv->variant_regs->bfs_off; + bfs &= priv->variant_regs->bfs_mask; switch (bfs) { case 8: return 256; @@ -343,7 +344,7 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) struct samsung_i2s_priv *priv = i2s->priv; u32 mod = readl(priv->addr + I2SMOD); int tdm = i2s->quirks & QUIRK_SUPPORTS_TDM; - int bfs_shift = i2s->variant_regs->bfs_off; + int bfs_shift = priv->variant_regs->bfs_off; /* Non-TDM I2S controllers do not support BCLK > 48 * FS */ if (!tdm && bfs > 48) { @@ -351,7 +352,7 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) return; } - mod &= ~(i2s->variant_regs->bfs_mask << bfs_shift); + mod &= ~(priv->variant_regs->bfs_mask << bfs_shift); switch (bfs) { case 48: @@ -408,7 +409,7 @@ static void i2s_txctrl(struct i2s_dai *i2s, int on) { struct samsung_i2s_priv *priv = i2s->priv; void __iomem *addr = priv->addr; - int txr_off = i2s->variant_regs->txr_off; + int txr_off = priv->variant_regs->txr_off; u32 con = readl(addr + I2SCON); u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); @@ -459,7 +460,7 @@ static void i2s_rxctrl(struct i2s_dai *i2s, int on) { struct samsung_i2s_priv *priv = i2s->priv; void __iomem *addr = priv->addr; - int txr_off = i2s->variant_regs->txr_off; + int txr_off = priv->variant_regs->txr_off; u32 con = readl(addr + I2SCON); u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); @@ -516,7 +517,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); struct i2s_dai *other = get_other_dai(i2s); - const struct samsung_i2s_variant_regs *i2s_regs = i2s->variant_regs; + const struct samsung_i2s_variant_regs *i2s_regs = priv->variant_regs; unsigned int cdcon_mask = 1 << i2s_regs->cdclkcon_off; unsigned int rsrc_mask = 1 << i2s_regs->rclksrc_off; u32 mod, mask, val = 0; @@ -644,9 +645,9 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) u32 mod, tmp = 0; unsigned long flags; - lrp_shift = i2s->variant_regs->lrp_off; - sdf_shift = i2s->variant_regs->sdf_off; - mod_slave = 1 << i2s->variant_regs->mss_off; + lrp_shift = priv->variant_regs->lrp_off; + sdf_shift = priv->variant_regs->sdf_off; + mod_slave = 1 << priv->variant_regs->mss_off; sdf_mask = MOD_SDF_MASK << sdf_shift; lrp_rlow = MOD_LR_RLOW << lrp_shift; @@ -1023,7 +1024,6 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) struct i2s_dai *i2s = to_info(dai); u32 reg = readl(priv->addr + I2SFIC); snd_pcm_sframes_t delay; - const struct samsung_i2s_variant_regs *i2s_regs = i2s->variant_regs; WARN_ON(!pm_runtime_active(dai->dev)); @@ -1032,7 +1032,7 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) else if (is_secondary(i2s)) delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS)); else - delay = (reg >> i2s_regs->ftx0cnt_off) & 0x7f; + delay = (reg >> priv->variant_regs->ftx0cnt_off) & 0x7f; return delay; } @@ -1280,7 +1280,7 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) const char *p_names[2] = { NULL }; struct device *dev = &priv->pdev->dev; struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); - const struct samsung_i2s_variant_regs *reg_info = i2s->variant_regs; + const struct samsung_i2s_variant_regs *reg_info = priv->variant_regs; const char *i2s_clk_name[ARRAY_SIZE(i2s_clk_desc)]; struct clk *rclksrc; int ret, i; @@ -1399,6 +1399,8 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + priv->variant_regs = i2s_dai_data->i2s_variant_regs; + quirks = np ? i2s_dai_data->quirks : i2s_pdata->type.quirks; num_dais = (quirks & QUIRK_SEC_DAI) ? 2 : 1; priv->pdev = pdev; @@ -1457,7 +1459,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai->dma_playback.addr_width = 4; pri_dai->dma_capture.addr_width = 4; pri_dai->quirks = quirks; - pri_dai->variant_regs = i2s_dai_data->i2s_variant_regs; pri_dai->priv = priv; if (quirks & QUIRK_PRI_6CHAN) @@ -1471,7 +1472,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (quirks & QUIRK_SEC_DAI) { sec_dai = &priv->dai[SAMSUNG_I2S_ID_SECONDARY - 1]; - sec_dai->variant_regs = pri_dai->variant_regs; sec_dai->dma_playback.addr = regs_base + I2STXDS; sec_dai->dma_playback.chan_name = "tx-sec"; From patchwork Tue Feb 12 18:03:31 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: 10808577 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 6EC9C188E for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A4492C0E4 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E91C2C440; Tue, 12 Feb 2019 19:01:26 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52D922C0E4 for ; Tue, 12 Feb 2019 19:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5B966267989; Tue, 12 Feb 2019 19:05:29 +0100 (CET) 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 5CABE2679A8; Tue, 12 Feb 2019 19:05:26 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id CFAAD26794B for ; Tue, 12 Feb 2019 19:05:17 +0100 (CET) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190212180515epoutp0298bd964a7b13e2f0844190edf390e2bf~Cr-tI4vX62786327863epoutp027; Tue, 12 Feb 2019 18:05:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190212180515epoutp0298bd964a7b13e2f0844190edf390e2bf~Cr-tI4vX62786327863epoutp027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994715; bh=Z21vxVORT3Wmbw7H8ccHZm5nDTBzy6Pn1mvaXFj0K3M=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=lf4v2QxDUzh+0M0y9RPJ4VDDj/6rUBsjvTZUrIqtiA/KqF0CxsN7RovI+vjha54Ey fYnZJe8rWK/X4qr+4C7B/FRVXpS2o0R8v0EjoDrH96SQ2UU2gKD1LB5NocKxTVsPtO D+9BjLSP2ZtdqKj2V39dzDzmJH0PG0LXWGVZ/n9w= Received: from epsmges2p3.samsung.com (unknown [182.195.42.71]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20190212180514epcas2p2a9521e8bc97b2abe38fa7fc83b5d9ba9~Cr-r9U6P32848628486epcas2p2T; Tue, 12 Feb 2019 18:05:14 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 68.39.04134.ADA036C5; Wed, 13 Feb 2019 03:05:14 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180513epcas2p128eae26df9eef86550a4f628afd12603~Cr-rmT2cj1898118981epcas2p1E; Tue, 12 Feb 2019 18:05:13 +0000 (GMT) X-AuditID: b6c32a47-8abff70000001026-6e-5c630adadd5f Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id B9.30.03689.9DA036C5; Wed, 13 Feb 2019 03:05:13 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:13 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:31 +0100 Message-id: <20190212180342.32040-11-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7bCmue4truQYg1+/eCyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZX6auYy24olfR//4HewPjUrUuRg4O CQETib5Lrl2MXBxCAjsYJS6sOcQE4XxnlPi6dC9zFyMnWNH0cxuhEhsYJY52/2WGcH4xSkzd 384IUsUmYCjRe7QPzBYREJO4PacTrIhZoIVJYs7cpWCjhAUSJHZcbwWzWQRUJdbPmAJm8wrY SCyYc4QVYp28xPnedewgNidQ/NnCbywQNYISPybfA7OZgWoOXnnOArJAQuAIm8SJ/09YIJpd JNb+72KDsKUlnq3ayAhhV0vs2t7NDNHQwSjRcmE71HPWEoePX2SFmMon0XH4LzskZHglOtqE IEo8JCYuWQ71cj+jxNXVm5kmMErNQnLULCRHLWBkWsUollpQnJueWmxUYKxXnJhbXJqXrpec n7uJERznWu47GLed8znEKMDBqMTDu+JoUowQa2JZcWXuIUYJDmYlEd405uQYId6UxMqq1KL8 +KLSnNTiQ4zSHCxK4rwPpedGCwmkJ5akZqemFqQWwWSZODilGhgjJhz+5eqXJJzMLaa9MCT8 0lGxbVruX04GeKftmq/N8i1G5YXXjhXqmUbp8ua+d5iZH5vUb2lvz5G9Uro4+LD8vf963ToT XK8ctVeVSH3m2XwpKinS5o/crfgo/c+cUyc5zHV4H9KlL7z6kVuxx1V/4UUMbYaXfTeVvAqL v2CQmzP5D69zsRJLcUaioRZzUXEiAJJ2QrLvAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd2bXMkxBgv3m1pcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyvkxdx1pwRa+i//0P9gbGpWpdjJwc EgImEtPPbWTqYuTiEBJYxyhx7MJtZgjnF6PEkwPnWUCq2AQMJXqP9jGC2CICYhK353SCFTEL NDFJ7Lp9kb2LkYNDWCBBYvoJU5AaFgFVifUzpjCD2LwCNhIL5hxhhdgmL3G+dx07iM0JFH+2 8BsLSKuQgLXElU22EOWCEj8m3wNbywxUfvDKc5YJjHyzkKRmIUktYGRaxSiZWlCcm55bbFRg lJdarlecmFtcmpeul5yfu4kRGMLbDmv172B8vCT+EKMAB6MSD++Ko0kxQqyJZcWVuYcYJTiY lUR405iTY4R4UxIrq1KL8uOLSnNSiw8xSnOwKInz8ucfixQSSE8sSc1OTS1ILYLJMnFwSjUw xsjfUlzlVNAYrSZ7LG32xkWB9o43VfPUGxIcagI7lkcuMzDd8IvbhiP13T0Pl/knLbfPKVgR HMHwzl/gaI3HulNzfC6mn/i3QKGwKN3ho+bHX5ossy3FpgTf+nzdNPZ79LoHWcEbVrLFabuf /K9yqUf53tyn3zzv/d8oFVxtZLDWReJOR7uiEktxRqKhFnNRcSIAlJzz4F0CAAA= X-CMS-MailID: 20190212180513epcas2p128eae26df9eef86550a4f628afd12603 CMS-TYPE: 102P X-CMS-RootMailID: 20190212180513epcas2p128eae26df9eef86550a4f628afd12603 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 10/21] ASoC: samsung: i2s: Move quirks data to common driver data structure 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The quirk flags are common for the primary and the secondary DAI so move respective field from struct i2s_dai to common driver data structure. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 8352f610ce35..14d9fd658cfd 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -84,7 +84,6 @@ struct i2s_dai { struct snd_dmaengine_dai_dma_data dma_capture; struct snd_dmaengine_dai_dma_data idma_playback; dma_filter_fn filter; - u32 quirks; struct samsung_i2s_priv *priv; }; @@ -122,19 +121,13 @@ struct samsung_i2s_priv { u32 suspend_i2spsr; const struct samsung_i2s_variant_regs *variant_regs; + u32 quirks; /* The clock provider's data */ struct clk *clk_table[3]; struct clk_onecell_data clk_data; }; -struct i2s_dai *samsung_i2s_get_pri_dai(struct device *dev) -{ - struct samsung_i2s_priv *priv = dev_get_drvdata(dev); - - return &priv->dai[SAMSUNG_I2S_ID_PRIMARY - 1]; -} - /* Returns true if this is the 'overlay' stereo DAI */ static inline bool is_secondary(struct i2s_dai *i2s) { @@ -343,7 +336,7 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) { struct samsung_i2s_priv *priv = i2s->priv; u32 mod = readl(priv->addr + I2SMOD); - int tdm = i2s->quirks & QUIRK_SUPPORTS_TDM; + int tdm = priv->quirks & QUIRK_SUPPORTS_TDM; int bfs_shift = priv->variant_regs->bfs_off; /* Non-TDM I2S controllers do not support BCLK > 48 * FS */ @@ -563,7 +556,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs, case SAMSUNG_I2S_RCLKSRC_1: /* clock corrsponding to IISMOD[10] := 1 */ mask = 1 << i2s_regs->rclksrc_off; - if ((i2s->quirks & QUIRK_NO_MUXPSR) + if ((priv->quirks & QUIRK_NO_MUXPSR) || (clk_id == SAMSUNG_I2S_RCLKSRC_0)) clk_id = 0; else @@ -832,6 +825,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, static int i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); struct i2s_dai *other = get_other_dai(i2s); unsigned long flags; @@ -847,7 +841,7 @@ static int i2s_startup(struct snd_pcm_substream *substream, else i2s->mode |= DAI_MANAGER; - if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR)) + if (!any_active(i2s) && (priv->quirks & QUIRK_NEED_RSTCLR)) writel(CON_RSTCLR, i2s->priv->addr + I2SCON); spin_unlock_irqrestore(&lock, flags); @@ -929,7 +923,7 @@ static int config_setup(struct i2s_dai *i2s) if (is_slave(i2s)) return 0; - if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { + if (!(priv->quirks & QUIRK_NO_MUXPSR)) { psr = priv->rclk_srcrate / i2s->frmclk / rfs; writel(((psr - 1) << 8) | PSR_PSREN, priv->addr + I2SPSR); dev_dbg(&i2s->pdev->dev, @@ -1068,10 +1062,10 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture); - if (i2s->quirks & QUIRK_NEED_RSTCLR) + if (priv->quirks & QUIRK_NEED_RSTCLR) writel(CON_RSTCLR, priv->addr + I2SCON); - if (i2s->quirks & QUIRK_SUPPORTS_IDMA) + if (priv->quirks & QUIRK_SUPPORTS_IDMA) idma_reg_addr_init(priv->addr, i2s->sec_dai->idma_playback.addr); } @@ -1099,13 +1093,14 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); unsigned long flags; pm_runtime_get_sync(dai->dev); if (!is_secondary(i2s)) { - if (i2s->quirks & QUIRK_NEED_RSTCLR) { + if (priv->quirks & QUIRK_NEED_RSTCLR) { spin_lock_irqsave(&priv->lock, flags); writel(0, i2s->priv->addr + I2SCON); spin_unlock_irqrestore(&priv->lock, flags); @@ -1279,7 +1274,6 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) const char *clk_name[2] = { "i2s_opclk0", "i2s_opclk1" }; const char *p_names[2] = { NULL }; struct device *dev = &priv->pdev->dev; - struct i2s_dai *i2s = samsung_i2s_get_pri_dai(dev); const struct samsung_i2s_variant_regs *reg_info = priv->variant_regs; const char *i2s_clk_name[ARRAY_SIZE(i2s_clk_desc)]; struct clk *rclksrc; @@ -1305,7 +1299,7 @@ static int i2s_register_clock_provider(struct samsung_i2s_priv *priv) return -ENOMEM; } - if (!(i2s->quirks & QUIRK_NO_MUXPSR)) { + if (!(priv->quirks & QUIRK_NO_MUXPSR)) { /* Activate the prescaler */ u32 val = readl(priv->addr + I2SPSR); writel(val | PSR_PSREN, priv->addr + I2SPSR); @@ -1399,11 +1393,11 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - priv->variant_regs = i2s_dai_data->i2s_variant_regs; - quirks = np ? i2s_dai_data->quirks : i2s_pdata->type.quirks; num_dais = (quirks & QUIRK_SEC_DAI) ? 2 : 1; priv->pdev = pdev; + priv->variant_regs = i2s_dai_data->i2s_variant_regs; + priv->quirks = quirks; ret = i2s_alloc_dais(priv, i2s_dai_data, num_dais); if (ret < 0) @@ -1458,7 +1452,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai->dma_capture.chan_name = "rx"; pri_dai->dma_playback.addr_width = 4; pri_dai->dma_capture.addr_width = 4; - pri_dai->quirks = quirks; pri_dai->priv = priv; if (quirks & QUIRK_PRI_6CHAN) @@ -1481,7 +1474,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) } sec_dai->dma_playback.addr_width = 4; - sec_dai->quirks = quirks; sec_dai->idma_playback.addr = idma_addr; sec_dai->pri_dai = pri_dai; sec_dai->priv = priv; From patchwork Tue Feb 12 18:03:32 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: 10808587 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 8520B18A6 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70E0C2C2C8 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E5B42C3F2; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77F1E2C2E5 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0724E2679C6; Tue, 12 Feb 2019 19:05:31 +0100 (CET) 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 6981826798B; Tue, 12 Feb 2019 19:05:28 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by alsa0.perex.cz (Postfix) with ESMTP id AE73E26798A for ; Tue, 12 Feb 2019 19:05:20 +0100 (CET) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190212180518epoutp03283913f092220bbb7d312e12e97de507~Cr-vjnX6H2783327833epoutp03d; Tue, 12 Feb 2019 18:05:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190212180518epoutp03283913f092220bbb7d312e12e97de507~Cr-vjnX6H2783327833epoutp03d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994718; bh=yr7j0mmEfQdXsLpTVDz398hU2ekDJIDFpZ+QayW8Sio=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=qldPeRl/GSegp/9cbn1o9TZ5QhCHHSGsyi8Cvo9s5xIc55DCPrVyxoSEBhKxwfS1x d35SlSh5zG/C07zpMt15q4MOQ3G4A/qw4oTwilqh97/qiW7Hrtv6Hg5Y4oew9JQBdp k9tzKQ9H/XsHFpZqOBFgWMkE40Sa7znPdJL6Evzk= Received: from epsmges1p2.samsung.com (unknown [182.195.42.54]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180517epcas1p1a40a2b521e3030df6513347272dff799~Cr-vPFFoG0083500835epcas1p1E; Tue, 12 Feb 2019 18:05:17 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id C0.FC.04173.DDA036C5; Wed, 13 Feb 2019 03:05:17 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180517epcas1p1fdb94e96f06b23dca66d63b3559f6c0b~Cr-u8vO9i1881518815epcas1p1Q; Tue, 12 Feb 2019 18:05:17 +0000 (GMT) X-AuditID: b6c32a36-5c1ff7000000104d-32-5c630add4463 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 04.11.04015.DDA036C5; Wed, 13 Feb 2019 03:05:17 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:17 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:32 +0100 Message-id: <20190212180342.32040-12-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7bCmge5druQYg58dWhZXLh5istg4Yz2r xdSHT9gszp/fwG7x7UoHk8XlXXPYLGac38dksfbIXXaLw2/aWS0urvjC5MDlseFzE5vHzll3 2T02repk8+jbsorR4/MmuQDWKC6blNSczLLUIn27BK6Mha2OBTNFK5pnbWBpYDwq2MXIySEh YCLx6uglti5GLg4hgR2MEmsmr2OCcL4zSux+/IcFpqr74SOoqg2MEjdfHINyfjFKXF7WwghS xSZgKNF7tA/MFhEQk7g9p5MZpIhZoIVJYs7cpcwgCWEBL4m9S3axg9gsAqoSN5a8BGvgFbCR eHX7BzPEOnmJ873rwGo4geLPFn5jgagRlPgx+R6YzQxUc/DKcxaQBRICR9gkFp1+AdTMAeS4 SCxd7Q9hSktcOmoLMbJaYtf2bmaI8g5GiZYL26F2WUscPn6RFWImn8S7rz2sEL28Eh1tQhAl HhIvH+9hgXi4n1Hi9usLTBMYpWYhOWkWkpMWMDKtYhRLLSjOTU8tNiww0itOzC0uzUvXS87P 3cQIjnEtsx2Mi875HGIU4GBU4uFdcTQpRog1say4MvcQowQHs5IIbxpzcowQb0piZVVqUX58 UWlOavEhRmkOFiVx3vUOzjFCAumJJanZqakFqUUwWSYOTqkGRsGHER038piS9i3nZFe6GWw1 /+vJK2/1b5xV2zZjQqrxou/7Vgm59F96knxw576Ds91r5jjG9bLtfbVZaG7yjxeut76d+rJV 1/Ll8aap20qMPc4XiHakdHCzXju4cb78xT3zvMpWNDXenH1ivyfjLz35lt0qHh81cip2xF+6 yMn2o/gfW6CjU6ASS3FGoqEWc1FxIgBFMFFG7QIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd27XMkxBh8WSltcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyFrY6FswUrWietYGlgfGoYBcjJ4eE gIlE98NHbF2MXBxCAusYJY4e+8AE4fxilNj/bAcjSBWbgKFE79E+MFtEQEzi9pxOZpAiZoEm Joldty+ygySEBbwk9i7ZBWazCKhK3FjyEqyBV8BG4tXtH8wQ6+QlzveuA6vhBIo/W/iNpYuR A2ibtcSVTbYQ5YISPybfYwGxmYHKD155zjKBkW8WktQsJKkFjEyrGCVTC4pz03OLjQoM81LL 9YoTc4tL89L1kvNzNzECQ3jbYa2+HYz3l8QfYhTgYFTi4V1xNClGiDWxrLgy9xCjBAezkghv GnNyjBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe23nHIoUE0hNLUrNTUwtSi2CyTBycUg2MabxO Vfs/R27+cPRTO9fW3vkGv6K3r3q+vXDBgq1bTsYffXzMMEPl7+7r69JfaZ3Y+iFz9/1jk280 PLd5s+D7gpOn5jnkvmrbYK9ms9L/pp+X0v8dB+o7XzwvWzfzbfufQ0KSaYY3UrYdXqmvHc35 OD3zU428h9qH7/pvnudNy5hcaM28VMDIX0uJpTgj0VCLuag4EQCZxqENXQIAAA== X-CMS-MailID: 20190212180517epcas1p1fdb94e96f06b23dca66d63b3559f6c0b CMS-TYPE: 101P X-CMS-RootMailID: 20190212180517epcas1p1fdb94e96f06b23dca66d63b3559f6c0b References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 11/21] ASoC: samsung: i2s: Get rid of a static spinlock 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch makes the spinlock serializing access to the primary/secondary PCM a per I2S controller lock, rather than a global one. There is no need to have a global lock across multiple I2S controllers in the SoC. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 14d9fd658cfd..1156d63ce923 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -88,9 +88,6 @@ struct i2s_dai { struct samsung_i2s_priv *priv; }; -/* Lock for cross i/f checks */ -static DEFINE_SPINLOCK(lock); - struct samsung_i2s_priv { struct platform_device *pdev; struct platform_device *pdev_sec; @@ -101,6 +98,9 @@ struct samsung_i2s_priv { /* Spinlock protecting access to the device's registers */ spinlock_t lock; + /* Lock for cross i/f checks */ + spinlock_t pcm_lock; + /* CPU DAIs and their corresponding drivers */ struct i2s_dai *dai; struct snd_soc_dai_driver *dai_drv; @@ -832,7 +832,7 @@ static int i2s_startup(struct snd_pcm_substream *substream, pm_runtime_get_sync(dai->dev); - spin_lock_irqsave(&lock, flags); + spin_lock_irqsave(&priv->pcm_lock, flags); i2s->mode |= DAI_OPENED; @@ -844,7 +844,7 @@ static int i2s_startup(struct snd_pcm_substream *substream, if (!any_active(i2s) && (priv->quirks & QUIRK_NEED_RSTCLR)) writel(CON_RSTCLR, i2s->priv->addr + I2SCON); - spin_unlock_irqrestore(&lock, flags); + spin_unlock_irqrestore(&priv->pcm_lock, flags); return 0; } @@ -852,11 +852,12 @@ static int i2s_startup(struct snd_pcm_substream *substream, static void i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { + struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = to_info(dai); struct i2s_dai *other = get_other_dai(i2s); unsigned long flags; - spin_lock_irqsave(&lock, flags); + spin_lock_irqsave(&priv->pcm_lock, flags); i2s->mode &= ~DAI_OPENED; i2s->mode &= ~DAI_MANAGER; @@ -868,7 +869,7 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, i2s->rfs = 0; i2s->bfs = 0; - spin_unlock_irqrestore(&lock, flags); + spin_unlock_irqrestore(&priv->pcm_lock, flags); pm_runtime_put(dai->dev); } @@ -1406,6 +1407,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai = &priv->dai[SAMSUNG_I2S_ID_PRIMARY - 1]; spin_lock_init(&priv->lock); + spin_lock_init(&priv->pcm_lock); if (!np) { if (i2s_pdata == NULL) { From patchwork Tue Feb 12 18:03:33 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: 10808575 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 615BE13B5 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BD882C2E5 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4008D2C47C; Tue, 12 Feb 2019 19:01:26 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63BFE2C2E5 for ; Tue, 12 Feb 2019 19:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6D10D267946; Tue, 12 Feb 2019 19:05:37 +0100 (CET) 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 961E7267946; Tue, 12 Feb 2019 19:05:35 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id 3CAB72679BB for ; Tue, 12 Feb 2019 19:05:25 +0100 (CET) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190212180523epoutp02f276963bc4b63488d43a2ed37bd3d352~Cr-0X8PUp3105631056epoutp02E; Tue, 12 Feb 2019 18:05:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190212180523epoutp02f276963bc4b63488d43a2ed37bd3d352~Cr-0X8PUp3105631056epoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994723; bh=pAuxs1+EkB2/mHJcleCycRr4HTG+NJd9biU+Idi/yPw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Gdl0nkFtDzL6CVclNSNNRcw7d2auKjQldrqYZPUdtpCpAGtHsrcUn1Gt2Z8AX7CGT wsy7jrusdjyAUBJY7/s8c5TlshelPTFlgFdqAM0Lk3/EuiomC8RiPjikPdHfdUwqvk K9nQ1wjckX+F9J5gDop71O4w7GKnjYwCXn22F65U= Received: from epsmges2p4.samsung.com (unknown [182.195.42.72]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20190212180522epcas2p43831895b90c6314cca08a73ba1d406b8~Cr-zkkmjR2309023090epcas2p4A; Tue, 12 Feb 2019 18:05:22 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 5D.1D.04093.2EA036C5; Wed, 13 Feb 2019 03:05:22 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20190212180521epcas2p3d3a637804b82c8d537be98a399e1ba7b~Cr-yTfXwI0149801498epcas2p3Y; Tue, 12 Feb 2019 18:05:21 +0000 (GMT) X-AuditID: b6c32a48-18bff70000000ffd-fd-5c630ae23112 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 8A.30.03689.0EA036C5; Wed, 13 Feb 2019 03:05:21 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:20 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:33 +0100 Message-id: <20190212180342.32040-13-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7bCmhe4jruQYg6s7xC2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZu38eZCr4ZlYxryG5gbFbt4uRk0NC wETiXs82pi5GLg4hgR2MEtNOb2aDcL4zSjxfvpANpqrx3FcWiMQGRolXj74yQzi/GCX+zlnD BFLFJmAo0Xu0jxHEFhEQk7g9pxOsiFmghUliztylzCAJYYEQiQvtL1hBbBYBVYmrCx6zgNi8 AjYSz9/3MEOsk5c437uOHcTmBIo/W/gNqkZQ4sfke2A2M1DNwSvPwU6SEDjAJrHp22dGiGYX ieaO6+wQtrTEs1UboeLVEru2dzNDNHQwSrRc2A61zVri8PGLrBBT+SQ6Dv8FauYAivNKdLQJ QZR4SOw68goaSv2MErfmrGSewCg1C8lRs5ActYCRaRWjWGpBcW56arFRgYlecWJucWleul5y fu4mRnCca3nsYDxwzucQowAHoxIP74qjSTFCrIllxZW5hxglOJiVRHjTmJNjhHhTEiurUovy 44tKc1KLDzFKc7AoifM+lJ4bLSSQnliSmp2aWpBaBJNl4uCUamAMuXgjKzYqyDbs4Iyamgt2 S+wbPmYo/t/qu0m2f3mk8xU7k5jSgJ6dFieZJvNY+fut9Nv9N9lzzVONmbPPHFt+rWLNtjoO dcVZbU8d192Y3ra6cmU+z/dKrfj+5/LVumeviDG5vZz54/d0b6lLP8SFvnRpX+d5/MSVQVTe d86eT3su3bmWveuFEktxRqKhFnNRcSIAUo4m1e8CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd2HXMkxBj/bGC2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZu38eZCr4ZlYxryG5gbFbt4uRk0NC wESi8dxXli5GLg4hgXWMEvfnPYNyfjFKvNwxgwWkik3AUKL3aB8jiC0iICZxe04nM0gRs0AT k8Su2xfZQRLCAiESN9/dYAOxWQRUJa4ueAzWzCtgI/H8fQ8zxDp5ifO968DqOYHizxZ+A6rh ANpmLXFlky1EuaDEj8n3wFqZgcoPXnnOMoGRbxaS1CwkqQWMTKsYJVMLinPTc4uNCozyUsv1 ihNzi0vz0vWS83M3MQJDeNthrf4djI+XxB9iFOBgVOLhXXE0KUaINbGsuDL3EKMEB7OSCG8a c3KMEG9KYmVValF+fFFpTmrxIUZpDhYlcV7+/GORQgLpiSWp2ampBalFMFkmDk6pBkaJ5JY3 97UeX9i2NKn5FAdDwYvw8w83LnE+MWGFctfy9tsz7051cAicnLbb3aFh1tPvQcxFgoIan7iE FOdN2LhVbU3UxkPHphTZnUtfOtvPVudZqOIHySUxu/zaFl5hS/3OG/3u8eKMK/tzjZ0XzPrZ tsku4+u1M4zPA7arVq/49EXuknX/C6UIJZbijERDLeai4kQA8eBnxV0CAAA= X-CMS-MailID: 20190212180521epcas2p3d3a637804b82c8d537be98a399e1ba7b CMS-TYPE: 102P X-CMS-RootMailID: 20190212180521epcas2p3d3a637804b82c8d537be98a399e1ba7b References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 12/21] ASoC: samsung: odroid: Add support for secondary CPU DAI 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds DPCM links in order to support the secondary I2S interface. For the secondary PCM interface to be actually available one more entry should be added to the sound-dai property in sound/cpu node in DT. The changes in driver are done in a way so we are backwards compatible with existing DTS/DTB, i.e. if the cpu sound-dai property contains only one entry only one PCM will be registered. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/odroid.c | 131 +++++++++++++++++++++++++++---------- 1 file changed, 95 insertions(+), 36 deletions(-) diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c index e7b371b07230..18bb3bfe0300 100644 --- a/sound/soc/samsung/odroid.c +++ b/sound/soc/samsung/odroid.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -17,21 +18,24 @@ struct odroid_priv { struct snd_soc_card card; - struct snd_soc_dai_link dai_link; - struct clk *clk_i2s_bus; struct clk *sclk_i2s; }; -static int odroid_card_startup(struct snd_pcm_substream *substream) +static int odroid_card_fe_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2); + return 0; } -static int odroid_card_hw_params(struct snd_pcm_substream *substream, +static const struct snd_soc_ops odroid_card_fe_ops = { + .startup = odroid_card_fe_startup, +}; + +static int odroid_card_be_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -86,19 +90,55 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream, return 0; } -static const struct snd_soc_ops odroid_card_ops = { - .startup = odroid_card_startup, - .hw_params = odroid_card_hw_params, +static const struct snd_soc_ops odroid_card_be_ops = { + .hw_params = odroid_card_be_hw_params, +}; + +static struct snd_soc_dai_link odroid_card_dais[] = { + { + /* Primary FE <-> BE link */ + .codec_name = "snd-soc-dummy", + .codec_dai_name = "snd-soc-dummy-dai", + .ops = &odroid_card_fe_ops, + .name = "Primary", + .stream_name = "Primary", + .platform_name = "3830000.i2s", + .dynamic = 1, + .dpcm_playback = 1, + }, { + /* BE <-> CODECs link */ + .name = "I2S Mixer", + .cpu_name = "snd-soc-dummy", + .cpu_dai_name = "snd-soc-dummy-dai", + .platform_name = "snd-soc-dummy", + .ops = &odroid_card_be_ops, + .no_pcm = 1, + .dpcm_playback = 1, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + }, { + /* Secondary FE <-> BE link */ + .playback_only = 1, + .codec_name = "snd-soc-dummy", + .codec_dai_name = "snd-soc-dummy-dai", + .ops = &odroid_card_fe_ops, + .name = "Secondary", + .stream_name = "Secondary", + .platform_name = "samsung-i2s-sec", + .dynamic = 1, + .dpcm_playback = 1, + } }; static int odroid_audio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *cpu, *codec; + struct device_node *cpu, *cpu_dai, *codec; struct odroid_priv *priv; - struct snd_soc_dai_link *link; struct snd_soc_card *card; - int ret; + struct snd_soc_dai_link *link, *codec_link; + int num_pcms, ret, i; + struct of_phandle_args args = {}; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -130,45 +170,67 @@ static int odroid_audio_probe(struct platform_device *pdev) return ret; } - link = &priv->dai_link; - - link->ops = &odroid_card_ops; - link->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBS_CFS; - - card->dai_link = &priv->dai_link; - card->num_links = 1; + card->dai_link = odroid_card_dais; + card->num_links = ARRAY_SIZE(odroid_card_dais); cpu = of_get_child_by_name(dev->of_node, "cpu"); codec = of_get_child_by_name(dev->of_node, "codec"); + link = card->dai_link; + codec_link = &card->dai_link[1]; - link->cpu_of_node = of_parse_phandle(cpu, "sound-dai", 0); - if (!link->cpu_of_node) { - dev_err(dev, "Failed parsing cpu/sound-dai property\n"); - return -EINVAL; + /* + * For backwards compatibility create the secondary CPU DAI link only + * if there are 2 CPU DAI entries in the cpu sound-dai property in DT. + */ + num_pcms = of_count_phandle_with_args(cpu, "sound-dai", + "#sound-dai-cells"); + if (num_pcms == 1) + card->num_links--; + + for (i = 0; i < num_pcms; i++, link += 2) { + ret = of_parse_phandle_with_args(cpu, "sound-dai", + "#sound-dai-cells", i, &args); + if (ret < 0) + return ret; + + if (!args.np) { + dev_err(dev, "sound-dai property parse error: %d\n", ret); + return -EINVAL; + } + + ret = snd_soc_get_dai_name(&args, &link->cpu_dai_name); + of_node_put(args.np); + + if (ret < 0) + return ret; } - ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); + cpu_dai = of_parse_phandle(cpu, "sound-dai", 0); + of_node_put(cpu); + of_node_put(codec); + + ret = snd_soc_of_get_dai_link_codecs(dev, codec, codec_link); if (ret < 0) goto err_put_codec_n; - link->platform_of_node = link->cpu_of_node; - - link->name = "Primary"; - link->stream_name = link->name; - + /* Set capture capability only for boards with the MAX98090 CODEC */ + if (codec_link->num_codecs > 1) { + card->dai_link[0].dpcm_capture = 1; + card->dai_link[1].dpcm_capture = 1; + } - priv->sclk_i2s = of_clk_get_by_name(link->cpu_of_node, "i2s_opclk1"); + priv->sclk_i2s = of_clk_get_by_name(cpu_dai, "i2s_opclk1"); if (IS_ERR(priv->sclk_i2s)) { ret = PTR_ERR(priv->sclk_i2s); - goto err_put_i2s_n; + goto err_put_codec_n; } - priv->clk_i2s_bus = of_clk_get_by_name(link->cpu_of_node, "iis"); + priv->clk_i2s_bus = of_clk_get_by_name(cpu_dai, "iis"); if (IS_ERR(priv->clk_i2s_bus)) { ret = PTR_ERR(priv->clk_i2s_bus); goto err_put_sclk; } + of_node_put(cpu_dai); ret = devm_snd_soc_register_card(dev, card); if (ret < 0) { @@ -182,10 +244,8 @@ static int odroid_audio_probe(struct platform_device *pdev) clk_put(priv->clk_i2s_bus); err_put_sclk: clk_put(priv->sclk_i2s); -err_put_i2s_n: - of_node_put(link->cpu_of_node); err_put_codec_n: - snd_soc_of_put_dai_link_codecs(link); + snd_soc_of_put_dai_link_codecs(codec_link); return ret; } @@ -193,8 +253,7 @@ static int odroid_audio_remove(struct platform_device *pdev) { struct odroid_priv *priv = platform_get_drvdata(pdev); - of_node_put(priv->dai_link.cpu_of_node); - snd_soc_of_put_dai_link_codecs(&priv->dai_link); + snd_soc_of_put_dai_link_codecs(&priv->card.dai_link[1]); clk_put(priv->sclk_i2s); clk_put(priv->clk_i2s_bus); From patchwork Tue Feb 12 18:03:34 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: 10808589 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 A2DB7188E for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 910022C2C4 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 852CC2C2E5; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77A3F2C2C4 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CFE842679BE; Tue, 12 Feb 2019 19:05:40 +0100 (CET) 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 4BA982679C5; Tue, 12 Feb 2019 19:05:38 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by alsa0.perex.cz (Postfix) with ESMTP id 8B83326780A for ; Tue, 12 Feb 2019 19:05:27 +0100 (CET) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190212180525epoutp0312de0c37c1959091b76d646051217826~Cr-2O5XiZ2786327863epoutp03b; Tue, 12 Feb 2019 18:05:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190212180525epoutp0312de0c37c1959091b76d646051217826~Cr-2O5XiZ2786327863epoutp03b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994725; bh=h/BRQ5rh3TIQbUVJZGgDFpZLAJ0tKI4OPOpcXUe9s5Y=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=fTf66zHsj/ohwZrWmVtcA+jzGAABNJNvrMS77r01V2kwXnYisNuqrLM4V1zuMA+DA J8/Tq2dNlOzxOrHyB2J8dAMpEXptHBN10n7fMlK9eFqpzrAX58sCUCr5EIXUGvCnID 7AolTRyvpz/XvIJjYSj1pPIHW5wK4NpXllG6uaEQ= Received: from epsmges1p3.samsung.com (unknown [182.195.42.55]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190212180525epcas1p323c55828e1cbecd645ce687f2e23e09b~Cr-1-GITh3011530115epcas1p3V; Tue, 12 Feb 2019 18:05:25 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 45.28.04069.4EA036C5; Wed, 13 Feb 2019 03:05:25 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180524epcas1p41b5845cef4c81798f4a07fe8c53f1288~Cr-1p8RMh3232832328epcas1p4W; Tue, 12 Feb 2019 18:05:24 +0000 (GMT) X-AuditID: b6c32a37-971ff70000000fe5-e1-5c630ae46ae0 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E4.11.04015.4EA036C5; Wed, 13 Feb 2019 03:05:24 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:24 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:34 +0100 Message-id: <20190212180342.32040-14-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7bCmge5TruQYgzupFlcuHmKy2DhjPavF 1IdP2CzOn9/AbvHtSgeTxeVdc9gsZpzfx2Sx9shddovDb9pZLS6u+MLkwOWx4XMTm8fOWXfZ PTat6mTz6NuyitHj8ya5ANYoLpuU1JzMstQifbsEroxLLbNYC1plKm60P2RtYNwn3sXIySEh YCIxffZuli5GLg4hgR2MEh23/rBBON8ZJSbc/M4IU3Xzwxmoqg2MEtM/PmSHcH4xSnzb84gN pIpNwFCi92gfWIeIgJjE7TmdzCBFzAItTBJz5i5lBkkIC8RJ3P65EKyBRUBVYsfpTnYQm1fA RmLNvttQ6+QlzveuA4tzAsWfLfzGAlEjKPFj8j0wmxmo5uCV5ywQ9UfYJGa1G3cxcgDZLhI3 +hMhTGmJS0dtISqqJXZt7wY7R0Kgg1Gi5cJ2ZoiEtcTh4xdZIUbySbz72sMK0csr0dEmBFHi IXFs5luo5/sZJbZtP8o6gVFqFpKLZiG5aAEj0ypGsdSC4tz01GLDAmO94sTc4tK8dL3k/NxN jOAI1zLfwbjhnM8hRgEORiUe3hVHk2KEWBPLiitzDzFKcDArifCmMSfHCPGmJFZWpRblxxeV 5qQWH2KU5mBREudd7+AcIySQnliSmp2aWpBaBJNl4uCUamDMXiBRxKxepL7+jPVizcUKDEVf 5I8Z/tT/Ns/mw7HqOt2IIwoTdx8qMeA2mr/GPt3665KK6qeCxc1ut9vZxN/aLEipPbJkxf4a Wxe3VXclGb5KbZxo19QTVKliI2m5JTviP2Owz9YdawPff3wSqnr5guVbA6HlEdsCZ91UvP+8 YatVdIiQmL4SS3FGoqEWc1FxIgDPSQQI7AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd0nXMkxBk+fKFtcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyLrXMYi1olam40f6QtYFxn3gXIyeH hICJxM0PZ1i6GLk4hATWMUocnjKbHcL5xSjRsOMCK0gVm4ChRO/RPkYQW0RATOL2nE5mkCJm gSYmiV23L7KDJIQF4iRu/1zIBmKzCKhK7DjdCRbnFbCRWLPvNiPEOnmJ873rwOKcQPFnC78B reYA2mYtcWWTLUS5oMSPyfdYQGxmoPKDV56zTGDkm4UkNQtJagEj0ypGydSC4tz03GKjAsO8 1HK94sTc4tK8dL3k/NxNjMAg3nZYq28H4/0l8YcYBTgYlXh4VxxNihFiTSwrrsw9xCjBwawk wpvGnBwjxJuSWFmVWpQfX1Sak1p8iFGag0VJnPd23rFIIYH0xJLU7NTUgtQimCwTB6dUA2O4 xsyfP/UY39/l/RvWnnRBKUleZfmX1tMXtpiGBz9k/Wo1X0P9CRvLU/ftqXoKH7k+x/sL8Z0N WrXogl5JX9HJgOMlk9hO/to769231l867336JRlnzSh1ftvE9PhRXz1Xn/fvwKv/JZeWGYl1 X1w879yjk2JbN5VeqNsVuso6otpeS3F/ipsSS3FGoqEWc1FxIgATjxU2XgIAAA== X-CMS-MailID: 20190212180524epcas1p41b5845cef4c81798f4a07fe8c53f1288 CMS-TYPE: 101P X-CMS-RootMailID: 20190212180524epcas1p41b5845cef4c81798f4a07fe8c53f1288 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 13/21] ASoC: samsung: Specify DMA channel names through custom DMA config 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This is a part of conversion of Samsung platforms to use the custom DMA config for specifying DMA channel names, in addition to passing custom DMA device for the secondary CPU DAI's "PCM" component for some variants of the I2S controller. We also don't set the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME any more as setting it wouldn't allow to specify DMA channels through the custom DMA config. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/dmaengine.c | 12 ++++-------- sound/soc/samsung/i2s.c | 2 +- sound/soc/samsung/s3c2412-i2s.c | 2 +- sound/soc/samsung/s3c24xx-i2s.c | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sound/soc/samsung/dmaengine.c b/sound/soc/samsung/dmaengine.c index 84601fa9aa46..302871974cb3 100644 --- a/sound/soc/samsung/dmaengine.c +++ b/sound/soc/samsung/dmaengine.c @@ -28,7 +28,6 @@ int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter, const char *tx, const char *rx, struct device *dma_dev) { - unsigned int flags = SND_DMAENGINE_PCM_FLAG_COMPAT; struct snd_dmaengine_pcm_config *pcm_conf; pcm_conf = devm_kzalloc(dev, sizeof(*pcm_conf), GFP_KERNEL); @@ -39,14 +38,11 @@ int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter, pcm_conf->compat_filter_fn = filter; pcm_conf->dma_dev = dma_dev; - if (dev->of_node) { - pcm_conf->chan_names[SNDRV_PCM_STREAM_PLAYBACK] = tx; - pcm_conf->chan_names[SNDRV_PCM_STREAM_CAPTURE] = rx; - } else { - flags |= SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME; - } + pcm_conf->chan_names[SNDRV_PCM_STREAM_PLAYBACK] = tx; + pcm_conf->chan_names[SNDRV_PCM_STREAM_CAPTURE] = rx; - return devm_snd_dmaengine_pcm_register(dev, pcm_conf, flags); + return devm_snd_dmaengine_pcm_register(dev, pcm_conf, + SND_DMAENGINE_PCM_FLAG_COMPAT); } EXPORT_SYMBOL_GPL(samsung_asoc_dma_platform_register); diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 1156d63ce923..72282d08d2c1 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1460,7 +1460,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai->drv->playback.channels_max = 6; ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter, - NULL, NULL, NULL); + "tx", "rx", NULL); if (ret < 0) goto err_disable_clk; diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 67dfa27ae321..c08638b0e458 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -177,7 +177,7 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev) ret = samsung_asoc_dma_platform_register(&pdev->dev, pdata->dma_filter, - NULL, NULL, NULL); + "tx", "rx", NULL); if (ret) { pr_err("failed to register the DMA: %d\n", ret); return ret; diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index ba0f2b94f8d4..a8026b640c95 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -446,7 +446,7 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) s3c24xx_i2s_pcm_stereo_in.addr = res->start + S3C2410_IISFIFO; ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL, - NULL, NULL, NULL); + "tx", "rx", NULL); if (ret) { dev_err(&pdev->dev, "Failed to register the DMA: %d\n", ret); return ret; From patchwork Tue Feb 12 18:03:35 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: 10808581 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 29756184E for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 176872C33B for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BC532C496; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 961012C3F7 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 578742679DF; Tue, 12 Feb 2019 19:05:50 +0100 (CET) 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 4D8452679D0; Tue, 12 Feb 2019 19:05:48 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 5D21F2679DF for ; Tue, 12 Feb 2019 19:05:31 +0100 (CET) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180530epoutp01f23cf58c33372d2da0e58011c4426e16~Cr-6sA4px1898018980epoutp01x; Tue, 12 Feb 2019 18:05:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180530epoutp01f23cf58c33372d2da0e58011c4426e16~Cr-6sA4px1898018980epoutp01x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994730; bh=mDsrQB9XFl+b+gU0NhyopnqhCmadZz0dft/zEEJkkWo=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=o/QuVJEgy0fo7vRkmlXQe8xOV2eVzcMynZtzm3ZuY/PmH9PLffhlf4dAxeS4RU4kL uyVFOhpzBcNCs4Wvs5yHsC28p8xqn4pcWjjaUsjSiXQ4hXtYzlEUPup+bpR/88Qw6T lKELggR3NOEigNsaNGxSdetPC3H3awyxOQzJl3kg= Received: from epsmges2p2.samsung.com (unknown [182.195.42.70]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20190212180528epcas2p49b2c3cbbb17dc46f2fb679c735f3224f~Cr-5SQf8A2309023090epcas2p4K; Tue, 12 Feb 2019 18:05:28 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id C2.5C.04136.8EA036C5; Wed, 13 Feb 2019 03:05:28 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180528epcas2p1a534f0f69932c28608b0a139ddfd3596~Cr-46qRR82517825178epcas2p1F; Tue, 12 Feb 2019 18:05:28 +0000 (GMT) X-AuditID: b6c32a46-2bfff70000001028-96-5c630ae8f109 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 3B.30.03689.8EA036C5; Wed, 13 Feb 2019 03:05:28 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:28 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:35 +0100 Message-id: <20190212180342.32040-15-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7bCmhe4LruQYg+lTFSyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZby8rFKwRqjh5O7SBcTN/FyMnh4SA icTs92eYuxi5OIQEdjBKrG/bzQrhfGeU+NKwgB2mat+jn+wQiQ2MEoemnGKDcH4xSrzadpIJ pIpNwFCi92gfI4gtIiAmcXtOJ9hcZoEWJok5c5cygySEBYIkFnR0gdksAqoSTU9XsYHYvAI2 EgverWKBWCcvcb53HdhqTqD4s4XfWCBqBCV+TL4HZjMD1Ry88pwFZIGEwB42iRlfrrJBNLtI tO7uYIWwpSWerdrICGFXS+za3s0M0dDBKNFyYTszRMJa4vDxi6wQU/kkOg7/BdrMARTnleho E4IwPSRaHshCfNzPKLG57xTjBEapWUhumoXkpgWMTKsYxVILinPTU4uNCoz0ihNzi0vz0vWS 83M3MYJjXMttB+OScz6HGAU4GJV4eFccTYoRYk0sK67MPcQowcGsJMKbxpwcI8SbklhZlVqU H19UmpNafIhRmoNFSZz3ofTcaCGB9MSS1OzU1ILUIpgsEwenVAPjoa8njmhmcmxk0Uu7ZaGf Y/Xzx6K/U343rFpzz740wWyWwOrrracaNU8v3JIyMbzSZffnHy+9khvzrQ8zSGh0+K3uP6mk fSVA6onjnbK7M+aa58bMmqESVuOmKLmje76UfCXzmsOZr6ZNTVpx1PfDQVZR8Uka3M0G71qO PdJfIe4uIqg3SU5GiaU4I9FQi7moOBEAyd50De0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQd0XXMkxBlNWclhcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgy3l5WKFgjVHHydmgD42b+LkZODgkB E4l9j36ydzFycQgJrGOUWHqnhQ3C+cUosePhKSaQKjYBQ4neo32MILaIgJjE7TmdzCBFzAJN TBK7bl9kB0kICwRILH67kw3EZhFQlWh6ugrM5hWwkVjwbhULxDp5ifO968DqOYHizxZ+A4pz AG2zlriyyRaiXFDix+R7YOXMQOUHrzxnmcDINwtJahaS1AJGplWMkqkFxbnpucVGBUZ5qeV6 xYm5xaV56XrJ+bmbGIEBvO2wVv8OxsdL4g8xCnAwKvHwrjiaFCPEmlhWXJl7iFGCg1lJhDeN OTlGiDclsbIqtSg/vqg0J7X4EKM0B4uSOC9//rFIIYH0xJLU7NTUgtQimCwTB6dUA6Ptt62c MfFx94OO94b1zLpeoSb0g21PyE3vw+0/QtemNLGE5b/6tiv1T26/yZ0lz5e2ly4TqSo+aa6n XnQ0lI17Wn3AU96w2YGpBrtcF7bnqqffYmGrmbVKtimL9ZG4Nt/U/QIr+p5rOiR28Wj/nKms drZ6V8qp12aHpiqs7rZZnbXRkf1XjhJLcUaioRZzUXEiACsm1hhcAgAA X-CMS-MailID: 20190212180528epcas2p1a534f0f69932c28608b0a139ddfd3596 CMS-TYPE: 102P X-CMS-RootMailID: 20190212180528epcas2p1a534f0f69932c28608b0a139ddfd3596 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 14/21] ASoC: samsung: Drop DAI DMA data chan_name assignments 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP There is now no need to pass DMA channel names through the DAI DMA data, custom DMA config of the PCM is now used for this purpose. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 4 ---- sound/soc/samsung/s3c2412-i2s.c | 2 -- sound/soc/samsung/s3c24xx-i2s.c | 2 -- 3 files changed, 8 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 72282d08d2c1..f438558c4d21 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1450,8 +1450,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) } pri_dai->dma_playback.addr = regs_base + I2STXD; pri_dai->dma_capture.addr = regs_base + I2SRXD; - pri_dai->dma_playback.chan_name = "tx"; - pri_dai->dma_capture.chan_name = "rx"; pri_dai->dma_playback.addr_width = 4; pri_dai->dma_capture.addr_width = 4; pri_dai->priv = priv; @@ -1466,9 +1464,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (quirks & QUIRK_SEC_DAI) { sec_dai = &priv->dai[SAMSUNG_I2S_ID_SECONDARY - 1]; - sec_dai->dma_playback.addr = regs_base + I2STXDS; - sec_dai->dma_playback.chan_name = "tx-sec"; if (!np) { sec_dai->dma_playback.filter_data = i2s_pdata->dma_play_sec; diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index c08638b0e458..a00e35147e50 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -35,12 +35,10 @@ #include static struct snd_dmaengine_dai_dma_data s3c2412_i2s_pcm_stereo_out = { - .chan_name = "tx", .addr_width = 4, }; static struct snd_dmaengine_dai_dma_data s3c2412_i2s_pcm_stereo_in = { - .chan_name = "rx", .addr_width = 4, }; diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index a8026b640c95..600b3b4cdb5b 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -31,12 +31,10 @@ #include "s3c24xx-i2s.h" static struct snd_dmaengine_dai_dma_data s3c24xx_i2s_pcm_stereo_out = { - .chan_name = "tx", .addr_width = 2, }; static struct snd_dmaengine_dai_dma_data s3c24xx_i2s_pcm_stereo_in = { - .chan_name = "rx", .addr_width = 2, }; From patchwork Tue Feb 12 18:03:36 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: 10808595 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 48394184E for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3794F2C2C8 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 233F52C2E5; Tue, 12 Feb 2019 19:01:28 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA6E72C453 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A49822679A8; Tue, 12 Feb 2019 19:05:51 +0100 (CET) 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 A8F712679D1; Tue, 12 Feb 2019 19:05:48 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 0924F2673E2 for ; Tue, 12 Feb 2019 19:05:35 +0100 (CET) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180533epoutp01128dcf8e8af8577af71a92a39db7d84a~Cr-_J2i3G1898118981epoutp01s; Tue, 12 Feb 2019 18:05:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180533epoutp01128dcf8e8af8577af71a92a39db7d84a~Cr-_J2i3G1898118981epoutp01s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994733; bh=DCp4oOvDn8DBezFZRqPxhE/nL/MNMFGTgv5tjZCBKCE=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=T4iCwCBrDnYthmSjWZermauXwJDfb2fXdtcWc4aXi5yRnHwUErrsC/ilct47Lwo1W Ea/0bmVhlH5lWJX3YGvzCtfOUiR0RKT4kKbywQEuoo5nTa1b2WRZTDMhLOKfMlpjQT 3ntoIWYbgk8wM+midIUNn/OGDYqO5ZHaETZwBJAM= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180533epcas1p499418d6c8da90a6bff9b6b2d5c489fb7~Cr-9jKEdI0414104141epcas1p4S; Tue, 12 Feb 2019 18:05:33 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 84.8E.04206.DEA036C5; Wed, 13 Feb 2019 03:05:33 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180532epcas1p1d0c276b25c26205a6493cbabfccd74ef~Cr-8dKT_b0083100831epcas1p1Y; Tue, 12 Feb 2019 18:05:32 +0000 (GMT) X-AuditID: b6c32a39-d65ff7000000106e-31-5c630aeda1cb Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 95.11.04015.BEA036C5; Wed, 13 Feb 2019 03:05:31 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:31 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:36 +0100 Message-id: <20190212180342.32040-16-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7bCmvu5bruQYg9v/OCyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZLcvusRc8k66YP+UVewPjVPEuRg4O CQETiV2PiroYuTiEBHYwSlxrusYE4XxnlNjd+Iy5i5ETrGhbdyc7RGIDo8SuxfOZIZxfjBIN azezg1SxCRhK9B7tYwSxRQTEJG7P6QQrYhZoYZKYM3cp2ChhgSyJlsXnmEF2swioSrxeaAsS 5hWwkfj3r5sNYpu8xPnedWAzOYHizxZ+Y4GoEZT4MfkemM0MVHPwynMWkPkSAgfYJJY872KH +MdF4vQmRwhTWuLSUVuIkdUSu7Z3M0OUdzBKtFzYDvWZtcTh4xdZIWbySbz72sMK0csr0dEm BFHiIdG5ehsbxL/9jBLTdm1insAoNQvJSbOQnLSAkWkVo1hqQXFuemqxYYGpXnFibnFpXrpe cn7uJkZwhGtZ7mA8ds7nEKMAB6MSD++Ko0kxQqyJZcWVuYcYJTiYlUR405iTY4R4UxIrq1KL 8uOLSnNSiw8xSnOwKInzrndwjhESSE8sSc1OTS1ILYLJMnFwSjUwiuhdvnqsK/Xk+RMLfu6t lL3ByhWt+1yHne+k0jnvLJM3EUvi2idwRdjZSOs3v1RlXVywXrjJj2d2c72/3+PzNzyNFOep 5LCt6lp29uy+tza6UQ8OzbIxUd8X250k1DVnb71fWvLOr1Kqh1qvBd3Y5ptZUhguFvP1wcuM 5rjlTj+rbpwNavquxFKckWioxVxUnAgAvpCeeewCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd3XXMkxBrceWVpcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyWpbdYy94Jl0xf8or9gbGqeJdjJwc EgImEtu6O9m7GLk4hATWMUqcf3AJyvnFKHHm5V9WkCo2AUOJ3qN9jCC2iICYxO05ncwgRcwC TUwSu25fZAdJCAtkSbQsPgeU4OBgEVCVeL3QFiTMK2Aj8e9fNxvENnmJ873rwMo5geLPFn5j ASkXErCWuLIJqlxQ4sfkeywgNjNQ+cErz1kmMPLNQpKahSS1gJFpFaNkakFxbnpusVGBYV5q uV5xYm5xaV66XnJ+7iZGYAhvO6zVt4Px/pL4Q4wCHIxKPLwrjibFCLEmlhVX5h5ilOBgVhLh TWNOjhHiTUmsrEotyo8vKs1JLT7EKM3BoiTOezvvWKSQQHpiSWp2ampBahFMlomDU6qB0Z// 5mtJn0v3+xmvqXE7eJXr/fhsuC3R4dexT8YaF+pm8xkcjY9L3LE+7GvGcwFOi8lJnfJvpU6o TFl4adtiEa8s/9mvm5k//F5z4LX+A5Gd+8V40loUlzh4+Le6KMw+rHYuPrnXVzPD68SFUMZb d//HNbHZn3/9dNcBqaSAWWptX/5lM39/ocRSnJFoqMVcVJwIAFZ9zp9dAgAA X-CMS-MailID: 20190212180532epcas1p1d0c276b25c26205a6493cbabfccd74ef CMS-TYPE: 101P X-CMS-RootMailID: 20190212180532epcas1p1d0c276b25c26205a6493cbabfccd74ef References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 15/21] ASoC: dmaengine: Remove unused SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP There is now no users of this flag so remove it together with related data structure field. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- include/sound/dmaengine_pcm.h | 6 ------ sound/soc/soc-generic-dmaengine-pcm.c | 21 ++++----------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 2c4cfaa135a6..764c787928a4 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -63,7 +63,6 @@ struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream) * @slave_id: Slave requester id for the DMA channel. * @filter_data: Custom DMA channel filter data, this will usually be used when * requesting the DMA channel. - * @chan_name: Custom channel name to use when requesting DMA channel. * @fifo_size: FIFO size of the DAI controller in bytes * @flags: PCM_DAI flags, only SND_DMAENGINE_PCM_DAI_FLAG_PACK for now */ @@ -73,7 +72,6 @@ struct snd_dmaengine_dai_dma_data { u32 maxburst; unsigned int slave_id; void *filter_data; - const char *chan_name; unsigned int fifo_size; unsigned int flags; }; @@ -99,10 +97,6 @@ void snd_dmaengine_pcm_set_config_from_dai_data( * playback. */ #define SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX BIT(3) -/* - * The PCM streams have custom channel names specified. - */ -#define SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME BIT(4) /** * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 1b44e363c50c..f1ab6285a085 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -265,7 +265,6 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) struct dmaengine_pcm *pcm = soc_component_to_pcm(component); const struct snd_dmaengine_pcm_config *config = pcm->config; struct device *dev = component->dev; - struct snd_dmaengine_dai_dma_data *dma_data; struct snd_pcm_substream *substream; size_t prealloc_buffer_size; size_t max_buffer_size; @@ -285,19 +284,9 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!substream) continue; - dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - - if (!pcm->chan[i] && - ((pcm->flags & SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME) || - (config && config->chan_names[i]))) { - const char *chan_name = dma_data->chan_name; - - if (config && config->chan_names[i]) - chan_name = config->chan_names[i]; - + if (!pcm->chan[i] && config && config->chan_names[i]) pcm->chan[i] = dma_request_slave_channel(dev, - chan_name); - } + config->chan_names[i]); if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) { pcm->chan[i] = dmaengine_pcm_compat_request_channel(rtd, @@ -420,10 +409,8 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm, const char *name; struct dma_chan *chan; - if ((pcm->flags & (SND_DMAENGINE_PCM_FLAG_NO_DT | - SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME)) || - (!dev->of_node && !(config && config->dma_dev && - config->dma_dev->of_node))) + if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || (!dev->of_node && + !(config && config->dma_dev && config->dma_dev->of_node))) return 0; if (config && config->dma_dev) { From patchwork Tue Feb 12 18:03:37 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: 10808573 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 40C07184E for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DE0B2C2C4 for ; Tue, 12 Feb 2019 19:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21A662C33B; Tue, 12 Feb 2019 19:01:26 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B3802C33B for ; Tue, 12 Feb 2019 19:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 609FE2679EF; Tue, 12 Feb 2019 19:05:55 +0100 (CET) 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 728312679A8; Tue, 12 Feb 2019 19:05:51 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id 4982E2679C5 for ; Tue, 12 Feb 2019 19:05:39 +0100 (CET) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190212180537epoutp0270aef4850bdaeb1cce9fc0fef463719f~CsABWLz3f2787127871epoutp02-; Tue, 12 Feb 2019 18:05:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190212180537epoutp0270aef4850bdaeb1cce9fc0fef463719f~CsABWLz3f2787127871epoutp02- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994737; bh=blD4+7SyDmxtJMKEV1R1vNYt2wsMfDaSTYSU/TfWmdk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=dYVzpPmlnBjO6vYSWBhPeEuFmI0bN8mwHReChieDonTLYezo4VK1BKyibl1QEvtyQ tX9DqTIu3ZUsCtQx86CQgroYVg46nLQDBA1xl2coXX5IXMbiPcBvHqAEIjeDm7uUHE n8I5JrOaz5b+gqcClrLaheegsnbZ/IFCaGJ2rQCM= Received: from epsmges2p4.samsung.com (unknown [182.195.42.72]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20190212180536epcas2p34d5dfe439312cc1bc5924ddad3ab30cc~CsAAUNf6w2872928729epcas2p3k; Tue, 12 Feb 2019 18:05:36 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 70.2D.04093.0FA036C5; Wed, 13 Feb 2019 03:05:36 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20190212180535epcas2p3aaa1c3d8fd9fcfb5a30bc6d132aba70a~Cr--zvoAS1117711177epcas2p3N; Tue, 12 Feb 2019 18:05:35 +0000 (GMT) X-AuditID: b6c32a48-18bff70000000ffd-0d-5c630af057d5 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id EB.30.03689.FEA036C5; Wed, 13 Feb 2019 03:05:35 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:35 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:37 +0100 Message-id: <20190212180342.32040-17-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmhe4HruQYg7O3WS2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZhw6sYilYy1Wxe+pk1gbGDRxdjBwc EgImEhcehHYxcnEICexglOjf38gO4XxnlPh+uJ+li5ETrKh353yoxAZGiVMXz7NBOL8YJXq3 3GMCqWITMJToPdrHCGKLCIhJ3J7TyQxSxCzQwiQxZ+5SZpCEsECExP5v98EaWARUJfavn8cI cgevgI1E7/lyiG3yEud717GD2JxA4WcLv4FdwSsgKPFj8j0wmxmo5uCV5ywg8yUEjrBJdM9r YoRodpF407AL6mxpiWerNkLFqyV2be9mhmjoYJRoubCdGSJhLXH4+EVWiKl8Eh2H/7JDAoZX oqNNCKLEQ6Lj0QJGiI/7GSUOr25mnsAoNQvJUbOQHLWAkWkVo1hqQXFuemqxUYGJXnFibnFp Xrpecn7uJkZwlGt57GA8cM7nEKMAB6MSD++Ko0kxQqyJZcWVuYcYJTiYlUR405iTY4R4UxIr q1KL8uOLSnNSiw8xSnOwKInzPpSeGy0kkJ5YkpqdmlqQWgSTZeLglGpgdK2YwnghnSuv+XP9 vBw9Q0OFOjOdm5PW/qw/4nRe8HO22pSpEZUH1gs8O7ZCbOm3dhvrG/zbrZ0u5J36bCZ55W67 weNTlfmyd+u6js2b1np43fO+W0sXvqoWstXWm8P/QlB48X+upZtcPh1bwTBdjL9Gi4Gz60ug 4oQtc1eUGEenzLC4P2vzWSWW4oxEQy3mouJEAApUFTnuAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd33XMkxBr2f5SyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZhw6sYilYy1Wxe+pk1gbGDRxdjJwc EgImEr0757N3MXJxCAmsY5Q49vQ/E4Tzi1Hi57q77CBVbAKGEr1H+xhBbBEBMYnbczqZQYqY BZqYJHbdvghWJCwQIXFj0i8mEJtFQFVi//p5QA0cHLwCNhK958shtslLnO9dB1bOCRR+tvAb C0iJkIC1xJVNtiBhXgFBiR+T77GA2MxA5QevPGeZwMg3C0lqFpLUAkamVYySqQXFuem5xUYF Rnmp5XrFibnFpXnpesn5uZsYgSG87bBW/w7Gx0viDzEKcDAq8fCuOJoUI8SaWFZcmXuIUYKD WUmEN405OUaINyWxsiq1KD++qDQntfgQozQHi5I4L3/+sUghgfTEktTs1NSC1CKYLBMHp1QD 4zIhnfjUz6prXxwxdbgQ8KGdd23FxEd/y17vFyqQnbBPN7QxxasxLe1jjMmz25YpV30/R9d0 3l2jeEa4ZuHMrx/vBxec3d/wdmq/Wmv0ReM/pSUOe1Z7Me1kcv19UEipUq7Q6sJCh3s7X716 07465KSonSj/eVsRLa37e+IdIpcJnP0SfntighJLcUaioRZzUXEiAKhXLIVdAgAA X-CMS-MailID: 20190212180535epcas2p3aaa1c3d8fd9fcfb5a30bc6d132aba70a CMS-TYPE: 102P X-CMS-RootMailID: 20190212180535epcas2p3aaa1c3d8fd9fcfb5a30bc6d132aba70a References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 16/21] ASoC: samsung: i2s: Simplify pri_dai, sec_dai pointers usage 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP If the probe call is on the primary DAI we can use 'other' in place of i2s->sec_dai, if the probe call is on the secondary DAI we can use 'i2s' in place of other->sec_dai. While at it fix one whitespace issue. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index f438558c4d21..097c641fc1b9 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1057,18 +1057,17 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) pm_runtime_get_sync(dai->dev); if (is_secondary(i2s)) { /* If this is probe on the secondary DAI */ - snd_soc_dai_init_dma_data(dai, &other->sec_dai->dma_playback, - NULL); + snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, NULL); } else { snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, - &i2s->dma_capture); + &i2s->dma_capture); if (priv->quirks & QUIRK_NEED_RSTCLR) writel(CON_RSTCLR, priv->addr + I2SCON); if (priv->quirks & QUIRK_SUPPORTS_IDMA) idma_reg_addr_init(priv->addr, - i2s->sec_dai->idma_playback.addr); + other->idma_playback.addr); } /* Reset any constraint on RFS and BFS */ From patchwork Tue Feb 12 18:03:38 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: 10808593 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 36712746 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 255F32C2C4 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 197A92C2C8; Tue, 12 Feb 2019 19:01:28 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94F732C3A2 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D525B26795C; Tue, 12 Feb 2019 19:05:59 +0100 (CET) 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 ACB7026795C; Tue, 12 Feb 2019 19:05:57 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by alsa0.perex.cz (Postfix) with ESMTP id BE3C22679A0 for ; Tue, 12 Feb 2019 19:05:41 +0100 (CET) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190212180540epoutp034138fdb2381712981006bfd643618f6f~CsAETtIic0209002090epoutp03p; Tue, 12 Feb 2019 18:05:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190212180540epoutp034138fdb2381712981006bfd643618f6f~CsAETtIic0209002090epoutp03p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994740; bh=Nd6iMSvoNPPtuCu3yqq70f1b8IyocyyRrKhnyfhM8vU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=FLZPMbET15idMcOxDZmCnRRRpyoFRsnaEKC9K03GV8DfxPS1L5oFNO+vJCO69w7ZB 9xNi8x+EvFkg7lhzDjRkUNQEgNZVS/tjr/yKFMnBi0vs7nJU65dK54XldCxzit+Ak0 kiba1UC2MIurZ5VMy9VCHcWfPp8BOP6LtqhFztJY= Received: from epsmges1p2.samsung.com (unknown [182.195.42.54]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180539epcas1p1cd2a023ab501c5c35bbf3522caad9a1f~CsADVo3YQ0083100831epcas1p1g; Tue, 12 Feb 2019 18:05:39 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 17.FC.04173.3FA036C5; Wed, 13 Feb 2019 03:05:39 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190212180539epcas1p457a5c91f2c2cef0d1b92ff8bf804beee~CsADEU6dY1662916629epcas1p4J; Tue, 12 Feb 2019 18:05:39 +0000 (GMT) X-AuditID: b6c32a36-5c1ff7000000104d-6a-5c630af36b98 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 46.11.04015.2FA036C5; Wed, 13 Feb 2019 03:05:39 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:38 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:38 +0100 Message-id: <20190212180342.32040-18-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7bCmge5nruQYg1c/hS2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZ+5Z8ZSvYxl7R3HOMpYFxKVsXIyeH hICJxMxbJ5m6GLk4hAR2MErMPLiVEcL5ziixeNcOuKoLTVOhqjYwSsz71cYM4fxilPg89QQ7 SBWbgKFE79E+RhBbREBM4vacTrAiZoEWJok5c5cygySEBRIlbizfD9bAIqAq8XLWSVYQm1fA RmJL9y12iHXyEud714HZnEDxZwu/sUDUCEr8mHwPzGYGqjl45TkLyAIJgQNsEjPXLgJyOIAc F4nT+y0gTGmJS0dtIUZWS+za3s0MUd7BKNFyYTszRMJa4vDxi6wQM/kk3n3tYYXo5ZXoaBOC KPGQ6HjUCHaOkEA/o8SWf94TGKVmIbloFpKLFjAyrWIUSy0ozk1PLTYsMNIrTswtLs1L10vO z93ECI5xLbMdjIvO+RxiFOBgVOLhXXE0KUaINbGsuDL3EKMEB7OSCG8ac3KMEG9KYmVValF+ fFFpTmrxIUZpDhYlcd71Ds4xQgLpiSWp2ampBalFMFkmDk6pBsYuxc7qS3Yxs0VWRYVLbXiV lPPl+uT3yyp9GG1eSgWwL/OpXLdscbrNL6bu/z4/PR7KlScdLe8+ov9oEo9q4L+ZK3gZa0ul fh+caHdY+6faycXa/NdfH25t2aYmb8P5d9bzyOvcy3MUlh68YOnx75Pt1+ioow0bNDYJ1LI5 bc1e/sHUJXNyxH4lluKMREMt5qLiRADM6B5H7QIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd3PXMkxBnvaWCyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZ+5Z8ZSvYxl7R3HOMpYFxKVsXIyeH hICJxIWmqUxdjFwcQgLrGCVWTrjPCOH8YpSY+PwoWBWbgKFE79E+RhBbREBM4vacTmaQImaB JiaJXbcvsoMkhAUSJW4s3w9mswioSrycdZIVxOYVsJHY0n2LHWKdvMT53nVgNidQ/NnCbyxd jBxA26wlrmyyhSgXlPgx+R4LiM0MVH7wynOWCYx8s5CkZiFJLWBkWsUomVpQnJueW2xUYJiX Wq5XnJhbXJqXrpecn7uJERjE2w5r9e1gvL8k/hCjAAejEg/viqNJMUKsiWXFlbmHGCU4mJVE eNOYk2OEeFMSK6tSi/Lji0pzUosPMUpzsCiJ897OOxYpJJCeWJKanZpakFoEk2Xi4JRqYORg yalLVfu5erf7gdIl/1efqn5efvvoPV+/MsWirA3MV3f9+HF+xzrTiG/rJY69eH7mtXyqI3dR nfa6GxEC6eF+6796bor03GfH7e836+KXvcaTA+pPH50XkSThGbR7j1+OS229gsBqHhP73Hr5 KcFBvts3eQflKyaKL/6TomB6NkV1w+IObiWW4oxEQy3mouJEAHBtDqleAgAA X-CMS-MailID: 20190212180539epcas1p457a5c91f2c2cef0d1b92ff8bf804beee CMS-TYPE: 101P X-CMS-RootMailID: 20190212180539epcas1p457a5c91f2c2cef0d1b92ff8bf804beee References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 17/21] ASoC: samsung: i2s: Change indentation in SAMSUNG_I2S_FMTS definition 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Change indentation so this macro definition spans 2 rows and looks more consistent with surrounding code. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 097c641fc1b9..debeaf51cc7e 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1150,9 +1150,8 @@ static const struct snd_soc_component_driver samsung_i2s_component = { .num_dapm_routes = ARRAY_SIZE(samsung_i2s_dapm_routes), }; -#define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ - SNDRV_PCM_FMTBIT_S16_LE | \ - SNDRV_PCM_FMTBIT_S24_LE) +#define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE) static int i2s_alloc_dais(struct samsung_i2s_priv *priv, const struct samsung_i2s_dai_data *i2s_dai_data, From patchwork Tue Feb 12 18:03:39 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: 10808583 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 41198746 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B6492C3F2 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D10E2C4B5; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97CBF2C40C for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3718E2679CE; Tue, 12 Feb 2019 19:06:02 +0100 (CET) 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 3C79D267A2C; Tue, 12 Feb 2019 19:06:00 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 4E7DF267990 for ; Tue, 12 Feb 2019 19:05:46 +0100 (CET) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180544epoutp019ad8330ce180371153fcf1a637dbc190~CsAId1uOF1898018980epoutp01y; Tue, 12 Feb 2019 18:05:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180544epoutp019ad8330ce180371153fcf1a637dbc190~CsAId1uOF1898018980epoutp01y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994744; bh=HH2nWa9zF7xBDvnaV/eJcaBCQ+zJRPbcbb67+0bhunw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=nUW6b/T9BIEim556N/+4OxAcVYZNqgeZPOu0dv2fhbrFqoA8yz9CPu4Kv+dbuhLL5 RNuHLoEGVBFFhS6yRRuKMoQJqA5urGSAZcYJTsOt7VkwIZAAaP+eWJie5qhQmL8la3 kc3mgjNlk55GqK5VyHDUu03uy5z93sbXE8d8ceRg= Received: from epsmges2p1.samsung.com (unknown [182.195.42.69]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180544epcas2p1f014a6a079ec24e7470475bf43219c3d~CsAHrToJd2517625176epcas2p1J; Tue, 12 Feb 2019 18:05:44 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id AE.A1.04138.7FA036C5; Wed, 13 Feb 2019 03:05:43 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20190212180542epcas2p2f7252babc9b4dc97eaaa214658afe5d0~CsAGbsxBF0732907329epcas2p2B; Tue, 12 Feb 2019 18:05:42 +0000 (GMT) X-AuditID: b6c32a45-5f3ff7000000102a-16-5c630af76665 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.30.03689.6FA036C5; Wed, 13 Feb 2019 03:05:42 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:42 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:39 +0100 Message-id: <20190212180342.32040-19-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7bCmue53ruQYg6vnLSyuXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZy27/YSn4JFtx6NdfpgbGa+JdjJwc EgImEr03NrF3MXJxCAnsYJRYsfY6lPOdUeJn+0JWmKorvz4zQSQ2MEq8WnqBGcL5xShxas4/ JpAqNgFDid6jfYwgtoiAmMTtOZ1gRcwCLUwSc+YuZQZJCAvYS5z5t4QdxGYRUJU4cHAzC4jN K2AjMXPnHBaIdfIS53vXgdVwAsWfLfwGVSMo8WPyPTCbGajm4JXnLCALJAQOsElc39jNBtHs InFmxjOou6Ulnq3ayAhhV0vs2t7NDNHQwSjRcmE7M0TCWuLw8YusEFP5JDoO/wXazAEU55Xo aBOCKPGQmPP0ONT//UC9C1qYJzBKzUJy1CwkRy1gZFrFKJZaUJybnlpsVGCoV5yYW1yal66X nJ+7iREc6VquOxhnnPM5xCjAwajEw7viaFKMEGtiWXFl7iFGCQ5mJRHeNObkGCHelMTKqtSi /Pii0pzU4kOM0hwsSuK8j6TnRgsJpCeWpGanphakFsFkmTg4pRoYc+6c6vu66995uYZNF6/9 V51c1BRw21I0X0H2+rbV3ZJPbMzcf/fpHD796oP8mhunfKR1dON3ZR3eZZDVcZ3h0PnHTNwJ N069+3/t1YR/LttXVbm56p1UWFTJsfL2D+t/V6Qtk54/PcB2yNGlo4fNNrlIdfGu0j05xdK+ Pos5557zW/f/YS3/YSWW4oxEQy3mouJEAPYC50vwAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd1vXMkxBv9fqVlcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgylt3+w1LwSbbi0K+/TA2M18S7GDk5 JARMJK78+szUxcjFISSwjlHids8iNgjnF6PEvFWb2ECq2AQMJXqP9jGC2CICYhK353QygxQx CzQxSey6fZEdJCEsYC9x5t8SMJtFQFXiwMHNLCA2r4CNxMydc1gg1slLnO9dB1bDCRR/tvAb UJwDaJu1xJVNthDlghI/Jt8DK2cGKj945TnLBEa+WUhSs5CkFjAyrWKUTC0ozk3PLTYqMMpL LdcrTswtLs1L10vOz93ECAzibYe1+ncwPl4Sf4hRgINRiYd3xdGkGCHWxLLiytxDjBIczEoi vGnMyTFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEefnzj0UKCaQnlqRmp6YWpBbBZJk4OKUaGBM8 zZY9eyR8KOQHb6JF71FF7mdcAitMZP4f232WeS7D29JfmpadXAf23xPbMiMpYIurcMGrg794 DnP6b87bcTPgfKz2T482XV6XdfsSGta8Srt4clujXvh53XQpQ/8wnncKK90kbtm/O/O2LS35 yV1l42jesJ8ny0V9WVsvm09ofbarTCFjuhJLcUaioRZzUXEiAASLUuReAgAA X-CMS-MailID: 20190212180542epcas2p2f7252babc9b4dc97eaaa214658afe5d0 CMS-TYPE: 102P X-CMS-RootMailID: 20190212180542epcas2p2f7252babc9b4dc97eaaa214658afe5d0 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 18/21] ASoC: samsung: i2s: Comments clean up 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Spelling error fixes, upper/lower case letter changes. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index debeaf51cc7e..77c0f70beab1 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1,5 +1,4 @@ -/* sound/soc/samsung/i2s.c - * +/* * ALSA SoC Audio Layer - Samsung I2S Controller driver * * Copyright (c) 2010 Samsung Electronics Co. Ltd. @@ -61,10 +60,10 @@ struct i2s_dai { /* Platform device for this DAI */ struct platform_device *pdev; - /* Frame Clock */ + /* Frame clock */ unsigned frmclk; /* - * Specifically requested RCLK,BCLK by MACHINE Driver. + * Specifically requested RCLK, BCLK by machine driver. * 0 indicates CPU driver is free to choose any value. */ unsigned rfs, bfs; @@ -72,8 +71,9 @@ struct i2s_dai { struct i2s_dai *pri_dai; /* Pointer to the Secondary_Fifo if it has one, NULL otherwise */ struct i2s_dai *sec_dai; -#define DAI_OPENED (1 << 0) /* Dai is opened */ -#define DAI_MANAGER (1 << 1) /* Dai is the manager */ + +#define DAI_OPENED (1 << 0) /* DAI is opened */ +#define DAI_MANAGER (1 << 1) /* DAI is the manager */ unsigned mode; /* Driver for this DAI */ @@ -98,7 +98,7 @@ struct samsung_i2s_priv { /* Spinlock protecting access to the device's registers */ spinlock_t lock; - /* Lock for cross i/f checks */ + /* Lock for cross interface checks */ spinlock_t pcm_lock; /* CPU DAIs and their corresponding drivers */ @@ -309,7 +309,7 @@ static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs) writel(mod, priv->addr + I2SMOD); } -/* Read Bit-Clock of I2S (in multiples of LRCLK) */ +/* Read bit-clock of I2S (in multiples of LRCLK) */ static inline unsigned get_bfs(struct i2s_dai *i2s) { struct samsung_i2s_priv *priv = i2s->priv; @@ -331,7 +331,7 @@ static inline unsigned get_bfs(struct i2s_dai *i2s) } } -/* Write Bit-Clock of I2S (in multiples of LRCLK) */ +/* Write bit-clock of I2S (in multiples of LRCLK) */ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) { struct samsung_i2s_priv *priv = i2s->priv; @@ -383,7 +383,7 @@ static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs) writel(mod, priv->addr + I2SMOD); } -/* Sample-Size */ +/* Sample size */ static inline int get_blc(struct i2s_dai *i2s) { int blc = readl(i2s->priv->addr + I2SMOD); @@ -397,7 +397,7 @@ static inline int get_blc(struct i2s_dai *i2s) } } -/* TX Channel Control */ +/* TX channel control */ static void i2s_txctrl(struct i2s_dai *i2s, int on) { struct samsung_i2s_priv *priv = i2s->priv; @@ -742,7 +742,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, switch (params_channels(params)) { case 6: val |= MOD_DC2_EN; - /* fall through */ + /* Fall through */ case 4: val |= MOD_DC1_EN; break; @@ -821,7 +821,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, return 0; } -/* We set constraints on the substream acc to the version of I2S */ +/* We set constraints on the substream according to the version of I2S */ static int i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { @@ -1056,7 +1056,8 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) pm_runtime_get_sync(dai->dev); - if (is_secondary(i2s)) { /* If this is probe on the secondary DAI */ + if (is_secondary(i2s)) { + /* If this is probe on the secondary DAI */ snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, NULL); } else { snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, From patchwork Tue Feb 12 18:03:40 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: 10808585 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 44BFB13B5 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32F392C48F for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20CC22C2C8; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAC922C2C8 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D964D267A3D; Tue, 12 Feb 2019 19:06:06 +0100 (CET) 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 B4051267A39; Tue, 12 Feb 2019 19:06:02 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id 9A6112679D0 for ; Tue, 12 Feb 2019 19:05:48 +0100 (CET) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180547epoutp0156f9b3a2f62a32407ff6ce068408803b~CsAKt5CeU1587815878epoutp01O; Tue, 12 Feb 2019 18:05:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180547epoutp0156f9b3a2f62a32407ff6ce068408803b~CsAKt5CeU1587815878epoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994747; bh=HCP/HOvIqfJnCB1JzhPJMtblSFmTHvuIraOFg1C02fk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=kLJidmYp8kIdmF6vEgq+iZsFnr9A5lG+c2pTjTeHNDwM7nx67Q70LwltUJzX+5RYO pSyxMD72cLONp5hTWRhGYCCLR795sEGSOwKzTUpGIOKsUphAKGOvfZKGMPh9Lny8U9 bro9vd4EJIFBWcxr7lsFDmCWA/upLwOebac/TVv4= Received: from epsmges1p2.samsung.com (unknown [182.195.42.54]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190212180547epcas1p2a158ec5a5a8c78c15e127eb0083ea944~CsAKar4TQ1314613146epcas1p2r; Tue, 12 Feb 2019 18:05:46 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 29.FC.04173.AFA036C5; Wed, 13 Feb 2019 03:05:46 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180546epcas1p1df261edb23d09dd0b33697f4a279cbd0~CsAJrhzKa0084400844epcas1p1k; Tue, 12 Feb 2019 18:05:46 +0000 (GMT) X-AuditID: b6c32a36-5c1ff7000000104d-7c-5c630afa134c Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F6.11.04015.AFA036C5; Wed, 13 Feb 2019 03:05:46 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:46 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:40 +0100 Message-id: <20190212180342.32040-20-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBIsWRmVeSWpSXmKPExsWy7bCmnu4vruQYg0evrS2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZv3+HFRzmqGhdcZy9gbGTvYuRg0NC wERi247ELkYuDiGBHYwSL3r6mSGc74wSr39dYYYpav8aDxHfwCixddsCNgjnF6PE5CMHGbsY OTnYBAwleo/2gdkiAmISt+d0gk1iFmhhkpgzdykzSEJYIFhi/a6zYFNZBFQlTi5gBwnzCthI vH3+HsyWEJCXON+7DszmBIo/W/iNBaJGUOLH5HtgNjNQzcErz1lA5ksIHGGT2PT1IxNEs4tE y5E1TBBXS0tcOmoLEa6W2LW9mxmivoNRouXCdmaIhLXE4eMXWSGG8km8+9rDCtHLK9HRJgRR 4iHx9vxvaKj0M0o8P/mWcQKj1CwkN81CctMCRqZVjGKpBcW56anFhgVGesWJucWleel6yfm5 mxjB8a1ltoNx0TmfQ4wCHIxKPLwrjibFCLEmlhVX5h5ilOBgVhLhTWNOjhHiTUmsrEotyo8v Ks1JLT7EKM3BoiTOu97BOUZIID2xJDU7NbUgtQgmy8TBKdXAeOTXzKlBvL1xC96LhuzebbpQ qSfo5gT1rXHG2TpOnEvrTZdVPQy/knHcSbNtcWp0Keted5mGvd8nl5bt6jo1z7WLjdf9l2ub n4Hv3d2q/yNEi0zWb9r9OvCoammKx6Iftx5k3Fdqfvss9N6c39ZvfvJe3W265se9NzP+KUv3 RH4vbTm3ZZ/qWiWW4oxEQy3mouJEAAHOmXzrAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBLMWRmVeSWpSXmKPExsVy+t9jQd1fXMkxBg/WcltcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyfv8OKzjMUdG64jh7A2MnexcjB4eE gIlE+9f4LkYuDiGBdYwS++Z1MkI4vxgldrT+Zepi5ORgEzCU6D3axwhiiwiISdye08kMUsQs 0MQksev2RXaQhLBAsMT6XWeZQaayCKhKnFwAFuYVsJF4+/w9mC0hIC9xvncdmM0JFH+28BsL SLmQgLXElU22EOWCEj8m32MBsZmByg9eec4ygZFvFpLULCSpBYxMqxglUwuKc9Nzi40KDPNS y/WKE3OLS/PS9ZLzczcxAsN322Gtvh2M95fEH2IU4GBU4uFdcTQpRog1say4MvcQowQHs5II bxpzcowQb0piZVVqUX58UWlOavEhRmkOFiVx3tt5xyKFBNITS1KzU1MLUotgskwcnFINjIu/ mpwLeX7Yuu29hsPBReX2wl8Nvnct8/165OX1Y+VLin5/CIw/2HB3I8PmP8VxEaoHEyZv9K38 IJuVZX9XuO7Vw8i9jJuXeXN4e3h94GELmdWjk39k7oZtc1mYLr6c0x/un39vZ8qRuIPXMwId +b4Gv/2d1ejzTWoL0+lZd7hvKD/5E/Py8xQlluKMREMt5qLiRACytOegWwIAAA== X-CMS-MailID: 20190212180546epcas1p1df261edb23d09dd0b33697f4a279cbd0 CMS-TYPE: 101P X-CMS-RootMailID: 20190212180546epcas1p1df261edb23d09dd0b33697f4a279cbd0 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 19/21] ASoC: samsung: i2s: Convert to SPDX License Indentifier 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Replace GPL v2.0 license statements with SPDX license identifier. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 77c0f70beab1..e820d95a86be 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1,13 +1,9 @@ -/* - * ALSA SoC Audio Layer - Samsung I2S Controller driver - * - * Copyright (c) 2010 Samsung Electronics Co. Ltd. - * Jaswinder Singh - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ +// SPDX-License-Identifier: GPL-2.0 +// +// ALSA SoC Audio Layer - Samsung I2S Controller driver +// +// Copyright (c) 2010 Samsung Electronics Co. Ltd. +// Jaswinder Singh #include #include From patchwork Tue Feb 12 18:03:41 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: 10808597 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 9B53813B5 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A78D2C2C4 for ; Tue, 12 Feb 2019 19:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E5592C2C8; Tue, 12 Feb 2019 19:01:28 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96A4E2C402 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 31350267A4D; Tue, 12 Feb 2019 19:06:09 +0100 (CET) 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 13AFE267A3D; Tue, 12 Feb 2019 19:06:06 +0100 (CET) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by alsa0.perex.cz (Postfix) with ESMTP id D8FC22679E6 for ; Tue, 12 Feb 2019 19:05:51 +0100 (CET) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190212180550epoutp01ddab7d48f35b37991e003dc1f293df05~CsANrxs0c1898118981epoutp01u; Tue, 12 Feb 2019 18:05:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190212180550epoutp01ddab7d48f35b37991e003dc1f293df05~CsANrxs0c1898118981epoutp01u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994750; bh=J2fEmrpa9P+9AF6G1uzK4HmVkrvrdiclGfzK5O2Xtxk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Rnv6qFrVAlFyMyFiYkcJu7E6nZ35F2JXSEMQFVFa2AciVqY4jwtqiLwn6iNXVwJRi 84t3ByJaFJMysy7fjAgS3DbOYBk4vY7G4ekxe7A/ORzMMF6ifNltJbEUPrYGwjOOMo QM1Ord+n0yCLaUlEvn2jnaztDZL1YwDM6XfLJw+A= Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190212180550epcas1p162903ddb8396924783c2032cb17286f6~CsANbKwlT0083900839epcas1p1t; Tue, 12 Feb 2019 18:05:50 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 30.CF.04074.EFA036C5; Wed, 13 Feb 2019 03:05:50 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190212180549epcas1p20b5cc51ba13fb934056196d1b89d67ab~CsANCKXWQ0631306313epcas1p2U; Tue, 12 Feb 2019 18:05:49 +0000 (GMT) X-AuditID: b6c32a35-27fff70000000fea-e7-5c630afea74f Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id A7.11.04015.DFA036C5; Wed, 13 Feb 2019 03:05:49 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:49 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:41 +0100 Message-id: <20190212180342.32040-21-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmnu4/ruQYg3k97BZXLh5istg4Yz2r xdSHT9gszp/fwG7x7UoHk8XlXXPYLGac38dksfbIXXaLw2/aWS0urvjC5MDlseFzE5vHzll3 2T02repk8+jbsorR4/MmuQDWKC6blNSczLLUIn27BK6MH9O+Mxfs56g48qyLuYHxA1sXIyeH hICJxNl3x4FsLg4hgR2MEqfvH4ZyvjNKtF/+xwJT9aythRUisQEocWgGO4Tzi1GipWcK2Cw2 AUOJ3qN9jCC2iICYxO05ncwgRcwCLUwSc+YuZQZJCAtEShydfgnMZhFQlZgxczWYzStgI7Fy Asw6eYnzvevYQWxOoPizhd9YIGoEJX5MvgdmMwPVHLzyHKr+AJvEubm+ELaLxNzXPUBxDiBb WuLSUVuIcLXEru3dYPdICHQAHX1hOzNEwlri8PGLrBAz+STefe1hhejllehoE4Io8ZDYvfEB M8TD/YwSc259Y5vAKDULyUmzkJy0gJFpFaNYakFxbnpqsWGBoV5xYm5xaV66XnJ+7iZGcJRr me5gnHLO5xCjAAejEg/viqNJMUKsiWXFlbmHGCU4mJVEeNOYk2OEeFMSK6tSi/Lji0pzUosP MUpzsCiJ8653cI4REkhPLEnNTk0tSC2CyTJxcEo1MObfq/UrDFq2bHIIN+us08sCFDeZuks6 r3o3ndPYeirDu9o1/eJrDb03Te7uDJ9txvbi2b91bX+MJuxPOGg6mTH7hYCy6dIJzBd/nrFd 1SvE7hV7ac6Z28svbxK/u1eiN2VCks4q6dVRZao7Lk8TXVjytcP2sm7Nq3N8q66l1d4I8H3M 5+h2UF6JpTgj0VCLuag4EQDtK2Cd7gIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQd2/XMkxBsem6llcuXiIyWLjjPWs FlMfPmGzOH9+A7vFtysdTBaXd81hs5hxfh+Txdojd9ktDr9pZ7W4uOILkwOXx4bPTWweO2fd ZffYtKqTzaNvyypGj8+b5AJYo7hsUlJzMstSi/TtErgyfkz7zlywn6PiyLMu5gbGD2xdjJwc EgImEs/aWli7GLk4hATWMUoc6XzKCOH8YpS4OOs7E0gVm4ChRO/RPkYQW0RATOL2nE5mkCJm gSYmiV23L7KDJIQFIiWOTr/EDGKzCKhKzJi5GszmFbCRWDnhHwvEOnmJ873rwOo5geLPFn4D inMAbbOWuLLJFqJcUOLH5Htg5cxA5QevPGeZwMg3C0lqFpLUAkamVYySqQXFuem5xUYFhnmp 5XrFibnFpXnpesn5uZsYgUG87bBW3w7G+0viDzEKcDAq8fCuOJoUI8SaWFZcmXuIUYKDWUmE N405OUaINyWxsiq1KD++qDQntfgQozQHi5I47+28Y5FCAumJJanZqakFqUUwWSYOTqkGxsij 4bne8iazWNb87aifkbd0d5SzreQkD5fda/8kJ/zM8MpvkvXy+WaaMfc0R/h7nqa06YzT3z8N WurvIvPmYVPWA4Mt0b9OzvXd1btm3UrpVlX9nJJJ77ef1yt+/Ts2baPQim2F05ZtPxV9Wezo r5N3ioVKPAsZ/3Gk68hzTt2Yk5wnXnvzjhJLcUaioRZzUXEiAJ6UDwReAgAA X-CMS-MailID: 20190212180549epcas1p20b5cc51ba13fb934056196d1b89d67ab CMS-TYPE: 101P X-CMS-RootMailID: 20190212180549epcas1p20b5cc51ba13fb934056196d1b89d67ab References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 20/21] ARM: dts: exynos5422-odroidxu3: Add support for secondary DAI 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch extends DAPM routing and adds secondary CPU DAI entry to support the secondary audio PCM interface on Odroid XU3. Signed-off-by: Sylwester Nawrocki --- arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi index e84544b220b9..51a843bd65ed 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi @@ -24,7 +24,9 @@ "Headphone Jack", "MICBIAS", "IN1", "Headphone Jack", "Speakers", "SPKL", - "Speakers", "SPKR"; + "Speakers", "SPKR", + "I2S Playback", "Mixer DAI TX", + "HiFi Playback", "Mixer DAI TX"; assigned-clocks = <&clock CLK_MOUT_EPLL>, <&clock CLK_MOUT_MAU_EPLL>, @@ -51,7 +53,7 @@ <196608000>; cpu { - sound-dai = <&i2s0 0>; + sound-dai = <&i2s0 0>, <&i2s0 1>; }; codec { sound-dai = <&hdmi>, <&max98090>; From patchwork Tue Feb 12 18:03:42 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: 10808579 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 21D7117E0 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 108AB2C3F2 for ; Tue, 12 Feb 2019 19:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04BCD2C48F; Tue, 12 Feb 2019 19:01:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 957252C3F2 for ; Tue, 12 Feb 2019 19:01:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 81B5E2679F4; Tue, 12 Feb 2019 19:06:11 +0100 (CET) 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 ED3DA267A52; Tue, 12 Feb 2019 19:06:09 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id 59DB8267A0E for ; Tue, 12 Feb 2019 19:05:56 +0100 (CET) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190212180554epoutp02a26abdd3b65bcf8d76dfe5aa09ec47a6~CsARot5NF2787127871epoutp02C; Tue, 12 Feb 2019 18:05:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190212180554epoutp02a26abdd3b65bcf8d76dfe5aa09ec47a6~CsARot5NF2787127871epoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549994754; bh=4BtKSXjyFABIOkbv9PZbmRs71Y9FKXhmWxqvv2v/ukY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=XWRgIRhSFizR5aErVwDhtQhpu52/RumtljTJnEbUXWlu5KMfcZ/roeFtb0Zx4vXWO vNuSMuy7rtfuTG3Z+ehS/Fz0sDzUAkWRuqpO+o3udUaT6deCmGMe2K5cDFJCkpWpq7 ljlXNH7Q28Sf00nCaqKE1E3Rl+jpHMh7HQUjQdA8= Received: from epsmges2p3.samsung.com (unknown [182.195.42.71]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180554epcas2p13facab9c192e3e6788ee074a7737dd2f~CsARI73Hn1897218972epcas2p1p; Tue, 12 Feb 2019 18:05:54 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 5A.49.04134.20B036C5; Wed, 13 Feb 2019 03:05:54 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20190212180553epcas2p10fb4f2f465392de8609c127ed3f33ab4~CsAQY2cbs2517825178epcas2p1P; Tue, 12 Feb 2019 18:05:53 +0000 (GMT) X-AuditID: b6c32a47-8abff70000001026-a4-5c630b021f2b Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 8D.30.03689.10B036C5; Wed, 13 Feb 2019 03:05:53 +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 <0PMT0024XRJ2FB10@mmp2.samsung.com>; Wed, 13 Feb 2019 03:05:53 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Date: Tue, 12 Feb 2019 19:03:42 +0100 Message-id: <20190212180342.32040-22-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190212180342.32040-1-s.nawrocki@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7bCmmS4Td3KMwcx3nBZXLh5istg4Yz2r xdSHT9gszp/fwG7x7UoHk8XlXXPYLGac38dksfbIXXaLw2/aWS0urvjC5MDlseFzE5vHzll3 2T02repk8+jbsorR4/MmuQDWKC6blNSczLLUIn27BK6MK0clC86wV+z9/ImxgXEaWxcjJ4eE gIlE7+fbQDYXh5DADkaJqxtPQjnfGSXuT1rHDFM19ec1FojEBkaJplUPGCGcX4wSk7o/MIJU sQkYSvQe7QOzRQTEJG7P6WQGKWIWaGGSmDN3KZDDwSEsECnRss0ApIZFQFViRdMCVhCbV8BG ounmHBaIbfIS53vXsYPYnEDxZwu/sUDUCEr8mHwPzGYGqjl45TnYRRICB9gk3sy4yQYyX0LA RWLfUzeIOdISz1ZtZISwqyV2be9mhqjvYJRoubAd6jVricPHL7JCDOWT6Dj8lx1iDq9ER5sQ hOkhcWxRHsS//YwS26a9Yp7AKDULyUmzkJy0gJFpFaNYakFxbnpqsVGBsV5xYm5xaV66XnJ+ 7iZGcIRrue9g3HbO5xCjAAejEg/viqNJMUKsiWXFlbmHGCU4mJVEeNOYk2OEeFMSK6tSi/Lj i0pzUosPMUpzsCiJ8z6UnhstJJCeWJKanZpakFoEk2Xi4JRqYNT6vscl89euVMH0L0+tnsmW NzRyf97ZkWr18u2DPUn5f0Mnzt5w3cvx1r098VLp2+PmT3uaLXDhxpvJYscZNF59qWR7HPD3 N3fJvwsq2/OOR22dUrHgLLvbf+3bWovclnhmbv+nuz84rSL8qcoTzheKTtEaDQ9/fZjGI3xX Z71Ht3KnWinvWTElluKMREMt5qLiRABFLCEm7AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jQV1G7uQYg60rhC2uXDzEZLFxxnpW i6kPn7BZnD+/gd3i25UOJovLu+awWcw4v4/JYu2Ru+wWh9+0s1pcXPGFyYHLY8PnJjaPnbPu sntsWtXJ5tG3ZRWjx+dNcgGsUVw2Kak5mWWpRfp2CVwZV45KFpxhr9j7+RNjA+M0ti5GTg4J AROJqT+vsXQxcnEICaxjlFh8u5cZwvnFKLF9xx0WkCo2AUOJ3qN9jCC2iICYxO05nWBFzAJN TBK7bl9k72Lk4BAWiJRo2WYAUsMioCqxomkBK4jNK2Aj0XRzDgvENnmJ873r2EFsTqD4s4Xf WEBahQSsJa5ssoUoF5T4MfkeWDkzUPnBK89ZJjDyzUKSmoUktYCRaRWjZGpBcW56brFRgVFe arlecWJucWleul5yfu4mRmAAbzus1b+D8fGS+EOMAhyMSjy8K44mxQixJpYVV+YeYpTgYFYS 4U1jTo4R4k1JrKxKLcqPLyrNSS0+xCjNwaIkzsuffyxSSCA9sSQ1OzW1ILUIJsvEwSnVwNgj 4vhU1seSq2C9wOPJ/u5THU79X6P0xC8xLu24WO/xS3aRzO/udJx5WfP97FW2tM+bA5/P+c5n selKEN8iEQtTtneG/VVHvGYfd1M8w7nbNtQvY7nGBUahS1EFAvP6b6u9j3hQ8UpTW59VJLYg 62zCpXSrPeUexxmaJLdo6ih5n1uQ7uw2V4mlOCPRUIu5qDgRABX47HVcAgAA X-CMS-MailID: 20190212180553epcas2p10fb4f2f465392de8609c127ed3f33ab4 CMS-TYPE: 102P X-CMS-RootMailID: 20190212180553epcas2p10fb4f2f465392de8609c127ed3f33ab4 References: <20190212180342.32040-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, krzk@kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki , m.szyprowski@samsung.com Subject: [alsa-devel] [PATCH v2 21/21] ARM: dts: exynos5422-odroidxu4: Add support for secondary DAI 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch extends DAPM routing and adds secondary CPU DAI entry to support the secondary audio PCM interface on Odroid XU4. Signed-off-by: Sylwester Nawrocki --- arch/arm/boot/dts/exynos5422-odroidxu4.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts index 122174ea9e0a..892d389d6d09 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts @@ -33,6 +33,8 @@ compatible = "samsung,odroid-xu3-audio"; model = "Odroid-XU4"; + samsung,audio-routing = "I2S Playback", "Mixer DAI TX"; + assigned-clocks = <&clock CLK_MOUT_EPLL>, <&clock CLK_MOUT_MAU_EPLL>, <&clock CLK_MOUT_USER_MAU_EPLL>, @@ -58,7 +60,7 @@ <196608000>; cpu { - sound-dai = <&i2s0 0>; + sound-dai = <&i2s0 0>, <&i2s0 1>; }; codec {