From patchwork Wed Aug 29 15:50:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580605 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 C36DD69B8 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4A5F2B608 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2D3E2B683; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF7602B681 for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729203AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55854 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729250AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155103euoutp01420b005c814aa95052f361d40adbcfa7~PZb2mOoWf0241702417euoutp01T; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155103euoutp01420b005c814aa95052f361d40adbcfa7~PZb2mOoWf0241702417euoutp01T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557863; bh=VabrHE1sLkSCwa3GnzCCPplcOEzJjGW7kjRp3BZkJBw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=B/0KZwWMCzRjdsZJzasWYNIYJHhSui0On20yBCMHlCqzS9KiNMgVZKUj2QSrHjOIY 8s8YWSuIU3q5o14jn1jDjAtTv9NfEuNUOT/ufFIFyhFVwLQNK0N9DAzriW+rP5mGI9 YeFEIg/BrZJJpZf/03ZJ1OlkoSUf9kQ3DnFEQ8X0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155102eucas1p1790d3e0f1a7d38b0256c28fefb2abf0d~PZb11wdNx0107501075eucas1p1z; Wed, 29 Aug 2018 15:51:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id D9.DF.04441.5E0C68B5; Wed, 29 Aug 2018 16:51:02 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88~PZb0-06x_1893718937eucas1p2n; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-e2-5b86c0e55c97 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B2.37.04284.5E0C68B5; Wed, 29 Aug 2018 16:51:01 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PE800FCUC0UPL60@eusync4.samsung.com>; Wed, 29 Aug 2018 16:51:01 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 07/10] clk: samsung: exynos5250: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:43 +0200 Message-id: <20180829155046.29359-8-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180829155046.29359-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsWy7djP87rPDrRFG7wItdg4Yz2rxfUvz1kt zp/fwG7xseceq8WM8/uYLNYeuctu0f70JbMDu8emVZ1sHn1bVjF6fN4kF8AcxWWTkpqTWZZa pG+XwJVxelcfY8F94Yq/rXINjDcEuhg5OSQETCTmXnvC3MXIxSEksIJR4nfXJXYI5zOjxLkF 85hgqlasWAVmCwksY5T41sgFUdTAJLH91QQWkASbgKFE19suNhBbRMBB4vOn14wgRcwCjxkl tp78ygySEBZIlPh8fycjiM0ioCoxc0MXmM0rYCvR8HUZO8Q2eYnVGw6A1XMK2Em8ON7LChH/ yiqx4g4/hO0icfv4Dah6YYlXx7dA2TISnR0HmUAWSwg0M0q0z5jFDuH0AF0xZwcbRJW1xOHj F8GmMgvwSUzaNh1oGwdQnFeio00IosRDou/7SiaINycySjx4tIRtAqPkAkaGVYziqaXFuemp xYZ5qeV6xYm5xaV56XrJ+bmbGIGxdvrf8U87GL9eSjrEKMDBqMTDqzG7LVqINbGsuDL3EKME B7OSCO/ehUAh3pTEyqrUovz4otKc1OJDjNIcLErivHxaadFCAumJJanZqakFqUUwWSYOTqkG xgOMOQIW7SmhZdxyNxaHGP4O2vYsaHV4QLS3lb679cvES2vZJ3nnaC4WvTdtxv+Fm/aqdDVK Hd2fK1yw5OMMDWEFro+1b5n1LXP+l234E1wiOo074/w7T/fZC6R5FquKV2t+vCbG9OBrh8Gp XVd3rwvsnvBfJL+Q9Y79vmdLre492bhvQ+a1SUosxRmJhlrMRcWJAAJDAaCxAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t/xa7pPD7RFGyx5ImWxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4/SuPsaC+8IVf1vlGhhvCHQxcnJICJhIrFixiqmLkYtDSGAJo8S1vp0sEE4Tk8TD JQ/YQarYBAwlut52sYHYIgIOEp8/vWYEKWIWeMwocW7xBlaQhLBAosTn+zsZQWwWAVWJmRu6 wGxeAVuJhq/L2CHWyUus3nCAGcTmFLCTeHG8F6xXCKhm4Z3vjBMYeRYwMqxiFEktLc5Nzy02 1CtOzC0uzUvXS87P3cQIDJRtx35u3sF4aWPwIUYBDkYlHt4LM9qihVgTy4orcw8xSnAwK4nw 7l0IFOJNSaysSi3Kjy8qzUktPsQozcGiJM573qAySkggPbEkNTs1tSC1CCbLxMEp1cCYaRRW megofL3fJNLvkaJG7PTKfbvWtctFLNQ+VbomX5DZoKWsfH3c12irB77y3TIftDk1pjqwPFFT N73AJmPLZbhu48uSaQdONOi9+7nhjpDKmVrTF8e5hO0N35n07g7gUxXia/oppHLWe/YXYXWW KVdXScpOiHlhrx/3lvPh24Vxn3b/v6jEUpyRaKjFXFScCACpq3/gEAIAAA== X-CMS-MailID: 20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88 References: <20180829155046.29359-1-m.szyprowski@samsung.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace common suspend/resume handling code by generic helper. No functional change. Signed-off-by: Marek Szyprowski Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- drivers/clk/samsung/clk-exynos5250.c | 42 ++-------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 347fd80c351b..f14139bcb0c1 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c @@ -14,7 +14,6 @@ #include #include #include -#include #include "clk.h" #include "clk-cpu.h" @@ -111,9 +110,6 @@ enum exynos5250_plls { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *exynos5250_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -172,41 +168,6 @@ static const unsigned long exynos5250_clk_regs[] __initconst = { GATE_IP_ISP1, }; -static int exynos5250_clk_suspend(void) -{ - samsung_clk_save(reg_base, exynos5250_save, - ARRAY_SIZE(exynos5250_clk_regs)); - - return 0; -} - -static void exynos5250_clk_resume(void) -{ - samsung_clk_restore(reg_base, exynos5250_save, - ARRAY_SIZE(exynos5250_clk_regs)); -} - -static struct syscore_ops exynos5250_clk_syscore_ops = { - .suspend = exynos5250_clk_suspend, - .resume = exynos5250_clk_resume, -}; - -static void __init exynos5250_clk_sleep_init(void) -{ - exynos5250_save = samsung_clk_alloc_reg_dump(exynos5250_clk_regs, - ARRAY_SIZE(exynos5250_clk_regs)); - if (!exynos5250_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&exynos5250_clk_syscore_ops); -} -#else -static void __init exynos5250_clk_sleep_init(void) {} -#endif - /* list of all parent clock list */ PNAME(mout_apll_p) = { "fin_pll", "fout_apll", }; PNAME(mout_cpu_p) = { "mout_apll", "mout_mpll", }; @@ -882,7 +843,8 @@ static void __init exynos5250_clk_init(struct device_node *np) PWR_CTRL2_CORE2_UP_RATIO | PWR_CTRL2_CORE1_UP_RATIO); __raw_writel(tmp, reg_base + PWR_CTRL2); - exynos5250_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, exynos5250_clk_regs, + ARRAY_SIZE(exynos5250_clk_regs)); exynos5_subcmus_init(ctx, 1, &exynos5250_disp_subcmu); samsung_clk_of_add_provider(np, ctx);