From patchwork Mon Apr 24 06:42:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 98021 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1348082qgf; Sun, 23 Apr 2017 23:42:38 -0700 (PDT) X-Received: by 10.99.97.75 with SMTP id v72mr22838520pgb.76.1493016157939; Sun, 23 Apr 2017 23:42:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si17792965pfb.23.2017.04.23.23.42.37; Sun, 23 Apr 2017 23:42:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165559AbdDXGmg (ORCPT + 4 others); Mon, 24 Apr 2017 02:42:36 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49629 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165573AbdDXGmf (ORCPT ); Mon, 24 Apr 2017 02:42:35 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW008HZIMTWQ20@mailout1.w1.samsung.com>; Mon, 24 Apr 2017 07:42:30 +0100 (BST) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170424064229eucas1p10d9ae24be531cf9d321b4b060edfd5aa~4QkcTXfYL2008820088eucas1p1S; Mon, 24 Apr 2017 06:42:29 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 4D.5F.25577.55E9DF85; Mon, 24 Apr 2017 07:42:29 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170424064228eucas1p2543d7f206ac18476891e500991611733~4QkbqNsx72653226532eucas1p2I; Mon, 24 Apr 2017 06:42:28 +0000 (GMT) X-AuditID: cbfec7f5-f792f6d0000063e9-d2-58fd9e55b719 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 98.5A.17452.9DE9DF85; Mon, 24 Apr 2017 07:44:41 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00957IMPRV80@eusync3.samsung.com>; Mon, 24 Apr 2017 07:42:28 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 1/6] clk: samsung: Remove dead code Date: Mon, 24 Apr 2017 08:42:18 +0200 Message-id: <1493016143-21569-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIIsWRmVeSWpSXmKPExsWy7djP87qh8/5GGPTe4rPYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbnHxlKvF4TftrBY/znSzOHB6vL/Ryu5xua+XyWPTqk42 j74tqxg9Pm+SC2CN4rJJSc3JLEst0rdL4MpoP7OGteAqa8Xezg+sDYyPWboYOTkkBEwkdq+5 wAhhi0lcuLeeDcQWEljKKDH9EGsXIxeQ/ZlRomvlT2aYhu5nkxghEsuAEt13oJwGJol/nQvB 2tkEDCW63naB2SICDhKfP70GK2IW2MkkMeHnSrCEsICZxIfrU5hAbBYBVYnOgxfAbuIV8JDY 8n8/1Do5iZPHJrOC2JwCnhK/9nWCDZIQ+M8m8XrdcfYuRg4gR1Zi0wGoeheJ13+aWCFsYYlX x7ewQ9gyEp0dB5kg7H5GiaZWbQh7BqPEube8ELa1xOHjF8F6mQX4JCZtm84MMZ5XoqNNCML0 kHi+pByi2lFi+b6l7BC/z2GU2HnwEtsERpkFjAyrGEVSS4tz01OLTfWKE3OLS/PS9ZLzczcx AiP69L/jX3cwLj1mdYhRgINRiYc34vufCCHWxLLiytxDjBIczEoivGKJfyOEeFMSK6tSi/Lj i0pzUosPMUpzsCiJ83KduhYhJJCeWJKanZpakFoEk2Xi4JRqYNwd/OdTk+yEbmaVElbpKd2f 4nP77OzzjYMvMRQKbvB6zpR27UpcQOs8E54va7pveoXv4Fn0U/KpUqkij7ay/8LGn8lz0+uf Tl148uXWZ3Xqt21FHO/xtuyb5mgc1HetafbmSUxRE5l2Kd+ba/am8pzfmVKBc1bqHD6sl7ry uuOX+vznqF3MpMRSnJFoqMVcVJwIAJp8nqvkAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsVy+t/xq7o35/2NMPj2wNJi44z1rBbXvzxn tTh/fgO7xceee6wWM87vY7JYe+Quu8XFU64Wh9+0s1r8ONPN4sDp8f5GK7vH5b5eJo9NqzrZ PPq2rGL0+LxJLoA1ys0mIzUxJbVIITUvOT8lMy/dVik0xE3XQkkhLzE31VYpQtc3JEhJoSwx pxTIMzJAAw7OAe7BSvp2CW4Z7WfWsBZcZa3Y2/mBtYHxMUsXIyeHhICJRPezSYwQtpjEhXvr 2boYuTiEBJYwSmyfOZsVwmlikmi5O4UdpIpNwFCi620XG4gtIuAg8fnTa0aQImaB3UwSF08+ BhslLGAm8eH6FCYQm0VAVaLz4AWwdbwCHhJb/u9nhlgnJ3Hy2GRWEJtTwFPi175OsF4hoJqO C4tYJjDyLmBkWMUoklpanJueW2yoV5yYW1yal66XnJ+7iREY4NuO/dy8g/HSxuBDjAIcjEo8 vBt+/okQYk0sK67MPcQowcGsJMIrlvg3Qog3JbGyKrUoP76oNCe1+BCjKdBRE5mlRJPzgdGX VxJvaGJobmloZGxhYW5kpCTOW/LhSriQQHpiSWp2ampBahFMHxMHp1QDY8EG751p99L295mZ rXjW2Oqi5PtibYRp6boN+3vXdDCsyeIXKpP73d+my5xesiR8X5Huq7Xbd+x/JfI0rfTOzfD4 AE69R/4yMaFP7DMKv5s/7n60J3jaq/8nuM/Oci7WO3J55pHo8wYbr65IZyvqDX5vEDN9YnKV wPM9P/6se/yu5kSaCo/DaiWW4oxEQy3mouJEAB9AcwSGAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424064228eucas1p2543d7f206ac18476891e500991611733 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170424064228eucas1p2543d7f206ac18476891e500991611733 X-RootMTR: 20170424064228eucas1p2543d7f206ac18476891e500991611733 References: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org samsung_clk_register_pll2550x() function is not used anymore, so remove its declaration. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-pll.h | 4 ---- 1 file changed, 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/clk/samsung/clk-pll.h b/drivers/clk/samsung/clk-pll.h index a1ca0233cb4b..61eb8abbfd9c 100644 --- a/drivers/clk/samsung/clk-pll.h +++ b/drivers/clk/samsung/clk-pll.h @@ -103,8 +103,4 @@ struct samsung_pll_rate_table { unsigned int vsel; }; -extern struct clk * __init samsung_clk_register_pll2550x(const char *name, - const char *pname, const void __iomem *reg_base, - const unsigned long offset); - #endif /* __SAMSUNG_CLK_PLL_H */ From patchwork Mon Apr 24 06:42:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 98022 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1348090qgf; Sun, 23 Apr 2017 23:42:39 -0700 (PDT) X-Received: by 10.84.191.228 with SMTP id a91mr30780308pld.62.1493016159175; Sun, 23 Apr 2017 23:42:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si17792965pfb.23.2017.04.23.23.42.38; Sun, 23 Apr 2017 23:42:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165573AbdDXGmi (ORCPT + 4 others); Mon, 24 Apr 2017 02:42:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:30392 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165574AbdDXGmf (ORCPT ); Mon, 24 Apr 2017 02:42:35 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW00F04IMUV020@mailout2.w1.samsung.com>; Mon, 24 Apr 2017 07:42:31 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170424064230eucas1p1e9ff5c07314760c98857c38f1889333e~4QkdLJmtV1143411434eucas1p1I; Mon, 24 Apr 2017 06:42:30 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 79.5F.04459.65E9DF85; Mon, 24 Apr 2017 07:42:30 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170424064229eucas1p2367a90a36b5bcb99f48a24e72b29a629~4QkcWNkGc3081030810eucas1p24; Mon, 24 Apr 2017 06:42:29 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-c4-58fd9e566354 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 34.8C.20206.F6E9DF85; Mon, 24 Apr 2017 07:42:55 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00957IMPRV80@eusync3.samsung.com>; Mon, 24 Apr 2017 07:42:29 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 2/6] clk: samsung: Add local variable to match it purpose Date: Mon, 24 Apr 2017 08:42:19 +0200 Message-id: <1493016143-21569-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsWy7djP87ph8/5GGPy+ymWxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8AaxWWTkpqTWZZapG+XwJXx7eJS5oLdXBW3F1g2MJ7g6GLk5JAQMJFo/DSX BcIWk7hwbz1bFyMXh5DAUkaJiZcOQDmfGSV2zlzDBtNx89MdRojEMkaJFXtWQjkNTBL3n89m BaliEzCU6HrbBdYhIuAg8fnTa7AiZoGdTBITfq4ESwgL+Egc37cEbDmLgKrEzzsPGUFsXgEP iV8nGhkh1slJnDw2GWwop4CnxK99nWCDJAR+s0mcuTObqYuRA8iRldh0gBmi3kVi+ab5UA8J S7w6voUdwpaRuDy5GyrezyjR1KoNYc9glDj3lhfCtpY4fPwi2C5mAT6JSdumM0OM55XoaBOC KPGQWHD3BhOE7SjRsWkDO8TzcxglOq69Z53AKLOAkWEVo0hqaXFuemqxkV5xYm5xaV66XnJ+ 7iZGYEyf/nf84w7G9yesDjEKcDAq8fBGfP8TIcSaWFZcmXuIUYKDWUmEVyzxb4QQb0piZVVq UX58UWlOavEhRmkOFiVxXq5T1yKEBNITS1KzU1MLUotgskwcnFINjHnSC9RD7mt9eaK/amHO TN2Khfav/6kIZnB/vJjZG3io+n7hpb813ok1Ebsz2XUss3RD9MMny0r/if6/xvGS13+OSf4v ZmdoZEcWcby+tvv669oLcz3TZ7HpNTzZ+29vqFJ08Isp/GcvndnAqr5NtX/rEoZHVfULThwp cpOs+1Q3+bG8mYuWkRJLcUaioRZzUXEiAGDMjInlAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsVy+t/xq7r58/5GGFz9ImixccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8Aa5WaTkZqYklqkkJqXnJ+SmZduqxQa4qZroaSQl5ibaqsUoesbEqSkUJaY UwrkGRmgAQfnAPdgJX27BLeMbxeXMhfs5qq4vcCygfEERxcjJ4eEgInEzU93GCFsMYkL99az dTFycQgJLGGUWLZ+PQuE08QksfNiA1gVm4ChRNfbLjYQW0TAQeLzp9eMIEXMAruZJC6efAxW JCzgI3F83xIWEJtFQFXi552HYHFeAQ+JXycaodbJSZw8NpkVxOYU8JT4ta8TLC4EVNNxYRHL BEbeBYwMqxhFUkuLc9Nzi430ihNzi0vz0vWS83M3MQLDe9uxn1t2MHa9Cz7EKMDBqMTDG/H9 T4QQa2JZcWXuIUYJDmYlEV6xxL8RQrwpiZVVqUX58UWlOanFhxhNgY6ayCwlmpwPjL28knhD E0NzS0MjYwsLcyMjJXHeqR+uhAsJpCeWpGanphakFsH0MXFwSjUwtj3v9auv3p508LHy8Y+K qW5TW5iWbpTlXXb1/tX3qe7+7vGxu1u2G+SblE95o3J++6Rdk+r3SMvmsPt+Plx7U4L9apSi yaOrry6/l++pduSSP3abS0e2I1E82WPCfbGKJWrlR3yru3c6ZKcFKz15eP2jxxEjp4pPvjZd zx1VlmotzPTgji5WYinOSDTUYi4qTgQALLOLGYUCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424064229eucas1p2367a90a36b5bcb99f48a24e72b29a629 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170424064229eucas1p2367a90a36b5bcb99f48a24e72b29a629 X-RootMTR: 20170424064229eucas1p2367a90a36b5bcb99f48a24e72b29a629 References: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add new variable to avoid using clk pointer for different purposes across the exynos_register_cpu_clock() function. This will help in future rewrite for the new clk_hw API. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index 8bf7e805fd34..6e1c6007e721 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -410,6 +410,7 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, { struct exynos_cpuclk *cpuclk; struct clk_init_data init; + struct clk *parent_clk; struct clk *clk; int ret = 0; @@ -440,15 +441,15 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, goto free_cpuclk; } - clk = __clk_lookup(parent); - if (!clk) { + parent_clk = __clk_lookup(parent); + if (!parent_clk) { pr_err("%s: could not lookup parent clock %s\n", __func__, parent); ret = -EINVAL; goto free_cpuclk; } - ret = clk_notifier_register(clk, &cpuclk->clk_nb); + ret = clk_notifier_register(parent_clk, &cpuclk->clk_nb); if (ret) { pr_err("%s: failed to register clock notifier for %s\n", __func__, name); From patchwork Mon Apr 24 06:42:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 98023 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1348100qgf; Sun, 23 Apr 2017 23:42:40 -0700 (PDT) X-Received: by 10.98.113.67 with SMTP id m64mr8769057pfc.231.1493016160326; Sun, 23 Apr 2017 23:42:40 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si17792965pfb.23.2017.04.23.23.42.40; Sun, 23 Apr 2017 23:42:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165699AbdDXGmj (ORCPT + 4 others); Mon, 24 Apr 2017 02:42:39 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49629 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165682AbdDXGmg (ORCPT ); Mon, 24 Apr 2017 02:42:36 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW007JZIMVP820@mailout1.w1.samsung.com>; Mon, 24 Apr 2017 07:42:31 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170424064230eucas1p1f006de41d3e448fa432dea8959fa0bee~4QkdZZCI01143411434eucas1p1K; Mon, 24 Apr 2017 06:42:30 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 1A.5F.04459.65E9DF85; Mon, 24 Apr 2017 07:42:30 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170424064229eucas1p2f2feb95623d6c4ac8db01ff519a53fa9~4QkcnqAZm3018530185eucas1p2w; Mon, 24 Apr 2017 06:42:29 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-c5-58fd9e565860 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2A.5A.17452.ADE9DF85; Mon, 24 Apr 2017 07:44:42 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00957IMPRV80@eusync3.samsung.com>; Mon, 24 Apr 2017 07:42:29 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 3/6] clk: samsung: Convert common drivers to the new clk_hw API Date: Mon, 24 Apr 2017 08:42:20 +0200 Message-id: <1493016143-21569-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCIsWRmVeSWpSXmKPExsWy7djP87ph8/5GGHxuEbDYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbnHxlKvF4TftrBY/znSzOHB6vL/Ryu5xua+XyWPTqk42 j74tqxg9Pm+SC2CN4rJJSc3JLEst0rdL4MpY/eQyU8HzOYwV845cZGpgvFPfxcjJISFgInHr 92pGCFtM4sK99WxdjFwcQgJLGSXmzzzDAuF8ZpTo3ruTHabj2OFVrBCJZYwSu9+shnIamCTu P5/NClLFJmAo0fW2iw3EFhFwkPj86TUjSBGzwE4miQk/V4IlhAVCJK7P+QVmswioSny7vZoZ xOYV8JD4/3c31FFyEiePTQYbyingKfFrXyfYIAmB/2wSLUePAh3IAeTISmw6wAxR7yLx6+cM NghbWOLV8S1QZ8tIdHYcZIKw+xklmlq1IewZjBLn3vJC2NYSh49fBNvFLMAnMWnbdGaI8bwS HW1CECUeElPmv2GFsB0lzvxcxQ7x/BxGiVO3brNNYJRZwMiwilEktbQ4Nz212EivODG3uDQv XS85P3cTIzCuT/87/nEH4/sTVocYBTgYlXh4I77/iRBiTSwrrsw9xCjBwawkwiuW+DdCiDcl sbIqtSg/vqg0J7X4EKM0B4uSOC/XqWsRQgLpiSWp2ampBalFMFkmDk6pBkaF1ImrfX9vilnG rHg7p9zR8d7Fnf0bBCtEz85xlUzeu8Tp4bxr97jiwnd13+SzWnx1w459s7/81gr033VVuPT4 J/O6EzE2PgULWC6tVMyUD/6u9+6PU8abqOQETbmkabGWP7T8FSS/6dv127n6LkmOeP/6f4sQ c/O1z1+411w4U/bF7/tb/8VKLMUZiYZazEXFiQBgBEH+5wIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsVy+t/xq7q35v2NMFjRa22xccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8Aa5WaTkZqYklqkkJqXnJ+SmZduqxQa4qZroaSQl5ibaqsUoesbEqSkUJaY UwrkGRmgAQfnAPdgJX27BLeM1U8uMxU8n8NYMe/IRaYGxjv1XYycHBICJhLHDq9ihbDFJC7c W88GYgsJLGGUOP0/oIuRC8huYpLYebGBESTBJmAo0fW2C6xIRMBB4vOn14wgRcwCu5kkLp58 DFYkLBAi8eH0IRYQm0VAVeLb7dXMIDavgIfE/7+7GSG2yUmcPDYZbDOngKfEr32djBCbPSQ6 LiximcDIu4CRYRWjSGppcW56brGhXnFibnFpXrpecn7uJkZggG879nPzDsZLG4MPMQpwMCrx 8G74+SdCiDWxrLgy9xCjBAezkgivWOLfCCHelMTKqtSi/Pii0pzU4kOMpkBHTWSWEk3OB0Zf Xkm8oYmhuaWhkbGFhbmRkZI4b8mHK+FCAumJJanZqakFqUUwfUwcnFINjL0HrzcuO2sUblc2 u3mSx73zFixF9yJX2j3fzp3KFbZBaXODnoxYTQGX3rZTx1XdWx+Lr+0/ddx5tqTjcrdj7isL v+ZF3Vr3ZdF9y7vvp3Gt3mix4ZPgzIRvcay/ggxviWruYVspGWbZ6OU4a5Pjd5PHZxm97pk1 pb495JvI5aymLHbw1tefsUosxRmJhlrMRcWJABgcHbKGAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424064229eucas1p2f2feb95623d6c4ac8db01ff519a53fa9 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170424064229eucas1p2f2feb95623d6c4ac8db01ff519a53fa9 X-RootMTR: 20170424064229eucas1p2f2feb95623d6c4ac8db01ff519a53fa9 References: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Clock providers should use the new struct clk_hw based API, so convert Samsung clock providers and their helper functions to the new approach. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-cpu.c | 8 ++- drivers/clk/samsung/clk-pll.c | 14 +++--- drivers/clk/samsung/clk-s3c2410-dclk.c | 75 ++++++++++++++-------------- drivers/clk/samsung/clk.c | 91 +++++++++++++++------------------- drivers/clk/samsung/clk.h | 9 ++-- 5 files changed, 92 insertions(+), 105 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index 6e1c6007e721..fbf0154b81a5 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -411,7 +411,6 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, struct exynos_cpuclk *cpuclk; struct clk_init_data init; struct clk *parent_clk; - struct clk *clk; int ret = 0; cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); @@ -464,14 +463,13 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, goto unregister_clk_nb; } - clk = clk_register(NULL, &cpuclk->hw); - if (IS_ERR(clk)) { + ret = clk_hw_register(NULL, &cpuclk->hw); + if (ret) { pr_err("%s: could not register cpuclk %s\n", __func__, name); - ret = PTR_ERR(clk); goto free_cpuclk_data; } - samsung_clk_add_lookup(ctx, clk, lookup_id); + samsung_clk_add_lookup(ctx, &cpuclk->hw, lookup_id); return 0; free_cpuclk_data: diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c index 52290894857a..db680575a9bd 100644 --- a/drivers/clk/samsung/clk-pll.c +++ b/drivers/clk/samsung/clk-pll.c @@ -1244,7 +1244,6 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, void __iomem *base) { struct samsung_clk_pll *pll; - struct clk *clk; struct clk_init_data init; int ret, len; @@ -1376,20 +1375,21 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, pll->lock_reg = base + pll_clk->lock_offset; pll->con_reg = base + pll_clk->con_offset; - clk = clk_register(NULL, &pll->hw); - if (IS_ERR(clk)) { - pr_err("%s: failed to register pll clock %s : %ld\n", - __func__, pll_clk->name, PTR_ERR(clk)); + ret = clk_hw_register(NULL, &pll->hw); + if (ret) { + pr_err("%s: failed to register pll clock %s : %d\n", + __func__, pll_clk->name, ret); kfree(pll); return; } - samsung_clk_add_lookup(ctx, clk, pll_clk->id); + samsung_clk_add_lookup(ctx, &pll->hw, pll_clk->id); if (!pll_clk->alias) return; - ret = clk_register_clkdev(clk, pll_clk->alias, pll_clk->dev_name); + ret = clk_hw_register_clkdev(&pll->hw, pll_clk->alias, + pll_clk->dev_name); if (ret) pr_err("%s: failed to register lookup for %s : %d", __func__, pll_clk->name, ret); diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c index ae9a595c72d0..077df3e539a7 100644 --- a/drivers/clk/samsung/clk-s3c2410-dclk.c +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c @@ -90,13 +90,13 @@ static int s3c24xx_clkout_set_parent(struct clk_hw *hw, u8 index) .determine_rate = __clk_mux_determine_rate, }; -static struct clk *s3c24xx_register_clkout(struct device *dev, const char *name, - const char **parent_names, u8 num_parents, +static struct clk_hw *s3c24xx_register_clkout(struct device *dev, + const char *name, const char **parent_names, u8 num_parents, u8 shift, u32 mask) { struct s3c24xx_clkout *clkout; - struct clk *clk; struct clk_init_data init; + int ret; /* allocate the clkout */ clkout = kzalloc(sizeof(*clkout), GFP_KERNEL); @@ -113,9 +113,11 @@ static struct clk *s3c24xx_register_clkout(struct device *dev, const char *name, clkout->mask = mask; clkout->hw.init = &init; - clk = clk_register(dev, &clkout->hw); + ret = clk_hw_register(dev, &clkout->hw); + if (ret) + return ERR_PTR(ret); - return clk; + return &clkout->hw; } /* @@ -125,11 +127,12 @@ static struct clk *s3c24xx_register_clkout(struct device *dev, const char *name, struct s3c24xx_dclk { struct device *dev; void __iomem *base; - struct clk_onecell_data clk_data; struct notifier_block dclk0_div_change_nb; struct notifier_block dclk1_div_change_nb; spinlock_t dclk_lock; unsigned long reg_save; + /* clk_data must be the last entry in the structure */ + struct clk_hw_onecell_data clk_data; }; #define to_s3c24xx_dclk0(x) \ @@ -240,28 +243,23 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) { struct s3c24xx_dclk *s3c24xx_dclk; struct resource *mem; - struct clk **clk_table; struct s3c24xx_dclk_drv_data *dclk_variant; + struct clk_hw **clk_table; int ret, i; - s3c24xx_dclk = devm_kzalloc(&pdev->dev, sizeof(*s3c24xx_dclk), - GFP_KERNEL); + s3c24xx_dclk = devm_kzalloc(&pdev->dev, sizeof(*s3c24xx_dclk) + + sizeof(*s3c24xx_dclk->clk_data.hws) * DCLK_MAX_CLKS, + GFP_KERNEL); if (!s3c24xx_dclk) return -ENOMEM; + clk_table = s3c24xx_dclk->clk_data.hws; + s3c24xx_dclk->dev = &pdev->dev; + s3c24xx_dclk->clk_data.num = DCLK_MAX_CLKS; platform_set_drvdata(pdev, s3c24xx_dclk); spin_lock_init(&s3c24xx_dclk->dclk_lock); - clk_table = devm_kzalloc(&pdev->dev, - sizeof(struct clk *) * DCLK_MAX_CLKS, - GFP_KERNEL); - if (!clk_table) - return -ENOMEM; - - s3c24xx_dclk->clk_data.clks = clk_table; - s3c24xx_dclk->clk_data.clk_num = DCLK_MAX_CLKS; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); s3c24xx_dclk->base = devm_ioremap_resource(&pdev->dev, mem); if (IS_ERR(s3c24xx_dclk->base)) @@ -271,29 +269,29 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) platform_get_device_id(pdev)->driver_data; - clk_table[MUX_DCLK0] = clk_register_mux(&pdev->dev, "mux_dclk0", + clk_table[MUX_DCLK0] = clk_hw_register_mux(&pdev->dev, "mux_dclk0", dclk_variant->mux_parent_names, dclk_variant->mux_num_parents, 0, s3c24xx_dclk->base, 1, 1, 0, &s3c24xx_dclk->dclk_lock); - clk_table[MUX_DCLK1] = clk_register_mux(&pdev->dev, "mux_dclk1", + clk_table[MUX_DCLK1] = clk_hw_register_mux(&pdev->dev, "mux_dclk1", dclk_variant->mux_parent_names, dclk_variant->mux_num_parents, 0, s3c24xx_dclk->base, 17, 1, 0, &s3c24xx_dclk->dclk_lock); - clk_table[DIV_DCLK0] = clk_register_divider(&pdev->dev, "div_dclk0", + clk_table[DIV_DCLK0] = clk_hw_register_divider(&pdev->dev, "div_dclk0", "mux_dclk0", 0, s3c24xx_dclk->base, 4, 4, 0, &s3c24xx_dclk->dclk_lock); - clk_table[DIV_DCLK1] = clk_register_divider(&pdev->dev, "div_dclk1", + clk_table[DIV_DCLK1] = clk_hw_register_divider(&pdev->dev, "div_dclk1", "mux_dclk1", 0, s3c24xx_dclk->base, 20, 4, 0, &s3c24xx_dclk->dclk_lock); - clk_table[GATE_DCLK0] = clk_register_gate(&pdev->dev, "gate_dclk0", + clk_table[GATE_DCLK0] = clk_hw_register_gate(&pdev->dev, "gate_dclk0", "div_dclk0", CLK_SET_RATE_PARENT, s3c24xx_dclk->base, 0, 0, &s3c24xx_dclk->dclk_lock); - clk_table[GATE_DCLK1] = clk_register_gate(&pdev->dev, "gate_dclk1", + clk_table[GATE_DCLK1] = clk_hw_register_gate(&pdev->dev, "gate_dclk1", "div_dclk1", CLK_SET_RATE_PARENT, s3c24xx_dclk->base, 16, 0, &s3c24xx_dclk->dclk_lock); @@ -312,15 +310,16 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) goto err_clk_register; } - ret = clk_register_clkdev(clk_table[MUX_DCLK0], "dclk0", NULL); + ret = clk_hw_register_clkdev(clk_table[MUX_DCLK0], "dclk0", NULL); if (!ret) - ret = clk_register_clkdev(clk_table[MUX_DCLK1], "dclk1", NULL); + ret = clk_hw_register_clkdev(clk_table[MUX_DCLK1], "dclk1", + NULL); if (!ret) - ret = clk_register_clkdev(clk_table[MUX_CLKOUT0], - "clkout0", NULL); + ret = clk_hw_register_clkdev(clk_table[MUX_CLKOUT0], + "clkout0", NULL); if (!ret) - ret = clk_register_clkdev(clk_table[MUX_CLKOUT1], - "clkout1", NULL); + ret = clk_hw_register_clkdev(clk_table[MUX_CLKOUT1], + "clkout1", NULL); if (ret) { dev_err(&pdev->dev, "failed to register aliases, %d\n", ret); goto err_clk_register; @@ -332,12 +331,12 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) s3c24xx_dclk->dclk1_div_change_nb.notifier_call = s3c24xx_dclk1_div_notify; - ret = clk_notifier_register(clk_table[DIV_DCLK0], + ret = clk_notifier_register(clk_table[DIV_DCLK0]->clk, &s3c24xx_dclk->dclk0_div_change_nb); if (ret) goto err_clk_register; - ret = clk_notifier_register(clk_table[DIV_DCLK1], + ret = clk_notifier_register(clk_table[DIV_DCLK1]->clk, &s3c24xx_dclk->dclk1_div_change_nb); if (ret) goto err_dclk_notify; @@ -345,12 +344,12 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) return 0; err_dclk_notify: - clk_notifier_unregister(clk_table[DIV_DCLK0], + clk_notifier_unregister(clk_table[DIV_DCLK0]->clk, &s3c24xx_dclk->dclk0_div_change_nb); err_clk_register: for (i = 0; i < DCLK_MAX_CLKS; i++) if (clk_table[i] && !IS_ERR(clk_table[i])) - clk_unregister(clk_table[i]); + clk_hw_unregister(clk_table[i]); return ret; } @@ -358,16 +357,16 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) static int s3c24xx_dclk_remove(struct platform_device *pdev) { struct s3c24xx_dclk *s3c24xx_dclk = platform_get_drvdata(pdev); - struct clk **clk_table = s3c24xx_dclk->clk_data.clks; + struct clk_hw **clk_table = s3c24xx_dclk->clk_data.hws; int i; - clk_notifier_unregister(clk_table[DIV_DCLK1], + clk_notifier_unregister(clk_table[DIV_DCLK1]->clk, &s3c24xx_dclk->dclk1_div_change_nb); - clk_notifier_unregister(clk_table[DIV_DCLK0], + clk_notifier_unregister(clk_table[DIV_DCLK0]->clk, &s3c24xx_dclk->dclk0_div_change_nb); for (i = 0; i < DCLK_MAX_CLKS; i++) - clk_unregister(clk_table[i]); + clk_hw_unregister(clk_table[i]); return 0; } diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index b7d87d6db9dc..7ce0fa86c5ff 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -60,23 +60,18 @@ struct samsung_clk_provider *__init samsung_clk_init(struct device_node *np, void __iomem *base, unsigned long nr_clks) { struct samsung_clk_provider *ctx; - struct clk **clk_table; int i; - ctx = kzalloc(sizeof(struct samsung_clk_provider), GFP_KERNEL); + ctx = kzalloc(sizeof(struct samsung_clk_provider) + + sizeof(*ctx->clk_data.hws) * nr_clks, GFP_KERNEL); if (!ctx) panic("could not allocate clock provider context.\n"); - clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); - if (!clk_table) - panic("could not allocate clock lookup table\n"); - for (i = 0; i < nr_clks; ++i) - clk_table[i] = ERR_PTR(-ENOENT); + ctx->clk_data.hws[i] = ERR_PTR(-ENOENT); ctx->reg_base = base; - ctx->clk_data.clks = clk_table; - ctx->clk_data.clk_num = nr_clks; + ctx->clk_data.num = nr_clks; spin_lock_init(&ctx->lock); return ctx; @@ -86,18 +81,18 @@ void __init samsung_clk_of_add_provider(struct device_node *np, struct samsung_clk_provider *ctx) { if (np) { - if (of_clk_add_provider(np, of_clk_src_onecell_get, + if (of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &ctx->clk_data)) panic("could not register clk provider\n"); } } /* add a clock instance to the clock lookup table used for dt based lookup */ -void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, struct clk *clk, - unsigned int id) +void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, + struct clk_hw *clk_hw, unsigned int id) { - if (ctx->clk_data.clks && id) - ctx->clk_data.clks[id] = clk; + if (id) + ctx->clk_data.hws[id] = clk_hw; } /* register a list of aliases */ @@ -105,14 +100,9 @@ void __init samsung_clk_register_alias(struct samsung_clk_provider *ctx, const struct samsung_clock_alias *list, unsigned int nr_clk) { - struct clk *clk; + struct clk_hw *clk_hw; unsigned int idx, ret; - if (!ctx->clk_data.clks) { - pr_err("%s: clock table missing\n", __func__); - return; - } - for (idx = 0; idx < nr_clk; idx++, list++) { if (!list->id) { pr_err("%s: clock id missing for index %d\n", __func__, @@ -120,14 +110,15 @@ void __init samsung_clk_register_alias(struct samsung_clk_provider *ctx, continue; } - clk = ctx->clk_data.clks[list->id]; - if (!clk) { + clk_hw = ctx->clk_data.hws[list->id]; + if (!clk_hw) { pr_err("%s: failed to find clock %d\n", __func__, list->id); continue; } - ret = clk_register_clkdev(clk, list->alias, list->dev_name); + ret = clk_hw_register_clkdev(clk_hw, list->alias, + list->dev_name); if (ret) pr_err("%s: failed to register lookup %s\n", __func__, list->alias); @@ -139,25 +130,25 @@ void __init samsung_clk_register_fixed_rate(struct samsung_clk_provider *ctx, const struct samsung_fixed_rate_clock *list, unsigned int nr_clk) { - struct clk *clk; + struct clk_hw *clk_hw; unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_fixed_rate(NULL, list->name, + clk_hw = clk_hw_register_fixed_rate(NULL, list->name, list->parent_name, list->flags, list->fixed_rate); - if (IS_ERR(clk)) { + if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, list->name); continue; } - samsung_clk_add_lookup(ctx, clk, list->id); + samsung_clk_add_lookup(ctx, clk_hw, list->id); /* * Unconditionally add a clock lookup for the fixed rate clocks. * There are not many of these on any of Samsung platforms. */ - ret = clk_register_clkdev(clk, list->name, NULL); + ret = clk_hw_register_clkdev(clk_hw, list->name, NULL); if (ret) pr_err("%s: failed to register clock lookup for %s", __func__, list->name); @@ -168,19 +159,19 @@ void __init samsung_clk_register_fixed_rate(struct samsung_clk_provider *ctx, void __init samsung_clk_register_fixed_factor(struct samsung_clk_provider *ctx, const struct samsung_fixed_factor_clock *list, unsigned int nr_clk) { - struct clk *clk; + struct clk_hw *clk_hw; unsigned int idx; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_fixed_factor(NULL, list->name, + clk_hw = clk_hw_register_fixed_factor(NULL, list->name, list->parent_name, list->flags, list->mult, list->div); - if (IS_ERR(clk)) { + if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, list->name); continue; } - samsung_clk_add_lookup(ctx, clk, list->id); + samsung_clk_add_lookup(ctx, clk_hw, list->id); } } @@ -189,25 +180,25 @@ void __init samsung_clk_register_mux(struct samsung_clk_provider *ctx, const struct samsung_mux_clock *list, unsigned int nr_clk) { - struct clk *clk; + struct clk_hw *clk_hw; unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_mux(NULL, list->name, list->parent_names, - list->num_parents, list->flags, + clk_hw = clk_hw_register_mux(NULL, list->name, + list->parent_names, list->num_parents, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->mux_flags, &ctx->lock); - if (IS_ERR(clk)) { + if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, list->name); continue; } - samsung_clk_add_lookup(ctx, clk, list->id); + samsung_clk_add_lookup(ctx, clk_hw, list->id); /* register a clock lookup only if a clock alias is specified */ if (list->alias) { - ret = clk_register_clkdev(clk, list->alias, + ret = clk_hw_register_clkdev(clk_hw, list->alias, list->dev_name); if (ret) pr_err("%s: failed to register lookup %s\n", @@ -221,32 +212,32 @@ void __init samsung_clk_register_div(struct samsung_clk_provider *ctx, const struct samsung_div_clock *list, unsigned int nr_clk) { - struct clk *clk; + struct clk_hw *clk_hw; unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { if (list->table) - clk = clk_register_divider_table(NULL, list->name, - list->parent_name, list->flags, + clk_hw = clk_hw_register_divider_table(NULL, + list->name, list->parent_name, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->div_flags, list->table, &ctx->lock); else - clk = clk_register_divider(NULL, list->name, + clk_hw = clk_hw_register_divider(NULL, list->name, list->parent_name, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->div_flags, &ctx->lock); - if (IS_ERR(clk)) { + if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, list->name); continue; } - samsung_clk_add_lookup(ctx, clk, list->id); + samsung_clk_add_lookup(ctx, clk_hw, list->id); /* register a clock lookup only if a clock alias is specified */ if (list->alias) { - ret = clk_register_clkdev(clk, list->alias, + ret = clk_hw_register_clkdev(clk_hw, list->alias, list->dev_name); if (ret) pr_err("%s: failed to register lookup %s\n", @@ -260,14 +251,14 @@ void __init samsung_clk_register_gate(struct samsung_clk_provider *ctx, const struct samsung_gate_clock *list, unsigned int nr_clk) { - struct clk *clk; + struct clk_hw *clk_hw; unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_gate(NULL, list->name, list->parent_name, + clk_hw = clk_hw_register_gate(NULL, list->name, list->parent_name, list->flags, ctx->reg_base + list->offset, list->bit_idx, list->gate_flags, &ctx->lock); - if (IS_ERR(clk)) { + if (IS_ERR(clk_hw)) { pr_err("%s: failed to register clock %s\n", __func__, list->name); continue; @@ -275,14 +266,14 @@ void __init samsung_clk_register_gate(struct samsung_clk_provider *ctx, /* register a clock lookup only if a clock alias is specified */ if (list->alias) { - ret = clk_register_clkdev(clk, list->alias, + ret = clk_hw_register_clkdev(clk_hw, list->alias, list->dev_name); if (ret) pr_err("%s: failed to register lookup %s\n", __func__, list->alias); } - samsung_clk_add_lookup(ctx, clk, list->id); + samsung_clk_add_lookup(ctx, clk_hw, list->id); } } diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index da3bdebabf1e..b8ca0dd3a38b 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -16,18 +16,17 @@ #include #include "clk-pll.h" -struct clk; - /** * struct samsung_clk_provider: information about clock provider * @reg_base: virtual address for the register base. - * @clk_data: holds clock related data like clk* and number of clocks. * @lock: maintains exclusion between callbacks for a given clock-provider. + * @clk_data: holds clock related data like clk_hw* and number of clocks. */ struct samsung_clk_provider { void __iomem *reg_base; - struct clk_onecell_data clk_data; spinlock_t lock; + /* clk_data must be the last entry due to variable lenght 'hws' array */ + struct clk_hw_onecell_data clk_data; }; /** @@ -367,7 +366,7 @@ extern void __init samsung_clk_of_register_fixed_ext( const struct of_device_id *clk_matches); extern void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, - struct clk *clk, unsigned int id); + struct clk_hw *clk_hw, unsigned int id); extern void __init samsung_clk_register_alias(struct samsung_clk_provider *ctx, const struct samsung_clock_alias *list, From patchwork Mon Apr 24 06:42:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 98025 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1348118qgf; Sun, 23 Apr 2017 23:42:43 -0700 (PDT) X-Received: by 10.98.60.134 with SMTP id b6mr23036273pfk.19.1493016162983; Sun, 23 Apr 2017 23:42:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si17792965pfb.23.2017.04.23.23.42.42; Sun, 23 Apr 2017 23:42:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165683AbdDXGmm (ORCPT + 4 others); Mon, 24 Apr 2017 02:42:42 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49629 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165685AbdDXGmi (ORCPT ); Mon, 24 Apr 2017 02:42:38 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW008HZIMTWQ20@mailout1.w1.samsung.com>; Mon, 24 Apr 2017 07:42:31 +0100 (BST) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170424064231eucas1p1a3325ad2f053f538f811550d9fc7431b~4Qkd-w0rZ2008420084eucas1p1f; Mon, 24 Apr 2017 06:42:31 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 6E.5F.25577.65E9DF85; Mon, 24 Apr 2017 07:42:31 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170424064230eucas1p183fecc2feda35c3fb5fc1af44d130f59~4QkdS0ktA2008420084eucas1p1a; Mon, 24 Apr 2017 06:42:30 +0000 (GMT) X-AuditID: cbfec7f5-f792f6d0000063e9-d8-58fd9e560a16 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D4.8C.20206.07E9DF85; Mon, 24 Apr 2017 07:42:56 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00957IMPRV80@eusync3.samsung.com>; Mon, 24 Apr 2017 07:42:30 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 4/6] clk: samsung: exynos-audss: Convert to the new clk_hw API Date: Mon, 24 Apr 2017 08:42:21 +0200 Message-id: <1493016143-21569-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7djPc7rh8/5GGLy4w2yxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8AaxWWTkpqTWZZapG+XwJVx/2ZdQZ9hxa9Z/9kbGN9rdDFyckgImEj8+3qG BcIWk7hwbz1bFyMXh5DAUkaJqfdeMEM4nxklZq+dyALTcfjRI3aIxDJGiVdP+pggnAYmib3f nzGDVLEJGEp0ve1iA7FFBBwkPn96zQhSxCywk0liws+VYAlhgWCJ2+/3gY1lEVCVOPV6C1gz r4CHxNuLZ1kh1slJnDw2GczmFPCU+LWvkxEi/p9N4kSTVRcjB5AtK7HpADNE2EVi7s4X7BC2 sMSr41ugbBmJy5O7oT7oZ5RoatWGsGcwSpx7ywthW0scPn4RbBWzAJ/EpG3TmSHG80p0tAlB lHhIrLm1kA3CdpR4vWkd2DVCAnMYJXoeS01glFnAyLCKUSS1tDg3PbXYVK84Mbe4NC9dLzk/ dxMjMJ5P/zv+dQfj0mNWhxgFOBiVeHgjvv+JEGJNLCuuzD3EKMHBrCTCK5b4N0KINyWxsiq1 KD++qDQntfgQozQHi5I4L9epaxFCAumJJanZqakFqUUwWSYOTqkGxtAt4VqKFdPUuKN8V25/ 5yfz0k14x35mPbdT3bcmyotNePL2zMSU7U+u33q/mY9V8njO5gL/t+IaUfIfzzvPuupoka+/ 4gpX7ZujTU2VZ4yZnxen2e4ROL5CsbSdKz4jr2udzVZR83NLOGZMjU/VeBh5fbf33P2zDuVt WW41dSv/9ZNhc2/VmSuxFGckGmoxFxUnAgDDE1HM4wIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsVy+t/xq7oF8/5GGBybIGyxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8Aa5WaTkZqYklqkkJqXnJ+SmZduqxQa4qZroaSQl5ibaqsUoesbEqSkUJaY UwrkGRmgAQfnAPdgJX27BLeM+zfrCvoMK37N+s/ewPheo4uRk0NCwETi8KNH7BC2mMSFe+vZ uhi5OIQEljBKnFv2nBXCaWKSuHx5IStIFZuAoUTX2y42EFtEwEHi86fXjCBFzAK7mSQunnzM CJIQFgiWmLD9NthYFgFViVOvtzCD2LwCHhJvL55lhVgnJ3Hy2GQwm1PAU+LXvk6wXiGgmo4L i1gmMPIuYGRYxSiSWlqcm55bbKRXnJhbXJqXrpecn7uJERje24793LKDsetd8CFGAQ5GJR7e iO9/IoRYE8uKK3MPMUpwMCuJ8Iol/o0Q4k1JrKxKLcqPLyrNSS0+xGgKdNREZinR5Hxg7OWV xBuaGJpbGhoZW1iYGxkpifNO/XAlXEggPbEkNTs1tSC1CKaPiYNTqoGRL9Y6dMfPA7tOLRB8 YlVZwVn3K/3B1YtP3q3Lv68pumd9xz2Vi7Ibavw+Pzioq+z2//Wku9NnWrar/4+vv2B7jFld /fJiuZ2Zjx075lxp9lxWxrcyXHb9x+cft3ieeRftrhLSo8Dz6Mp9sx1qMteYT0kdu+wU1az6 k+O6BPPG8qjqtpu7mKWuKLEUZyQaajEXFScCAGyd2pCFAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424064230eucas1p183fecc2feda35c3fb5fc1af44d130f59 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170424064230eucas1p183fecc2feda35c3fb5fc1af44d130f59 X-RootMTR: 20170424064230eucas1p183fecc2feda35c3fb5fc1af44d130f59 References: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Clock providers should use the new struct clk_hw based API, so convert Exynos Audio Subsystem clock provider to the new approach. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- drivers/clk/samsung/clk-exynos-audss.c | 55 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 27 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c index cb7df358a27d..e8f89529da07 100644 --- a/drivers/clk/samsung/clk-exynos-audss.c +++ b/drivers/clk/samsung/clk-exynos-audss.c @@ -22,9 +22,8 @@ #include static DEFINE_SPINLOCK(lock); -static struct clk **clk_table; static void __iomem *reg_base; -static struct clk_onecell_data clk_data; +static struct clk_hw_onecell_data *clk_data; /* * On Exynos5420 this will be a clock which has to be enabled before any * access to audss registers. Typically a child of EPLL. @@ -110,18 +109,18 @@ static void exynos_audss_clk_teardown(void) int i; for (i = EXYNOS_MOUT_AUDSS; i < EXYNOS_DOUT_SRP; i++) { - if (!IS_ERR(clk_table[i])) - clk_unregister_mux(clk_table[i]); + if (!IS_ERR(clk_data->hws[i])) + clk_hw_unregister_mux(clk_data->hws[i]); } for (; i < EXYNOS_SRP_CLK; i++) { - if (!IS_ERR(clk_table[i])) - clk_unregister_divider(clk_table[i]); + if (!IS_ERR(clk_data->hws[i])) + clk_hw_unregister_divider(clk_data->hws[i]); } - for (; i < clk_data.clk_num; i++) { - if (!IS_ERR(clk_table[i])) - clk_unregister_gate(clk_table[i]); + for (; i < clk_data->num; i++) { + if (!IS_ERR(clk_data->hws[i])) + clk_hw_unregister_gate(clk_data->hws[i]); } } @@ -133,6 +132,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) const char *sclk_pcm_p = "sclk_pcm0"; struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in; const struct exynos_audss_clk_drvdata *variant; + struct clk_hw **clk_table; struct resource *res; int i, ret = 0; @@ -149,14 +149,15 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) epll = ERR_PTR(-ENODEV); - clk_table = devm_kzalloc(&pdev->dev, - sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS, + clk_data = devm_kzalloc(&pdev->dev, + sizeof(*clk_data) + + sizeof(*clk_data->hws) * EXYNOS_AUDSS_MAX_CLKS, GFP_KERNEL); - if (!clk_table) + if (!clk_data) return -ENOMEM; - clk_data.clks = clk_table; - clk_data.clk_num = variant->num_clks; + clk_data->num = variant->num_clks; + clk_table = clk_data->hws; pll_ref = devm_clk_get(&pdev->dev, "pll_ref"); pll_in = devm_clk_get(&pdev->dev, "pll_in"); @@ -176,7 +177,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) } } } - clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss", + clk_table[EXYNOS_MOUT_AUDSS] = clk_hw_register_mux(NULL, "mout_audss", mout_audss_p, ARRAY_SIZE(mout_audss_p), CLK_SET_RATE_NO_REPARENT, reg_base + ASS_CLK_SRC, 0, 1, 0, &lock); @@ -187,53 +188,53 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) mout_i2s_p[1] = __clk_get_name(cdclk); if (!IS_ERR(sclk_audio)) mout_i2s_p[2] = __clk_get_name(sclk_audio); - clk_table[EXYNOS_MOUT_I2S] = clk_register_mux(NULL, "mout_i2s", + clk_table[EXYNOS_MOUT_I2S] = clk_hw_register_mux(NULL, "mout_i2s", mout_i2s_p, ARRAY_SIZE(mout_i2s_p), CLK_SET_RATE_NO_REPARENT, reg_base + ASS_CLK_SRC, 2, 2, 0, &lock); - clk_table[EXYNOS_DOUT_SRP] = clk_register_divider(NULL, "dout_srp", + clk_table[EXYNOS_DOUT_SRP] = clk_hw_register_divider(NULL, "dout_srp", "mout_audss", 0, reg_base + ASS_CLK_DIV, 0, 4, 0, &lock); - clk_table[EXYNOS_DOUT_AUD_BUS] = clk_register_divider(NULL, + clk_table[EXYNOS_DOUT_AUD_BUS] = clk_hw_register_divider(NULL, "dout_aud_bus", "dout_srp", 0, reg_base + ASS_CLK_DIV, 4, 4, 0, &lock); - clk_table[EXYNOS_DOUT_I2S] = clk_register_divider(NULL, "dout_i2s", + clk_table[EXYNOS_DOUT_I2S] = clk_hw_register_divider(NULL, "dout_i2s", "mout_i2s", 0, reg_base + ASS_CLK_DIV, 8, 4, 0, &lock); - clk_table[EXYNOS_SRP_CLK] = clk_register_gate(NULL, "srp_clk", + clk_table[EXYNOS_SRP_CLK] = clk_hw_register_gate(NULL, "srp_clk", "dout_srp", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 0, 0, &lock); - clk_table[EXYNOS_I2S_BUS] = clk_register_gate(NULL, "i2s_bus", + clk_table[EXYNOS_I2S_BUS] = clk_hw_register_gate(NULL, "i2s_bus", "dout_aud_bus", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 2, 0, &lock); - clk_table[EXYNOS_SCLK_I2S] = clk_register_gate(NULL, "sclk_i2s", + clk_table[EXYNOS_SCLK_I2S] = clk_hw_register_gate(NULL, "sclk_i2s", "dout_i2s", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 3, 0, &lock); - clk_table[EXYNOS_PCM_BUS] = clk_register_gate(NULL, "pcm_bus", + clk_table[EXYNOS_PCM_BUS] = clk_hw_register_gate(NULL, "pcm_bus", "sclk_pcm", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 4, 0, &lock); sclk_pcm_in = devm_clk_get(&pdev->dev, "sclk_pcm_in"); if (!IS_ERR(sclk_pcm_in)) sclk_pcm_p = __clk_get_name(sclk_pcm_in); - clk_table[EXYNOS_SCLK_PCM] = clk_register_gate(NULL, "sclk_pcm", + clk_table[EXYNOS_SCLK_PCM] = clk_hw_register_gate(NULL, "sclk_pcm", sclk_pcm_p, CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 5, 0, &lock); if (variant->has_adma_clk) { - clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma", + clk_table[EXYNOS_ADMA] = clk_hw_register_gate(NULL, "adma", "dout_srp", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 9, 0, &lock); } - for (i = 0; i < clk_data.clk_num; i++) { + for (i = 0; i < clk_data->num; i++) { if (IS_ERR(clk_table[i])) { dev_err(&pdev->dev, "failed to register clock %d\n", i); ret = PTR_ERR(clk_table[i]); @@ -241,7 +242,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) } } - ret = of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get, + ret = of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_onecell_get, &clk_data); if (ret) { dev_err(&pdev->dev, "failed to add clock provider\n"); From patchwork Mon Apr 24 06:42:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 98026 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1348130qgf; Sun, 23 Apr 2017 23:42:44 -0700 (PDT) X-Received: by 10.98.17.204 with SMTP id 73mr23643987pfr.267.1493016164598; Sun, 23 Apr 2017 23:42:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si17792965pfb.23.2017.04.23.23.42.44; Sun, 23 Apr 2017 23:42:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165685AbdDXGmn (ORCPT + 4 others); Mon, 24 Apr 2017 02:42:43 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49629 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165574AbdDXGmk (ORCPT ); Mon, 24 Apr 2017 02:42:40 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW007K1IMWP820@mailout1.w1.samsung.com>; Mon, 24 Apr 2017 07:42:32 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170424064231eucas1p1c2c881634b285fbe80c1bc4b5c17c444~4QkeYwEWM1143411434eucas1p1P; Mon, 24 Apr 2017 06:42:31 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id DB.5F.04459.75E9DF85; Mon, 24 Apr 2017 07:42:31 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170424064231eucas1p2edd27880b5adc7c884e00db54c100cc2~4QkdxwmhZ2653226532eucas1p2M; Mon, 24 Apr 2017 06:42:31 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-c9-58fd9e578b69 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 95.8C.20206.07E9DF85; Mon, 24 Apr 2017 07:42:56 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00957IMPRV80@eusync3.samsung.com>; Mon, 24 Apr 2017 07:42:30 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 5/6] clk: samsung: exynos-clkout: Convert to the new clk_hw API Date: Mon, 24 Apr 2017 08:42:22 +0200 Message-id: <1493016143-21569-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsWy7djPc7rh8/5GGCzcJGuxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8AaxWWTkpqTWZZapG+XwJUx8f5upoJ/QhXLr7UzNzC2CnQxcnJICJhIPL1+ hhnCFpO4cG89WxcjF4eQwFJGiU0nbzBBOJ8ZJWbuOsIM07H02S92EFtIYBmjxNmpDhBFDUwS e78/AytiEzCU6HrbxQZiiwg4SHz+9JoRpIhZYCeTxISfK8ESwgIhEjMfH2YBsVkEVCUOnD7H CGLzCnhIvD+0lR1im5zEyWOTWUFsTgFPiV/7OsEGSQj8ZpNYu+kkkMMB5MhKbDoAdZ2LxJb+ nVC9whKvjm+BsmUkLk/uZoGw+xklmlq1IewZjBLn3vJC2NYSh49fBNvFLMAnMWnbdGaI8bwS HW1CECUeEsuWzWeEsB0lzuzYzwjx/BxGiaeTtzNPYJRZwMiwilEktbQ4Nz212EivODG3uDQv XS85P3cTIzCmT/87/nEH4/sTVocYBTgYlXh4I77/iRBiTSwrrsw9xCjBwawkwiuW+DdCiDcl sbIqtSg/vqg0J7X4EKM0B4uSOC/XqWsRQgLpiSWp2ampBalFMFkmDk6pBkbZM44q5fcWTN9+ 5euRL7+Pa794ktChsKHz0FQ1lsXx71f9t0/gClyyxDA5VLTe65WXLN+32a0ae3Rvuq/teHb4 sKyAeJyOYMpTVf7s0FovIe77QX5WshqTJ84/dX8Ba/a6rBuvzySL7T5as7VxuarCVH6r8/Z5 Gmdtr07KPXTvqqVUuqrTnRtKLMUZiYZazEXFiQBpnTkd5QIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsVy+t/xq7oF8/5GGMx/ZWSxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8Aa5WaTkZqYklqkkJqXnJ+SmZduqxQa4qZroaSQl5ibaqsUoesbEqSkUJaY UwrkGRmgAQfnAPdgJX27BLeMifd3MxX8E6pYfq2duYGxVaCLkZNDQsBEYumzX+wQtpjEhXvr 2boYuTiEBJYwSmydtIEJwmlikrh8eSErSBWbgKFE19suNhBbRMBB4vOn14wgRcwCu5kkLp58 zAiSEBYIkZi8uQ1sLIuAqsSB0+fA4rwCHhLvD22FWicncfLYZLChnAKeEr/2dYLVCAHVdFxY xDKBkXcBI8MqRpHU0uLc9NxiI73ixNzi0rx0veT83E2MwADfduznlh2MXe+CDzEKcDAq8fBG fP8TIcSaWFZcmXuIUYKDWUmEVyzxb4QQb0piZVVqUX58UWlOavEhRlOgoyYyS4km5wOjL68k 3tDE0NzS0MjYwsLcyEhJnHfqhyvhQgLpiSWp2ampBalFMH1MHJxSDYwNm42OLa9MO2W6RdG/ V06wx21tSOC7ZSeqEhcdvx4rWXptItsEN9dZC/jjbhWz3qnmX2t31KF/1qNG25Wm24pPL/wr e+ei+0mTpMRvXosWCW61a+bJdHr0oHCHvKtZalx71P7kudWZKhwTxLJuJ3ZtMsqSEOL1ZT36 wEyMO84hOT9a0Ta+TImlOCPRUIu5qDgRANgovoKGAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424064231eucas1p2edd27880b5adc7c884e00db54c100cc2 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170424064231eucas1p2edd27880b5adc7c884e00db54c100cc2 X-RootMTR: 20170424064231eucas1p2edd27880b5adc7c884e00db54c100cc2 References: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Clock providers should use the new struct clk_hw based API, so convert Exynos CLKOUT clock provider to the new approach. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- drivers/clk/samsung/clk-exynos-clkout.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index 6c6afb87b4ce..a21aea062bae 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -29,10 +29,9 @@ struct exynos_clkout { struct clk_gate gate; struct clk_mux mux; spinlock_t slock; - struct clk_onecell_data data; - struct clk *clk_table[EXYNOS_CLKOUT_NR_CLKS]; void __iomem *reg; u32 pmu_debug_save; + struct clk_hw_onecell_data data; }; static struct exynos_clkout *clkout; @@ -62,7 +61,9 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask) int ret; int i; - clkout = kzalloc(sizeof(*clkout), GFP_KERNEL); + clkout = kzalloc(sizeof(*clkout) + + sizeof(*clkout->data.hws) * EXYNOS_CLKOUT_NR_CLKS, + GFP_KERNEL); if (!clkout) return; @@ -100,17 +101,16 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask) clkout->mux.shift = EXYNOS_CLKOUT_MUX_SHIFT; clkout->mux.lock = &clkout->slock; - clkout->clk_table[0] = clk_register_composite(NULL, "clkout", + clkout->data.hws[0] = clk_hw_register_composite(NULL, "clkout", parent_names, parent_count, &clkout->mux.hw, &clk_mux_ops, NULL, NULL, &clkout->gate.hw, &clk_gate_ops, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT); - if (IS_ERR(clkout->clk_table[0])) + if (IS_ERR(clkout->data.hws[0])) goto err_unmap; - clkout->data.clks = clkout->clk_table; - clkout->data.clk_num = EXYNOS_CLKOUT_NR_CLKS; - ret = of_clk_add_provider(node, of_clk_src_onecell_get, &clkout->data); + clkout->data.num = EXYNOS_CLKOUT_NR_CLKS; + ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, &clkout->data); if (ret) goto err_clk_unreg; @@ -119,7 +119,7 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask) return; err_clk_unreg: - clk_unregister(clkout->clk_table[0]); + clk_hw_unregister(clkout->data.hws[0]); err_unmap: iounmap(clkout->reg); clks_put: From patchwork Mon Apr 24 06:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 98024 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1348114qgf; Sun, 23 Apr 2017 23:42:42 -0700 (PDT) X-Received: by 10.84.143.195 with SMTP id 61mr30935514plz.158.1493016162361; Sun, 23 Apr 2017 23:42:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si17792965pfb.23.2017.04.23.23.42.42; Sun, 23 Apr 2017 23:42:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165682AbdDXGml (ORCPT + 4 others); Mon, 24 Apr 2017 02:42:41 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:30392 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165683AbdDXGmh (ORCPT ); Mon, 24 Apr 2017 02:42:37 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW009FAIMWB020@mailout2.w1.samsung.com>; Mon, 24 Apr 2017 07:42:32 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170424064232eucas1p26255fc1094de8dc8ef38e10a39f45f65~4QkeqMN862654426544eucas1p2T; Mon, 24 Apr 2017 06:42:32 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 7C.5F.04459.75E9DF85; Mon, 24 Apr 2017 07:42:31 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170424064231eucas1p2dc993650881054dfea9aadb6abb0eb38~4QkeCA9ru1668516685eucas1p2R; Mon, 24 Apr 2017 06:42:31 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-cb-58fd9e570123 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2C.5A.17452.CDE9DF85; Mon, 24 Apr 2017 07:44:44 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00957IMPRV80@eusync3.samsung.com>; Mon, 24 Apr 2017 07:42:31 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 6/6] clk: samsung: s5pv210-audss: Convert to the new clk_hw API Date: Mon, 24 Apr 2017 08:42:23 +0200 Message-id: <1493016143-21569-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7djP87rh8/5GGEyfqW+xccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3eLiKVeLw2/aWS1+nOlmceD0eH+jld3jcl8vk8emVZ1s Hn1bVjF6fN4kF8AaxWWTkpqTWZZapG+XwJUx88gOxoIDOhUdn+MbGGeqdjFyckgImEhsPTSJ FcIWk7hwbz1bFyMXh5DAUkaJ/o3vGSGcz4wSLx/MY4Pp+LVtHjOILSSwjFHixq4IiKIGJom9 b94zgSTYBAwlut52gTWICDhIfP70GmwSs8BOJokJP1eCJYQFQiSOXdjKAmKzCKhKLJ60EewO XgEPiS/bfrFDbJOTOHlsMlicU8BT4te+TrBBEgL/2SSaG1YBORxAjqzEpgPMEPUuEg9fXoa6 VFji1fEtUHNkJDo7DjJB2P2MEk2t2hD2DEaJc295IWxricPHL4LtYhbgk5i0bTozxHheiY42 IYgSD4lLH0DGgIQdJXY0F0H8PodRYt2np4wTGGUWMDKsYhRJLS3OTU8tNtIrTswtLs1L10vO z93ECIzn0/+Of9zB+P6E1SFGAQ5GJR7eiO9/IoRYE8uKK3MPMUpwMCuJ8Iol/o0Q4k1JrKxK LcqPLyrNSS0+xCjNwaIkzst16lqEkEB6YklqdmpqQWoRTJaJg1OqgVH3pfy2zpVL1yS7CwZe qpUTmnp5CduZV1GGgZbt9j/6v507/aFpbhLLff11U8qEHTTvpVWm6XyTvNjfUFmetePhrqo5 O68mvzAufGJffbJo5Z1T8vkRvObFCi2lep/vixh2bNsxs6zsqGLImi7rB9M9H3uEWuY8OcMa XfMiYVrGmtgTSnpzDZRYijMSDbWYi4oTAd0wianjAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsVy+t/xq7p35v2NMNh6R9Zi44z1rBbXvzxn tTh/fgO7xceee6wWM87vY7JYe+Quu8XFU64Wh9+0s1r8ONPN4sDp8f5GK7vH5b5eJo9NqzrZ PPq2rGL0+LxJLoA1ys0mIzUxJbVIITUvOT8lMy/dVik0xE3XQkkhLzE31VYpQtc3JEhJoSwx pxTIMzJAAw7OAe7BSvp2CW4ZM4/sYCw4oFPR8Tm+gXGmahcjJ4eEgInEr23zmCFsMYkL99az dTFycQgJLGGU6P57mwXCaWKSmH7nPAtIFZuAoUTX2y42EFtEwEHi86fXjCBFzAK7mSQunnzM CJIQFgiR+LG4kwnEZhFQlVg8aSMriM0r4CHxZdsvdoh1chInj00Gi3MKeEr82tcJ1isEVNNx YRHLBEbeBYwMqxhFUkuLc9Nziw31ihNzi0vz0vWS83M3MQLDe9uxn5t3MF7aGHyIUYCDUYmH d8PPPxFCrIllxZW5hxglOJiVRHjFEv9GCPGmJFZWpRblxxeV5qQWH2I0BTpqIrOUaHI+MPby SuINTQzNLQ2NjC0szI2MlMR5Sz5cCRcSSE8sSc1OTS1ILYLpY+LglGpgbNESvR9hnHg1bk3p yU/T/+nsNuIMq9pQIXuM8f71yPQ9NconXLsDGf88PNwlvN4kVnvmiR2qUyN/L2DS3fnnJMvM Px8/hnYkF0+t3u/v+aqu8b3itp/N+rdu6IpO6lPN6qhldPK7/fSszfq/z9uYTQJSP+Qpnrpu dnSif1SMWM2u0m99DhznlFiKMxINtZiLihMB4ngWuYUCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424064231eucas1p2dc993650881054dfea9aadb6abb0eb38 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170424064231eucas1p2dc993650881054dfea9aadb6abb0eb38 X-RootMTR: 20170424064231eucas1p2dc993650881054dfea9aadb6abb0eb38 References: <1493016143-21569-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Clock providers should use the new struct clk_hw based API, so convert Samsung S5PV210 Audio Subsystem clock provider to the new approach. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-s5pv210-audss.c | 50 +++++++++++++++++---------------- 1 file changed, 26 insertions(+), 24 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/clk/samsung/clk-s5pv210-audss.c b/drivers/clk/samsung/clk-s5pv210-audss.c index c66ed2d1450e..e12f5b81834f 100644 --- a/drivers/clk/samsung/clk-s5pv210-audss.c +++ b/drivers/clk/samsung/clk-s5pv210-audss.c @@ -24,9 +24,8 @@ #include static DEFINE_SPINLOCK(lock); -static struct clk **clk_table; static void __iomem *reg_base; -static struct clk_onecell_data clk_data; +static struct clk_hw_onecell_data *clk_data; #define ASS_CLK_SRC 0x0 #define ASS_CLK_DIV 0x4 @@ -71,6 +70,7 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev) const char *mout_audss_p[2]; const char *mout_i2s_p[3]; const char *hclk_p; + struct clk_hw **clk_table; struct clk *hclk, *pll_ref, *pll_in, *cdclk, *sclk_audio; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -80,14 +80,16 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev) return PTR_ERR(reg_base); } - clk_table = devm_kzalloc(&pdev->dev, - sizeof(struct clk *) * AUDSS_MAX_CLKS, + clk_data = devm_kzalloc(&pdev->dev, + sizeof(*clk_data) + + sizeof(*clk_data->hws) * AUDSS_MAX_CLKS, GFP_KERNEL); - if (!clk_table) + + if (!clk_data) return -ENOMEM; - clk_data.clks = clk_table; - clk_data.clk_num = AUDSS_MAX_CLKS; + clk_data->num = AUDSS_MAX_CLKS; + clk_table = clk_data->hws; hclk = devm_clk_get(&pdev->dev, "hclk"); if (IS_ERR(hclk)) { @@ -116,7 +118,7 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev) else mout_audss_p[0] = "xxti"; mout_audss_p[1] = __clk_get_name(pll_in); - clk_table[CLK_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss", + clk_table[CLK_MOUT_AUDSS] = clk_hw_register_mux(NULL, "mout_audss", mout_audss_p, ARRAY_SIZE(mout_audss_p), CLK_SET_RATE_NO_REPARENT, reg_base + ASS_CLK_SRC, 0, 1, 0, &lock); @@ -127,44 +129,44 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev) else mout_i2s_p[1] = "iiscdclk0"; mout_i2s_p[2] = __clk_get_name(sclk_audio); - clk_table[CLK_MOUT_I2S_A] = clk_register_mux(NULL, "mout_i2s_audss", + clk_table[CLK_MOUT_I2S_A] = clk_hw_register_mux(NULL, "mout_i2s_audss", mout_i2s_p, ARRAY_SIZE(mout_i2s_p), CLK_SET_RATE_NO_REPARENT, reg_base + ASS_CLK_SRC, 2, 2, 0, &lock); - clk_table[CLK_DOUT_AUD_BUS] = clk_register_divider(NULL, + clk_table[CLK_DOUT_AUD_BUS] = clk_hw_register_divider(NULL, "dout_aud_bus", "mout_audss", 0, reg_base + ASS_CLK_DIV, 0, 4, 0, &lock); - clk_table[CLK_DOUT_I2S_A] = clk_register_divider(NULL, "dout_i2s_audss", - "mout_i2s_audss", 0, reg_base + ASS_CLK_DIV, - 4, 4, 0, &lock); + clk_table[CLK_DOUT_I2S_A] = clk_hw_register_divider(NULL, + "dout_i2s_audss", "mout_i2s_audss", 0, + reg_base + ASS_CLK_DIV, 4, 4, 0, &lock); - clk_table[CLK_I2S] = clk_register_gate(NULL, "i2s_audss", + clk_table[CLK_I2S] = clk_hw_register_gate(NULL, "i2s_audss", "dout_i2s_audss", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 6, 0, &lock); hclk_p = __clk_get_name(hclk); - clk_table[CLK_HCLK_I2S] = clk_register_gate(NULL, "hclk_i2s_audss", + clk_table[CLK_HCLK_I2S] = clk_hw_register_gate(NULL, "hclk_i2s_audss", hclk_p, CLK_IGNORE_UNUSED, reg_base + ASS_CLK_GATE, 5, 0, &lock); - clk_table[CLK_HCLK_UART] = clk_register_gate(NULL, "hclk_uart_audss", + clk_table[CLK_HCLK_UART] = clk_hw_register_gate(NULL, "hclk_uart_audss", hclk_p, CLK_IGNORE_UNUSED, reg_base + ASS_CLK_GATE, 4, 0, &lock); - clk_table[CLK_HCLK_HWA] = clk_register_gate(NULL, "hclk_hwa_audss", + clk_table[CLK_HCLK_HWA] = clk_hw_register_gate(NULL, "hclk_hwa_audss", hclk_p, CLK_IGNORE_UNUSED, reg_base + ASS_CLK_GATE, 3, 0, &lock); - clk_table[CLK_HCLK_DMA] = clk_register_gate(NULL, "hclk_dma_audss", + clk_table[CLK_HCLK_DMA] = clk_hw_register_gate(NULL, "hclk_dma_audss", hclk_p, CLK_IGNORE_UNUSED, reg_base + ASS_CLK_GATE, 2, 0, &lock); - clk_table[CLK_HCLK_BUF] = clk_register_gate(NULL, "hclk_buf_audss", + clk_table[CLK_HCLK_BUF] = clk_hw_register_gate(NULL, "hclk_buf_audss", hclk_p, CLK_IGNORE_UNUSED, reg_base + ASS_CLK_GATE, 1, 0, &lock); - clk_table[CLK_HCLK_RP] = clk_register_gate(NULL, "hclk_rp_audss", + clk_table[CLK_HCLK_RP] = clk_hw_register_gate(NULL, "hclk_rp_audss", hclk_p, CLK_IGNORE_UNUSED, reg_base + ASS_CLK_GATE, 0, 0, &lock); - for (i = 0; i < clk_data.clk_num; i++) { + for (i = 0; i < clk_data->num; i++) { if (IS_ERR(clk_table[i])) { dev_err(&pdev->dev, "failed to register clock %d\n", i); ret = PTR_ERR(clk_table[i]); @@ -172,7 +174,7 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev) } } - ret = of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get, + ret = of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_onecell_get, &clk_data); if (ret) { dev_err(&pdev->dev, "failed to add clock provider\n"); @@ -186,9 +188,9 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev) return 0; unregister: - for (i = 0; i < clk_data.clk_num; i++) { + for (i = 0; i < clk_data->num; i++) { if (!IS_ERR(clk_table[i])) - clk_unregister(clk_table[i]); + clk_hw_unregister(clk_table[i]); } return ret;