From patchwork Fri Nov 25 09:39:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 84087 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp38485obn; Fri, 25 Nov 2016 01:40:42 -0800 (PST) X-Received: by 10.84.217.216 with SMTP id d24mr15519137plj.10.1480066842592; Fri, 25 Nov 2016 01:40:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si15250443plb.25.2016.11.25.01.40.42; Fri, 25 Nov 2016 01:40:42 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754020AbcKYJkd (ORCPT + 4 others); Fri, 25 Nov 2016 04:40:33 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:60981 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753144AbcKYJkQ (ORCPT ); Fri, 25 Nov 2016 04:40:16 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OH6023PQYUXEJ80@mailout1.samsung.com>; Fri, 25 Nov 2016 18:40:12 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-7f-583806fc48ee Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 9A.82.16530.CF608385; Fri, 25 Nov 2016 18:40:12 +0900 (KST) Received: from AMDC2765.digital.local ([106.116.147.25]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OH6001QYYUSVM40@mmp1.samsung.com>; Fri, 25 Nov 2016 18:40:12 +0900 (KST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Chanwoo Choi Subject: [PATCH] clk/samsung: exynos-audss: Replace syscore PM with platform device PM Date: Fri, 25 Nov 2016 10:39:54 +0100 Message-id: <1480066794-18713-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jAd0/bBYRBjfvqFhsnLGe1eL6l+es FufPb2C3+Nhzj9Vixvl9TBZrj9xltzj8pp3Vgd1j06pONo++LasYPT5vkgtgjnKzyUhNTEkt UkjNS85PycxLt1UKDXHTtVBSyEvMTbVVitD1DQlSUihLzCkF8owM0ICDc4B7sJK+XYJbxq1v z9kK3ghXrJ/zl7GB8bhAFyMnh4SAicS8L/2sELaYxIV769lAbCGBpYwS517KdzFyAdm/GCVO v9vIApJgEzCU6HrbBVYkIuAg8fnTa0aQImaB54wS73f3gxUJC0RIvNv0mh3EZhFQlWi5+oYZ xOYV8JB4ceo3M8Q2OYmTxyazTmDkXsDIsIpRIrUguaA4KT3XKC+1XK84Mbe4NC9dLzk/dxMj OCCfSe9gPLzL/RCjAAejEg8vwynzCCHWxLLiytxDjBIczEoivI9YLSKEeFMSK6tSi/Lji0pz UosPMZoCHTCRWUo0OR8YLXkl8YYm5ibmxgYW5paWJkZK4ryNs5+FCwmkJ5akZqemFqQWwfQx cXBKNTBKrWS66LCSR0/54O0jZg4SL4ufNU5Zruye6DnxbsT36uvqK7Y2x91lvOw9PcPgsfXt lH5mCzeziVlnXzoksG/LXrzUN+dVfLLPodtOFd+teZqLldnqGytDOT/1bq7oK439qNZe0Cdz 3P1UbVJy3FXd/E59tT8eHAnSEsq9avUZH1d+vKXOp8RSnJFoqMVcVJwIAE/aqVNeAgAA X-MTR: 20000000000000000@CPGS Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Exynos AUDSS clock driver has beem already converted to platform driver, so remove the dependency on the syscore ops - the last remaining non-platform driver feature. Platform device's system sleep PM provides all needed infrastructure for replacing syscore-based PM, so do it now. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-exynos-audss.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 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: Javier Martinez Canillas Reviewed-by: Chanwoo Choi diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c index 17e68a724945..cb7df358a27d 100644 --- a/drivers/clk/samsung/clk-exynos-audss.c +++ b/drivers/clk/samsung/clk-exynos-audss.c @@ -44,7 +44,7 @@ { ASS_CLK_GATE, 0 }, }; -static int exynos_audss_clk_suspend(void) +static int exynos_audss_clk_suspend(struct device *dev) { int i; @@ -54,18 +54,15 @@ static int exynos_audss_clk_suspend(void) return 0; } -static void exynos_audss_clk_resume(void) +static int exynos_audss_clk_resume(struct device *dev) { int i; for (i = 0; i < ARRAY_SIZE(reg_save); i++) writel(reg_save[i][1], reg_base + reg_save[i][0]); -} -static struct syscore_ops exynos_audss_clk_syscore_ops = { - .suspend = exynos_audss_clk_suspend, - .resume = exynos_audss_clk_resume, -}; + return 0; +} #endif /* CONFIG_PM_SLEEP */ struct exynos_audss_clk_drvdata { @@ -251,9 +248,6 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) goto unregister; } -#ifdef CONFIG_PM_SLEEP - register_syscore_ops(&exynos_audss_clk_syscore_ops); -#endif return 0; unregister: @@ -267,10 +261,6 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) static int exynos_audss_clk_remove(struct platform_device *pdev) { -#ifdef CONFIG_PM_SLEEP - unregister_syscore_ops(&exynos_audss_clk_syscore_ops); -#endif - of_clk_del_provider(pdev->dev.of_node); exynos_audss_clk_teardown(); @@ -281,10 +271,16 @@ static int exynos_audss_clk_remove(struct platform_device *pdev) return 0; } +static const struct dev_pm_ops exynos_audss_clk_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(exynos_audss_clk_suspend, + exynos_audss_clk_resume) +}; + static struct platform_driver exynos_audss_clk_driver = { .driver = { .name = "exynos-audss-clk", .of_match_table = exynos_audss_clk_of_match, + .pm = &exynos_audss_clk_pm_ops, }, .probe = exynos_audss_clk_probe, .remove = exynos_audss_clk_remove,