From patchwork Wed Aug 29 15:50:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580567 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 14743920 for ; Wed, 29 Aug 2018 15:51:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04EE02B62E for ; Wed, 29 Aug 2018 15:51:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED9692B5C1; Wed, 29 Aug 2018 15:51:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EBD82B67B for ; Wed, 29 Aug 2018 15:51:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbeH2Tsf (ORCPT ); Wed, 29 Aug 2018 15:48:35 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55840 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729200AbeH2Tsf (ORCPT ); Wed, 29 Aug 2018 15:48:35 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155100euoutp0109c879619b7fe997de027f5edb832f5f~PZb0SYO2N0242602426euoutp01Y; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155100euoutp0109c879619b7fe997de027f5edb832f5f~PZb0SYO2N0242602426euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557860; bh=ML3DDn/6E1rXBqmKFRR0Ra895+pK63YB+7EMDu/KgEQ=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=cSqdG8thxTqskHM7LTZ7Pb/GYd6whLOyy6VTNUrcpbozrbVeDpZMpH0nkn3jeaCQa 9s1Z3UGJuQGHMCDoResJMfdz08V2DBZHs83CgpRqYSbAPWx1L2bhWhUkVU9zAb3n7I /LUwi2fwRwoMdok9D5To8fYdW2w3D6NLuhryW60g= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155100eucas1p1fc05ee4a7ff6a0c5b46b426d45a7ed51~PZbz0yI0d0107501075eucas1p1x; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id EC.FA.04806.3E0C68B5; Wed, 29 Aug 2018 16:50:59 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155059eucas1p28a20924521edaa4c9bd3d9683d0f2d0d~PZbzArxTu2602326023eucas1p2Z; Wed, 29 Aug 2018 15:50:59 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-36-5b86c0e3cb2c Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A0.37.04284.2E0C68B5; Wed, 29 Aug 2018 16:50:59 +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:50:58 +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 01/10] clk: samsung: Remove excessive include Date: Wed, 29 Aug 2018 17:50:37 +0200 Message-id: <20180829155046.29359-2-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+NgFlrIIsWRmVeSWpSXmKPExsWy7djPc7qPD7RFGzx4ZGixccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr48GLhewFVzkrfh68xd7AuJeji5GTQ0LAROL89ka2LkYuDiGBFYwSyxoeMkE4nxkl eu/dZYOpunX8MlRiGaPEjs7H7BBOA5PExbbVLCBVbAKGEl1vu8A6RAQcJD5/es0IUsQs8JhR YuvJr8wgCWEBW4lJN56C2SwCqhLHvrxmArF5geKzrx5ihVgnL7F6wwGwGk4BO4kXx3tZQQZJ CHxllTiwvY8doshF4v37TYwQtrDEq+NboOIyEp0dB5kgGpoZJdpnzGKHcHqAzpizA+oja4nD xy+CrWMW4JOYtG060DoOoDivREebEITpIXF7VSLEmxMZJW5/O8AygVFyASPDKkbx1NLi3PTU YuO81HK94sTc4tK8dL3k/NxNjMCIO/3v+NcdjPv+JB1iFOBgVOLhvTCjLVqINbGsuDL3EKME B7OSCO/ehUAh3pTEyqrUovz4otKc1OJDjNIcLErivHxaadFCAumJJanZqakFqUUwWSYOTqkG xh2p/XplbX1P/in/ckg7e57pqY4Bs0T5lg+1R7+KWmd6aiostyxu75RVqfvW+TfNeG+ScvuB 9bn2nRXJ06vtI+bPUg73aV/9dZWbp6fZnispu/84vlXdo2hXG7LUzuGS4oajF23PFD3W0Hju WG6QJDfjqGCHjIJ+1l3x494n1B0sH+jO1EtUYinOSDTUYi4qTgQAJVNHebQCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xa7qPD7RFG8yfxGixccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr48GLhewFVzkrfh68xd7AuJeji5GTQ0LAROLW8ctMXYxcHEICSxglrn25wAzhNDFJ ND37zApSxSZgKNH1tosNxBYRcJD4/Ok1I0gRs8BjRolzizeAFQkL2EpMuvGUGcRmEVCVOPbl NROIzQsUn331ECvEOnmJ1RsOgNVwCthJvDjeCxYXAqpZeOc74wRGngWMDKsYRVJLi3PTc4sN 9YoTc4tL89L1kvNzNzECQ2XbsZ+bdzBe2hh8iFGAg1GJh/fCjLZoIdbEsuLK3EOMEhzMSiK8 excChXhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgskycXBKNTDOtrjz PSPh2ErvgwmFz6e2+9XWBUStfsI39eKafId95q61K1ZV9vMHnpzoqHbgQvvKdfe4bjAfsPu8 4rNA9sxte9T0+KSkIkMvP43JyXTtMX3SrnW7X6m6+dnnOUwv2b/NnhWutKPoS8130WvRly22 xZupFBbV2T1/yWqXuPLzTc9XFlpxKSeUWIozEg21mIuKEwEbzhXmEQIAAA== X-CMS-MailID: 20180829155059eucas1p28a20924521edaa4c9bd3d9683d0f2d0d X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155059eucas1p28a20924521edaa4c9bd3d9683d0f2d0d 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 Exynos Audio SubSystem and Exynos3250 clock drivers don't use any syscore function, so don't include linux/syscore_ops.h in their code. Signed-off-by: Marek Szyprowski Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- drivers/clk/samsung/clk-exynos-audss.c | 1 - drivers/clk/samsung/clk-exynos3250.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c index f659c5cbf1d5..8f8a0f9fc842 100644 --- a/drivers/clk/samsung/clk-exynos-audss.c +++ b/drivers/clk/samsung/clk-exynos-audss.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/clk/samsung/clk-exynos3250.c b/drivers/clk/samsung/clk-exynos3250.c index 27c9d23657b3..0e9a41a4cac8 100644 --- a/drivers/clk/samsung/clk-exynos3250.c +++ b/drivers/clk/samsung/clk-exynos3250.c @@ -12,7 +12,6 @@ #include #include #include -#include #include From patchwork Wed Aug 29 15:50:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580577 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 8E22D180E for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DB0D2B664 for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79D492B67B; Wed, 29 Aug 2018 15:51:05 +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 28CDB2B657 for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729215AbeH2Tsh (ORCPT ); Wed, 29 Aug 2018 15:48:37 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55844 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729206AbeH2Tsg (ORCPT ); Wed, 29 Aug 2018 15:48:36 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155101euoutp01f69a95e6ce8aa883421a83d4021b1c5d~PZb0oeaUO0370903709euoutp01p; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155101euoutp01f69a95e6ce8aa883421a83d4021b1c5d~PZb0oeaUO0370903709euoutp01p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557861; bh=ak4RGJp1vIijhetnQYtg6ixxodfuEf7895yWFHLuAiM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=JN3qvX7tAPxf55UPb4DVODyQRo7sL7vTJFveeNSoV42+PiL4s68HWvaqs3I2y0YSq 847PP1st/IOGtpFtpWJLLiCixrCSmVXTS75VQ9LCp4ms7tXssgRtANHtncDzRRHSgc zqbM+i9BNsny1ofazG4EoY2GFCwLy42OGHX9oD8I= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155100eucas1p1ea5281f381827fc0859fcc5cb79ed8d9~PZb0EkBkW0665006650eucas1p1Z; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id C8.DF.04441.4E0C68B5; Wed, 29 Aug 2018 16:51:00 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155059eucas1p26a0ea66a0fc96c73cdd60648b82bd23e~PZbzOm0O62215422154eucas1p2s; Wed, 29 Aug 2018 15:50:59 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-df-5b86c0e46241 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 41.37.04284.3E0C68B5; Wed, 29 Aug 2018 16:50:59 +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:50:59 +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 02/10] clk: samsung: s3c2410: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:38 +0200 Message-id: <20180829155046.29359-3-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+NgFprHIsWRmVeSWpSXmKPExsWy7djP87pPDrRFG7T+4LDYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV0bJzEVPBLKGKP1+/MDcwzuHvYuTgkBAwkTjZydjFyMUhJLCCUWL+753sEM5nRokv Sz4DZTjBijbf+84CYgsJLGOU2DdFBaKogUni86y/YAk2AUO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mpBYfYpTmYFES5z1vUBklJJCeWJKanZpakFoEk2Xi4JRqYNQq Xvy00U9iikhA6DvOsocrzFoWH5S8x3Y75FqrutYv0Z0lj5+uLnQ6nbzphn/Rew72EwrTI1/t 6n2kd3RVS9f8nQvd/x+6p8Mh9mpvGdP5kFmuPoZLdnm1PnWV/a4qorl2frm6ITt3xhmHbr/L VwQLjy9a3uyzO09pRU1JhMmrr36WGjGLu5VYijMSDbWYi4oTAbksd0gQAgAA X-CMS-MailID: 20180829155059eucas1p26a0ea66a0fc96c73cdd60648b82bd23e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155059eucas1p26a0ea66a0fc96c73cdd60648b82bd23e 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-s3c2410.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2410.c b/drivers/clk/samsung/clk-s3c2410.c index a9c887475054..8cb868f06257 100644 --- a/drivers/clk/samsung/clk-s3c2410.c +++ b/drivers/clk/samsung/clk-s3c2410.c @@ -11,7 +11,6 @@ #include #include #include -#include #include @@ -40,9 +39,6 @@ enum s3c2410_plls { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c2410_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -57,42 +53,6 @@ static unsigned long s3c2410_clk_regs[] __initdata = { CAMDIVN, }; -static int s3c2410_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c2410_save, - ARRAY_SIZE(s3c2410_clk_regs)); - - return 0; -} - -static void s3c2410_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c2410_save, - ARRAY_SIZE(s3c2410_clk_regs)); -} - -static struct syscore_ops s3c2410_clk_syscore_ops = { - .suspend = s3c2410_clk_suspend, - .resume = s3c2410_clk_resume, -}; - -static void __init s3c2410_clk_sleep_init(void) -{ - s3c2410_save = samsung_clk_alloc_reg_dump(s3c2410_clk_regs, - ARRAY_SIZE(s3c2410_clk_regs)); - if (!s3c2410_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&s3c2410_clk_syscore_ops); - return; -} -#else -static void __init s3c2410_clk_sleep_init(void) {} -#endif - PNAME(fclk_p) = { "mpll", "div_slow" }; static struct samsung_mux_clock s3c2410_common_muxes[] __initdata = { @@ -461,7 +421,8 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, ARRAY_SIZE(s3c244x_common_aliases)); } - s3c2410_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s3c2410_clk_regs, + ARRAY_SIZE(s3c2410_clk_regs)); samsung_clk_of_add_provider(np, ctx); } From patchwork Wed Aug 29 15:50:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580587 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 6D38F1822 for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A9C42B6AA for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EFBE2B5EE; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D16992B5EE for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729251AbeH2Tsh (ORCPT ); Wed, 29 Aug 2018 15:48:37 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:35923 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729200AbeH2Tsg (ORCPT ); Wed, 29 Aug 2018 15:48:36 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155101euoutp02b74e68714d39aa42c4f31b14b244d016~PZb08lD3P2539025390euoutp02E; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180829155101euoutp02b74e68714d39aa42c4f31b14b244d016~PZb08lD3P2539025390euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557861; bh=u7ouEIbdPA0jpQSFbzOINyEQmSN+NmNxxnLK0fTpLfA=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=SqFmpG6zonWjgm8pBwTfK08+HtR4nYljKbnW/Ax/eAqxkkHPaWb2ZdPV2gEiEIAoT we87ZTwRZSvniV0pmFG0FgoEIS8cBs/SmhCt5fSqmRByi4dD+PUbdsFaKxfeyqwrlO O3eHTEVBF80RiTPmuDMjeRvvufbhXwZXgnrNj/SU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155100eucas1p2cbfdd3286626255a3eb61c114e1b6701~PZb0Smy0Q1893618936eucas1p2S; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 7D.FA.04806.4E0C68B5; Wed, 29 Aug 2018 16:51:00 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155059eucas1p16fecde00348e0a2e6707aaf2a76320be~PZbzf3eYq1660516605eucas1p1A; Wed, 29 Aug 2018 15:50:59 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-38-5b86c0e40c83 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 75.76.04128.3E0C68B5; Wed, 29 Aug 2018 16:50:59 +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:50:59 +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 03/10] clk: samsung: s3c2412: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:39 +0200 Message-id: <20180829155046.29359-4-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+NgFlrEIsWRmVeSWpSXmKPExsWy7djPc7pPDrRFG8ztFbXYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVsXr9JeaC7UIVh671M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uDQvXS85P3cTIzBUth37uWUHY9e74EOMAhyMSjy8BovaooVYE8uKK3MPMUpwMCuJ 8O5dCBTiTUmsrEotyo8vKs1JLT7EKM3BoiTOe96gMkpIID2xJDU7NbUgtQgmy8TBKdXAeKnr 3h17iYtxz1+kf9ybtN14/rpHN3ao/aoI/x70SniT4IU97HW1b42FOvNPVPSujA4Kva78u67U clv07u/v8qxjW19WZX3frRutPSPR1uPJhlMcj39deui3uXv+VoO2nNo9oY332XoLS2RqH5eK yNzaJNi7ry/j/DYpmW9Tu05G7wt5/vs/mxJLcUaioRZzUXEiAHQwzvYRAgAA X-CMS-MailID: 20180829155059eucas1p16fecde00348e0a2e6707aaf2a76320be X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155059eucas1p16fecde00348e0a2e6707aaf2a76320be 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-s3c2412.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2412.c b/drivers/clk/samsung/clk-s3c2412.c index 6bc94d3aff78..dd1159050a5a 100644 --- a/drivers/clk/samsung/clk-s3c2412.c +++ b/drivers/clk/samsung/clk-s3c2412.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -29,9 +28,6 @@ static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c2412_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -45,42 +41,6 @@ static unsigned long s3c2412_clk_regs[] __initdata = { CLKSRC, }; -static int s3c2412_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c2412_save, - ARRAY_SIZE(s3c2412_clk_regs)); - - return 0; -} - -static void s3c2412_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c2412_save, - ARRAY_SIZE(s3c2412_clk_regs)); -} - -static struct syscore_ops s3c2412_clk_syscore_ops = { - .suspend = s3c2412_clk_suspend, - .resume = s3c2412_clk_resume, -}; - -static void __init s3c2412_clk_sleep_init(void) -{ - s3c2412_save = samsung_clk_alloc_reg_dump(s3c2412_clk_regs, - ARRAY_SIZE(s3c2412_clk_regs)); - if (!s3c2412_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&s3c2412_clk_syscore_ops); - return; -} -#else -static void __init s3c2412_clk_sleep_init(void) {} -#endif - static struct clk_div_table divxti_d[] = { { .val = 0, .div = 1 }, { .val = 1, .div = 2 }, @@ -278,7 +238,8 @@ void __init s3c2412_common_clk_init(struct device_node *np, unsigned long xti_f, samsung_clk_register_alias(ctx, s3c2412_aliases, ARRAY_SIZE(s3c2412_aliases)); - s3c2412_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s3c2412_clk_regs, + ARRAY_SIZE(s3c2412_clk_regs)); samsung_clk_of_add_provider(np, ctx); From patchwork Wed Aug 29 15:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580583 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 1B98B920 for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C6922B6AA for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AA6E2B664; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E0522B5DA for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729262AbeH2Tsh (ORCPT ); Wed, 29 Aug 2018 15:48:37 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55846 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbeH2Tsg (ORCPT ); Wed, 29 Aug 2018 15:48:36 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155101euoutp017fbf2814ceaf34246fc614f26a645f81~PZb1TLQXh0242402424euoutp01T; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155101euoutp017fbf2814ceaf34246fc614f26a645f81~PZb1TLQXh0242402424euoutp01T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557861; bh=PwIMWaqUxZMX0jTBnJCIfRn7bRV7FDqULB3ToEAwgY4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=mmXTjkI/pE9YWK+42gzZcDxIfIQNPDXjAIBC1ZI4O7V394fBb3ZX1RS2kZsKnsui4 3cnLCHhZ6W5Bg5RxCeDuAJY3U7euFlg5JrMi8+OWQRibzAViqm1gDt2aO+ubICxIlB nxZ+BLfXROqvMGNJ3h4HRhTgqHfDTtcsJw8aJSOQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155101eucas1p28757841bab87b3acd0c9dfbba1da288d~PZb0viZP82214922149eucas1p2u; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8E.DB.04294.4E0C68B5; Wed, 29 Aug 2018 16:51:00 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155100eucas1p1ba8149066e026fc15f82091968b78a08~PZbz9ytdH0107901079eucas1p1r; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-93-5b86c0e47e0f Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F5.76.04128.4E0C68B5; Wed, 29 Aug 2018 16:51:00 +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:00 +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 04/10] clk: samsung: s3c2443: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:40 +0200 Message-id: <20180829155046.29359-5-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+NgFprPIsWRmVeSWpSXmKPExsWy7djPc7pPDrRFGxw6ZmixccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVm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+eA bA4OXgFbiS+zDCC2yUus3nCAGcTmFLCTeHG8F6xcCKhk4Z3vjBMYeRYwMqxiFEktLc5Nzy02 0itOzC0uzUvXS87P3cQIDJRtx35u2cHY9S74EKMAB6MSD6/BorZoIdbEsuLK3EOMEhzMSiK8 excChXhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgskycXBKNTAequV1 fG60r/7j9UttPTxfPqfXThH4Yub04tXrnJkb/1dl3s8NmMtQFpKg78vhZT7z+5baLNcNpW76 vovXz1kbvigwoHRHQnWa/Im8Wau0Ss/N3cJnl8PeuPFo3MxJDConVny5MVvYrO+v0sWDiyZc e+XCGxvRIFz2g41n863A4jc7r/04suKrEktxRqKhFnNRcSIA0yfHcBACAAA= X-CMS-MailID: 20180829155100eucas1p1ba8149066e026fc15f82091968b78a08 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155100eucas1p1ba8149066e026fc15f82091968b78a08 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-s3c2443.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index c46e6d5bc9bc..884067e4f1a1 100644 --- a/drivers/clk/samsung/clk-s3c2443.c +++ b/drivers/clk/samsung/clk-s3c2443.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -43,9 +42,6 @@ enum supported_socs { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c2443_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -65,42 +61,6 @@ static unsigned long s3c2443_clk_regs[] __initdata = { SCLKCON, }; -static int s3c2443_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c2443_save, - ARRAY_SIZE(s3c2443_clk_regs)); - - return 0; -} - -static void s3c2443_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c2443_save, - ARRAY_SIZE(s3c2443_clk_regs)); -} - -static struct syscore_ops s3c2443_clk_syscore_ops = { - .suspend = s3c2443_clk_suspend, - .resume = s3c2443_clk_resume, -}; - -static void __init s3c2443_clk_sleep_init(void) -{ - s3c2443_save = samsung_clk_alloc_reg_dump(s3c2443_clk_regs, - ARRAY_SIZE(s3c2443_clk_regs)); - if (!s3c2443_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&s3c2443_clk_syscore_ops); - return; -} -#else -static void __init s3c2443_clk_sleep_init(void) {} -#endif - PNAME(epllref_p) = { "mpllref", "mpllref", "xti", "ext" }; PNAME(esysclk_p) = { "epllref", "epll" }; PNAME(mpllref_p) = { "xti", "mdivclk" }; @@ -450,7 +410,8 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, break; } - s3c2443_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s3c2443_clk_regs, + ARRAY_SIZE(s3c2443_clk_regs)); samsung_clk_of_add_provider(np, ctx); From patchwork Wed Aug 29 15:50:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580579 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 C85B1181E for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8A552B64C for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B69BE2B6A7; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 496C42B64C for ; Wed, 29 Aug 2018 15:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729213AbeH2Tsh (ORCPT ); Wed, 29 Aug 2018 15:48:37 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55850 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729215AbeH2Tsg (ORCPT ); Wed, 29 Aug 2018 15:48:36 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155102euoutp0142674153670666e3f7fb0053c63fb55a~PZb1ynnm70242602426euoutp01Z; Wed, 29 Aug 2018 15:51:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155102euoutp0142674153670666e3f7fb0053c63fb55a~PZb1ynnm70242602426euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557862; bh=RiiECV9AZpgG0EuT9iBcBxNANooMXRfhb+MHTxsZTZI=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=HVOi1jfS1r46TbEqsPYIretr/B52gurhJXmytU95jPkUM1oTgT2ul+AzNm/zyE9wy fTyLgpgj/KHjvBO86f0pAX1ykglf44aqsSdyOoqcRYVkJT7Eu7Y8lWDfB1ZHKf3n6l 38D4CnOrWqLp00cVv36hyhJYm0UFv1cvKAs68OVg= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155101eucas1p2a43962d4529b3b3a6198f2158e15516b~PZb1YBlGu2216722167eucas1p2o; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 59.DF.04441.5E0C68B5; Wed, 29 Aug 2018 16:51:01 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155100eucas1p16cded24187167d4af4d43f64c7abd88b~PZb0VtUma0103801038eucas1p10; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-e1-5b86c0e5a7a4 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 76.76.04128.4E0C68B5; Wed, 29 Aug 2018 16:51:00 +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:00 +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 05/10] clk: samsung: s3c64xx: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:41 +0200 Message-id: <20180829155046.29359-6-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+NgFlrIIsWRmV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k nrxvYQOpYhMwlOh62wVmiwg4SHz+9JoRpIhZ4DGjxLnFG1hBEsICcRJLv0xjArFZBFQlvj5s A4vzCthKPFtylxVinbzE6g0HmEFsTgE7iRfHe8HiQkA1C+98Z5zAyLOAkWEVo0hqaXFuem6x kV5xYm5xaV66XnJ+7iZGYKhsO/Zzyw7GrnfBhxgFOBiVeHgNFrVFC7EmlhVX5h5ilOBgVhLh 3bsQKMSbklhZlVqUH19UmpNafIhRmoNFSZz3vEFllJBAemJJanZqakFqEUyWiYNTqoFR4NrJ KZlMERveH4vym7PhxIGIIkWxLFPHsA9X/kyuri1SWv76gajuGc368rraDQsfvTjI+i06lP34 +VVvT1Ro8XE+u5pcf3nl5WvnHtZukzm0evHv9A8irP6K9re7r6kmvF217sDTlNP6fOYu7UKz P3cuK/Lard0avUtMI3rbX9sg58kfGXUfKbEUZyQaajEXFScCAOYp7EgRAgAA X-CMS-MailID: 20180829155100eucas1p16cded24187167d4af4d43f64c7abd88b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155100eucas1p16cded24187167d4af4d43f64c7abd88b 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-s3c64xx.c | 66 +++---------------------------- 1 file changed, 6 insertions(+), 60 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c64xx.c b/drivers/clk/samsung/clk-s3c64xx.c index 6db01cf5ab83..329a449f78c3 100644 --- a/drivers/clk/samsung/clk-s3c64xx.c +++ b/drivers/clk/samsung/clk-s3c64xx.c @@ -12,7 +12,6 @@ #include #include #include -#include #include @@ -59,10 +58,6 @@ static void __iomem *reg_base; static bool is_s3c6400; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c64xx_save_common; -static struct samsung_clk_reg_dump *s3c64xx_save_soc; - /* * List of controller registers to be saved and restored during * a suspend/resume cycle. @@ -89,60 +84,6 @@ static unsigned long s3c6410_clk_regs[] __initdata = { MEM0_GATE, }; -static int s3c64xx_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c64xx_save_common, - ARRAY_SIZE(s3c64xx_clk_regs)); - - if (!is_s3c6400) - samsung_clk_save(reg_base, s3c64xx_save_soc, - ARRAY_SIZE(s3c6410_clk_regs)); - - return 0; -} - -static void s3c64xx_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c64xx_save_common, - ARRAY_SIZE(s3c64xx_clk_regs)); - - if (!is_s3c6400) - samsung_clk_restore(reg_base, s3c64xx_save_soc, - ARRAY_SIZE(s3c6410_clk_regs)); -} - -static struct syscore_ops s3c64xx_clk_syscore_ops = { - .suspend = s3c64xx_clk_suspend, - .resume = s3c64xx_clk_resume, -}; - -static void __init s3c64xx_clk_sleep_init(void) -{ - s3c64xx_save_common = samsung_clk_alloc_reg_dump(s3c64xx_clk_regs, - ARRAY_SIZE(s3c64xx_clk_regs)); - if (!s3c64xx_save_common) - goto err_warn; - - if (!is_s3c6400) { - s3c64xx_save_soc = samsung_clk_alloc_reg_dump(s3c6410_clk_regs, - ARRAY_SIZE(s3c6410_clk_regs)); - if (!s3c64xx_save_soc) - goto err_soc; - } - - register_syscore_ops(&s3c64xx_clk_syscore_ops); - return; - -err_soc: - kfree(s3c64xx_save_common); -err_warn: - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); -} -#else -static void __init s3c64xx_clk_sleep_init(void) {} -#endif - /* List of parent clocks common for all S3C64xx SoCs. */ PNAME(spi_mmc_p) = { "mout_epll", "dout_mpll", "fin_pll", "clk27m" }; PNAME(uart_p) = { "mout_epll", "dout_mpll" }; @@ -508,7 +449,12 @@ void __init s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f, samsung_clk_register_alias(ctx, s3c64xx_clock_aliases, ARRAY_SIZE(s3c64xx_clock_aliases)); - s3c64xx_clk_sleep_init(); + + samsung_clk_sleep_init(reg_base, s3c64xx_clk_regs, + ARRAY_SIZE(s3c64xx_clk_regs)); + if (!is_s3c6400) + samsung_clk_sleep_init(reg_base, s3c6410_clk_regs, + ARRAY_SIZE(s3c6410_clk_regs)); samsung_clk_of_add_provider(np, ctx); From patchwork Wed Aug 29 15:50:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580595 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 33087139B 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 246FC2B6A7 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 227442B658; 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=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A60F82B657 for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729217AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:35929 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729202AbeH2Tsh (ORCPT ); Wed, 29 Aug 2018 15:48:37 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155103euoutp02f686bc34bf34a64d92be67586afa6966~PZb2cluW42538325383euoutp02G; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180829155103euoutp02f686bc34bf34a64d92be67586afa6966~PZb2cluW42538325383euoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557863; bh=Q9uhlE382LBHHSiqnvSM3mlLkFzoBC4lKxDmhF6BdmM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=sbyd0vcJjFKXDG0de4Te8oyeGvzTGNCQAdeQMZJBWDu83QrRhZRBHCnMo8D9ja+Qg IQPwWuiuokDp6IHBH2JpdVlh976LnF3MFGRmHEe2x+WA1WpDTzLsjul+XHwb1QRvJB kPjPSCQ4CCZwPcJrDosmn29ScPyXE17o4OiEJ6xQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155102eucas1p1472a299b057bac3008af1bb98efd69e1~PZb1sAIKp1725217252eucas1p1C; Wed, 29 Aug 2018 15:51:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FD.FA.04806.5E0C68B5; Wed, 29 Aug 2018 16:51:01 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155101eucas1p2f6ecb6ad0eb37fa725ac950cad73c423~PZb0t62ZX1894418944eucas1p2I; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-3a-5b86c0e57a86 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E1.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 06/10] clk: samsung: s5pv210: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:42 +0200 Message-id: <20180829155046.29359-7-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+NgFlrAIsWRmVeSWpSXmKPExsWy7djP87pPD7RFG9zqNrLYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV0XHxE1PBMqGKnps9TA2MK/m7GDk5JARMJN63z2YBsYUEVjBKvNki18XIBWR/ZpR4 dX0PM0zRjF37GCESyxglHn1/yA7hNDBJbH81AaydTcBQouttFxuILSLgIPH502uwDmaBx4wS W09+BRslLBAnse7oNCYQm0VAVeLIkUtgcV4BW4mH3++zQ6yTl1i94QBYnFPATuLF8V5WiPhH Vonzb6DudpGYP2kbI4QtLPHq+BaoXhmJzo6DTCCLJQSaGSXaZ8xih3B6gK6Ys4MNospa4vDx i2BTmQX4JCZtmw60jQMozivR0SYEUeIh0XahixXizYmMEt2nXzNOYJRcwMiwilE8tbQ4Nz21 2DgvtVyvODG3uDQvXS85P3cTIzDeTv87/nUH474/SYcYBTgYlXh4L8xoixZiTSwrrsw9xCjB wawkwrt3IVCINyWxsiq1KD++qDQntfgQozQHi5I4L59WWrSQQHpiSWp2ampBahFMlomDU6qB sXSNyu65+0KWsc1wX+H89PxWfe/T+zxKPoV7Gz2YN0VoH5td0Bx78w/ex7xf3PAMt0liz/57 0fTmXVY5yXvV9izhi+V/KuSxT1smMO/TwbSNIb/dQ6/mm4tx6FTaRXq9ilvNkyv+uI5TNlLR skKX8fTj0mW3T/o/zXQ+8dV+K7fO/CAps/MvlViKMxINtZiLihMB83vAnbMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xa7pPD7RFG/Q2MFtsnLGe1eL6l+es FufPb2C3+Nhzj9Vixvl9TBZrj9xlt2h/+pLZgd1j06pONo++LasYPT5vkgtgjuKySUnNySxL LdK3S+DK6Lj4ialgmVBFz80epgbGlfxdjJwcEgImEjN27WPsYuTiEBJYwigxZ0ITlNPEJPFw yQN2kCo2AUOJrrddbCC2iICDxOdPr8GKmAUeM0qcW7yBFSQhLBAnse76abAGFgFViSNHLjGD 2LwCthIPv99nh1gnL7F6wwGwOKeAncSL471gvUJANQvvfGecwMizgJFhFaNIamlxbnpusaFe cWJucWleul5yfu4mRmCobDv2c/MOxksbgw8xCnAwKvHwXpjRFi3EmlhWXJl7iFGCg1lJhHfv QqAQb0piZVVqUX58UWlOavEhRmkOFiVx3vMGlVFCAumJJanZqakFqUUwWSYOTqkGRpkyV8bo ki3WnP6LvOdt7f3EHleq9+N9cFpZ2FtWS85lS45MO8X6X8zkFsfz4NXpoUsd/ndzfTh69BbX sQIn9eBl0u+lhc1PP/52+mnnAt/m38vniyjMtJNtto++XVfzSeYE+9ElSbN9s9d0bruzVn39 2423+i6k9CvJvSgq/1nzwtT9UHzCeyWW4oxEQy3mouJEAC34BIARAgAA X-CMS-MailID: 20180829155101eucas1p2f6ecb6ad0eb37fa725ac950cad73c423 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155101eucas1p2f6ecb6ad0eb37fa725ac950cad73c423 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-s5pv210.c | 41 ++----------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/drivers/clk/samsung/clk-s5pv210.c b/drivers/clk/samsung/clk-s5pv210.c index fd2725710a6f..41d2337fe030 100644 --- a/drivers/clk/samsung/clk-s5pv210.c +++ b/drivers/clk/samsung/clk-s5pv210.c @@ -14,7 +14,6 @@ #include #include #include -#include #include "clk.h" #include "clk-pll.h" @@ -83,9 +82,6 @@ enum { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s5pv210_clk_dump; - /* List of registers that need to be preserved across suspend/resume. */ static unsigned long s5pv210_clk_regs[] __initdata = { CLK_SRC0, @@ -132,40 +128,6 @@ static unsigned long s5pv210_clk_regs[] __initdata = { CLK_OUT, }; -static int s5pv210_clk_suspend(void) -{ - samsung_clk_save(reg_base, s5pv210_clk_dump, - ARRAY_SIZE(s5pv210_clk_regs)); - return 0; -} - -static void s5pv210_clk_resume(void) -{ - samsung_clk_restore(reg_base, s5pv210_clk_dump, - ARRAY_SIZE(s5pv210_clk_regs)); -} - -static struct syscore_ops s5pv210_clk_syscore_ops = { - .suspend = s5pv210_clk_suspend, - .resume = s5pv210_clk_resume, -}; - -static void s5pv210_clk_sleep_init(void) -{ - s5pv210_clk_dump = - samsung_clk_alloc_reg_dump(s5pv210_clk_regs, - ARRAY_SIZE(s5pv210_clk_regs)); - if (!s5pv210_clk_dump) { - pr_warn("%s: Failed to allocate sleep save data\n", __func__); - return; - } - - register_syscore_ops(&s5pv210_clk_syscore_ops); -} -#else -static inline void s5pv210_clk_sleep_init(void) { } -#endif - /* Mux parent lists. */ static const char *const fin_pll_p[] __initconst = { "xxti", @@ -822,7 +784,8 @@ static void __init __s5pv210_clk_init(struct device_node *np, samsung_clk_register_alias(ctx, s5pv210_aliases, ARRAY_SIZE(s5pv210_aliases)); - s5pv210_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s5pv210_clk_regs, + ARRAY_SIZE(s5pv210_clk_regs)); samsung_clk_of_add_provider(np, ctx); 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 F8GmMgvwSUzaNh1oG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x/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); From patchwork Wed Aug 29 15:50:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580601 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 9588469B7 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 8729C2B683 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8576C2B6A7; 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=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18A102B6C4 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729237AbeH2Tsj (ORCPT ); Wed, 29 Aug 2018 15:48:39 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:35935 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729206AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155103euoutp02d71e2d1966ccc84a53a1d54cd9a23ce7~PZb3XBA7r2539125391euoutp02E; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180829155103euoutp02d71e2d1966ccc84a53a1d54cd9a23ce7~PZb3XBA7r2539125391euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557864; bh=0ZOvo/7v0e4RpMKaRQStI++zq3ROZmJ4knCcBT7gPxs=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=hc+BFqyEuf4Skd0RCCfZftk+dMRiX6u7RUoHxLvspRgaYmzQd1X/IrSuDKs7mymfl NyG2SwvKkcKfialJtxWyBSqt8AlrHztKvNni4e8Mz8npgpGYyzEuS/P8G2918u7OK/ RHW5kUqFUbWHg3SPQtwCPceuiPcXU+5tR1X3aBfU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155103eucas1p205b40a3cf84527029e919066e6d359eb~PZb2zqZyV2216722167eucas1p2q; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CE.FA.04806.7E0C68B5; Wed, 29 Aug 2018 16:51:03 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155102eucas1p1ca7a26c10847dcb585f01b54657e29cb~PZb166KBg1936219362eucas1p12; Wed, 29 Aug 2018 15:51:02 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-3d-5b86c0e7f882 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A7.76.04128.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 08/10] clk: samsung: Add support for setting registers state before suspend Date: Wed, 29 Aug 2018 17:50:44 +0200 Message-id: <20180829155046.29359-9-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+NgFlrIIsWRmVeSWpSXmKPExsWy7djP87rPD7RFGxw9wWyxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoErY82btUwFTXIVS/etYWlgnCDZxcjJISFgInHt11KmLkYuDiGBFYwSv7oXM0M4nxkl Wq5fY4apatsxgQUisYxRYuOKlVAtDUwS21+BZDg52AQMJbredrGB2CICDhKfP71mB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EUyWiYNTqoFRSf2e bFTtdvkNcgppNp5bxI+zXHk8/WJEX+wGNw/zk1v2GDUV/L1yo0eo5r3FuwK7ig3PV4ccu8Sc vbbFWEuhf/oqEcPL9offN/uHmlpO9XP7yK+b/fDCReZ5GzYo9Wwsn3rvq8NLZ8+jTglTeosV 5Mom/J8Rt5xZ4I2Txm1tn39B5gybVFyUWIozEg21mIuKEwGxzrNnEQIAAA== X-CMS-MailID: 20180829155102eucas1p1ca7a26c10847dcb585f01b54657e29cb X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155102eucas1p1ca7a26c10847dcb585f01b54657e29cb 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 Some registers of clock controller have to be set to certain values before entering system suspend state. Till now drivers did that on their own, but it will be easier to handle it by generic code and let drivers simply to provide the list of registers and their state. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk.c | 23 +++++++++++++---------- drivers/clk/samsung/clk.h | 18 ++++++++++++++++-- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 8634884aa11c..ab467a7f973a 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -290,9 +290,12 @@ static int samsung_clk_suspend(void) { struct samsung_clock_reg_cache *reg_cache; - list_for_each_entry(reg_cache, &clock_reg_cache_list, node) + list_for_each_entry(reg_cache, &clock_reg_cache_list, node) { samsung_clk_save(reg_cache->reg_base, reg_cache->rdump, reg_cache->rd_num); + samsung_clk_restore(reg_cache->reg_base, reg_cache->rsuspend, + reg_cache->rsuspend_num); + } return 0; } @@ -310,9 +313,11 @@ static struct syscore_ops samsung_clk_syscore_ops = { .resume = samsung_clk_resume, }; -void samsung_clk_sleep_init(void __iomem *reg_base, +void samsung_clk_sleep_init2(void __iomem *reg_base, const unsigned long *rdump, - unsigned long nr_rdump) + unsigned long nr_rdump, + const struct samsung_clk_reg_dump *rsuspend, + unsigned long nr_rsuspend) { struct samsung_clock_reg_cache *reg_cache; @@ -330,13 +335,10 @@ void samsung_clk_sleep_init(void __iomem *reg_base, reg_cache->reg_base = reg_base; reg_cache->rd_num = nr_rdump; + reg_cache->rsuspend = rsuspend; + reg_cache->rsuspend_num = nr_rsuspend; list_add_tail(®_cache->node, &clock_reg_cache_list); } - -#else -void samsung_clk_sleep_init(void __iomem *reg_base, - const unsigned long *rdump, - unsigned long nr_rdump) {} #endif /* @@ -380,8 +382,9 @@ struct samsung_clk_provider * __init samsung_cmu_register_one( samsung_clk_register_fixed_factor(ctx, cmu->fixed_factor_clks, cmu->nr_fixed_factor_clks); if (cmu->clk_regs) - samsung_clk_sleep_init(reg_base, cmu->clk_regs, - cmu->nr_clk_regs); + samsung_clk_sleep_init2(reg_base, + cmu->clk_regs, cmu->nr_clk_regs, + cmu->suspend_regs, cmu->nr_suspend_regs); samsung_clk_of_add_provider(np, ctx); diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index 3880d2f9d582..854d0b52ef5f 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -279,6 +279,8 @@ struct samsung_clock_reg_cache { void __iomem *reg_base; struct samsung_clk_reg_dump *rdump; unsigned int rd_num; + const struct samsung_clk_reg_dump *rsuspend; + unsigned int rsuspend_num; }; struct samsung_cmu_info { @@ -358,9 +360,21 @@ extern struct samsung_clk_provider __init *samsung_cmu_register_one( extern unsigned long _get_rate(const char *clk_name); -extern void samsung_clk_sleep_init(void __iomem *reg_base, +#ifdef CONFIG_PM_SLEEP +extern void samsung_clk_sleep_init2(void __iomem *reg_base, const unsigned long *rdump, - unsigned long nr_rdump); + unsigned long nr_rdump, + const struct samsung_clk_reg_dump *rsuspend, + unsigned long nr_rsuspend); +#else +void samsung_clk_sleep_init2(void __iomem *reg_base, + const unsigned long *rdump, + unsigned long nr_rdump, + const struct samsung_clk_reg_dump *rsuspend, + unsigned long nr_rsuspend) {} +#endif +#define samsung_clk_sleep_init(reg_base, rdump, nr_rdump) \ + samsung_clk_sleep_init2(reg_base, rdump, nr_rdump, NULL, 0) extern void samsung_clk_save(void __iomem *base, struct samsung_clk_reg_dump *rd, From patchwork Wed Aug 29 15:50:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580593 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 0FB9C180E 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 00F202B658 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F31AA2B64C; Wed, 29 Aug 2018 15:51:06 +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 603D22B6CC for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729202AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:35932 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729200AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155103euoutp02822942034287896744f0d4ecc78e3143~PZb26zFBK2539025390euoutp02F; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180829155103euoutp02822942034287896744f0d4ecc78e3143~PZb26zFBK2539025390euoutp02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557863; bh=hPfdadCV0HaBGx8qPVWmS3x+Xdf4vfmgAA1gjDV9voI=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=eyEL8cVp6shXzXaV3/H5MRevuQuWIPmMd9cQpGs1BI2STOfEcLqT1E5xjJ6fqj5Ig Y91KpSyGhUGS6d2SxnYsv7QUWpI6H8A+/ijnwLZtg/0kykagcvw98vcZOo8sbvmyyS ICkn6nQ9dBwVfNLkIGgM2lhTM9t4I7Zo8Y4sIpXA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155103eucas1p1cb3bc1ded3bc99c3c451f8c0ce85bdd9~PZb2fgsPz2368223682eucas1p1c; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 5A.DF.04441.6E0C68B5; 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 20180829155102eucas1p2a4b1c554623ff97a23f85f26a6b537e2~PZb1viH2v2213522135eucas1p2q; Wed, 29 Aug 2018 15:51:02 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-e4-5b86c0e6736e Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 33.37.04284.6E0C68B5; Wed, 29 Aug 2018 16:51:02 +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:02 +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 09/10] clk: samsung: exynos4: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:45 +0200 Message-id: <20180829155046.29359-10-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+NgFlrEIsWRmVeSWpSXmKPExsWy7djPc7rPDrRFG6w5qW2xccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4/LrXuaCi0YVM48+ZWlg/KLZxcjJISFgIrGv6TZ7FyMXh5DACkaJZ5vb2SCcz4wS txddYoep6lr7nAUisYxR4vuVS1BVDUwSk5dtZAGpYhMwlOh628UGYosIOEh8/vSaEaSIWeAx o8TWk1+ZQRLCAnES9/p3gNksAqoSs99tAVvBK2An0b94BiPEOnmJ1RsOgNVwAsVfHO9lBRkk IfCVVWLupA9sEEUuEiu//YBqEJZ4dXwL1K0yEp0dB5kgGpoZJdpnzGKHcHqAzpizA6rbWuLw 8YusIDazAJ/EpG3TgdZxAMV5JTrahCBKPCSunbvFBPHnREaJ612fGCcwSi5gZFjFKJ5aWpyb nlpsmJdarlecmFtcmpeul5yfu4kRGHOn/x3/tIPx66WkQ4wCHIxKPLwas9uihVgTy4orcw8x SnAwK4nw7l0IFOJNSaysSi3Kjy8qzUktPsQozcGiJM7Lp5UWLSSQnliSmp2aWpBaBJNl4uCU amBcv1MtWu3l/693hObr5R/iS8l3k+YN7DoYc3ixId+RCoNpzfFpjBU+Rz7sb/zHPSVELLHG 48vbCm+ZE/3bzfcs97zp+e5P+3v/aYv2/o+sKjy+QCoztpHB+sumh/vWTTO4mnz6RvkR141W VdN0Gze1LQw7HXwpuy77s9b8tiTF8mqNmbdXiDcrsRRnJBpqMRcVJwIAucb3mbUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xa7rPDrRFG8zewmuxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4/LrXuaCi0YVM48+ZWlg/KLZxcjJISFgItG19jlLFyMXh5DAEkaJda8Ps0I4TUwS O+efZgapYhMwlOh628UGYosIOEh8/vSaEaSIWeAxo8S5xRtYQRLCAnESTR3PwIpYBFQlZr/b wg5i8wrYSfQvnsEIsU5eYvWGA2BDOYHiL473gvUKCdhKLLzznXECI88CRoZVjCKppcW56bnF hnrFibnFpXnpesn5uZsYgaGy7djPzTsYL20MPsQowMGoxMN7YUZbtBBrYllxZe4hRgkOZiUR 3r0LgUK8KYmVValF+fFFpTmpxYcYpTlYlMR5zxtURgkJpCeWpGanphakFsFkmTg4pRoYi6bU 2YXvmL92S8nk809PMEW8mbqg7mDLdz9DF3aPE3c4P/xpk6zjrW9lTWDr2uyotihHMXDHvv0W Qc6r+73z2YtPSH/bfTJmo8STmKi+p9Wm+9Usl1dyMf5NUJtQqmLFqyvV5xt75Uhkt/ykysQd G7jvsB57fm4RT+/VqdebGuazysfOr3qvxFKckWioxVxUnAgALkgscxECAAA= X-CMS-MailID: 20180829155102eucas1p2a4b1c554623ff97a23f85f26a6b537e2 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155102eucas1p2a4b1c554623ff97a23f85f26a6b537e2 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. Handling of PLLs is a bit different in generic code, as they are handled in the same way as other clock registers. Such approach was already used on later Exynos SoCs and worked fine. Tests have shown that it works also on Exynos4 SoCs and significantly simplifies the code. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-exynos4.c | 147 ++++-------------------------- 1 file changed, 16 insertions(+), 131 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 0421960eb963..d3bd9ffd8a09 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "clk.h" #include "clk-cpu.h" @@ -157,14 +156,6 @@ enum exynos4_plls { static void __iomem *reg_base; static enum exynos4_soc exynos4_soc; -/* - * Support for CMU save/restore across system suspends - */ -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *exynos4_save_common; -static struct samsung_clk_reg_dump *exynos4_save_soc; -static struct samsung_clk_reg_dump *exynos4_save_pll; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -192,7 +183,7 @@ static const unsigned long exynos4x12_clk_save[] __initconst = { E4X12_PWR_CTRL2, }; -static const unsigned long exynos4_clk_pll_regs[] __initconst = { +static const unsigned long exynos4_clk_regs[] __initconst = { EPLL_LOCK, VPLL_LOCK, EPLL_CON0, @@ -201,9 +192,6 @@ static const unsigned long exynos4_clk_pll_regs[] __initconst = { VPLL_CON0, VPLL_CON1, VPLL_CON2, -}; - -static const unsigned long exynos4_clk_regs[] __initconst = { SRC_LEFTBUS, DIV_LEFTBUS, GATE_IP_LEFTBUS, @@ -276,6 +264,8 @@ static const unsigned long exynos4_clk_regs[] __initconst = { }; static const struct samsung_clk_reg_dump src_mask_suspend[] = { + { .offset = VPLL_CON0, .value = 0x80600302, }, + { .offset = EPLL_CON0, .value = 0x806F0302, }, { .offset = SRC_MASK_TOP, .value = 0x00000001, }, { .offset = SRC_MASK_CAM, .value = 0x11111111, }, { .offset = SRC_MASK_TV, .value = 0x00000111, }, @@ -291,123 +281,6 @@ static const struct samsung_clk_reg_dump src_mask_suspend_e4210[] = { { .offset = E4210_SRC_MASK_LCD1, .value = 0x00001111, }, }; -#define PLL_ENABLED (1 << 31) -#define PLL_LOCKED (1 << 29) - -static void exynos4_clk_enable_pll(u32 reg) -{ - u32 pll_con = readl(reg_base + reg); - pll_con |= PLL_ENABLED; - writel(pll_con, reg_base + reg); - - while (!(pll_con & PLL_LOCKED)) { - cpu_relax(); - pll_con = readl(reg_base + reg); - } -} - -static void exynos4_clk_wait_for_pll(u32 reg) -{ - u32 pll_con; - - pll_con = readl(reg_base + reg); - if (!(pll_con & PLL_ENABLED)) - return; - - while (!(pll_con & PLL_LOCKED)) { - cpu_relax(); - pll_con = readl(reg_base + reg); - } -} - -static int exynos4_clk_suspend(void) -{ - samsung_clk_save(reg_base, exynos4_save_common, - ARRAY_SIZE(exynos4_clk_regs)); - samsung_clk_save(reg_base, exynos4_save_pll, - ARRAY_SIZE(exynos4_clk_pll_regs)); - - exynos4_clk_enable_pll(EPLL_CON0); - exynos4_clk_enable_pll(VPLL_CON0); - - if (exynos4_soc == EXYNOS4210) { - samsung_clk_save(reg_base, exynos4_save_soc, - ARRAY_SIZE(exynos4210_clk_save)); - samsung_clk_restore(reg_base, src_mask_suspend_e4210, - ARRAY_SIZE(src_mask_suspend_e4210)); - } else { - samsung_clk_save(reg_base, exynos4_save_soc, - ARRAY_SIZE(exynos4x12_clk_save)); - } - - samsung_clk_restore(reg_base, src_mask_suspend, - ARRAY_SIZE(src_mask_suspend)); - - return 0; -} - -static void exynos4_clk_resume(void) -{ - samsung_clk_restore(reg_base, exynos4_save_pll, - ARRAY_SIZE(exynos4_clk_pll_regs)); - - exynos4_clk_wait_for_pll(EPLL_CON0); - exynos4_clk_wait_for_pll(VPLL_CON0); - - samsung_clk_restore(reg_base, exynos4_save_common, - ARRAY_SIZE(exynos4_clk_regs)); - - if (exynos4_soc == EXYNOS4210) - samsung_clk_restore(reg_base, exynos4_save_soc, - ARRAY_SIZE(exynos4210_clk_save)); - else - samsung_clk_restore(reg_base, exynos4_save_soc, - ARRAY_SIZE(exynos4x12_clk_save)); -} - -static struct syscore_ops exynos4_clk_syscore_ops = { - .suspend = exynos4_clk_suspend, - .resume = exynos4_clk_resume, -}; - -static void __init exynos4_clk_sleep_init(void) -{ - exynos4_save_common = samsung_clk_alloc_reg_dump(exynos4_clk_regs, - ARRAY_SIZE(exynos4_clk_regs)); - if (!exynos4_save_common) - goto err_warn; - - if (exynos4_soc == EXYNOS4210) - exynos4_save_soc = samsung_clk_alloc_reg_dump( - exynos4210_clk_save, - ARRAY_SIZE(exynos4210_clk_save)); - else - exynos4_save_soc = samsung_clk_alloc_reg_dump( - exynos4x12_clk_save, - ARRAY_SIZE(exynos4x12_clk_save)); - if (!exynos4_save_soc) - goto err_common; - - exynos4_save_pll = samsung_clk_alloc_reg_dump(exynos4_clk_pll_regs, - ARRAY_SIZE(exynos4_clk_pll_regs)); - if (!exynos4_save_pll) - goto err_soc; - - register_syscore_ops(&exynos4_clk_syscore_ops); - return; - -err_soc: - kfree(exynos4_save_soc); -err_common: - kfree(exynos4_save_common); -err_warn: - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); -} -#else -static void __init exynos4_clk_sleep_init(void) {} -#endif - /* list of all parent clock list */ PNAME(mout_apll_p) = { "fin_pll", "fout_apll", }; PNAME(mout_mpll_p) = { "fin_pll", "fout_mpll", }; @@ -1532,7 +1405,19 @@ static void __init exynos4_clk_init(struct device_node *np, if (soc == EXYNOS4X12) exynos4x12_core_down_clock(); - exynos4_clk_sleep_init(); + + samsung_clk_sleep_init2(reg_base, exynos4_clk_regs, + ARRAY_SIZE(exynos4_clk_regs), + src_mask_suspend, + ARRAY_SIZE(src_mask_suspend)); + if (exynos4_soc == EXYNOS4210) + samsung_clk_sleep_init2(reg_base, exynos4210_clk_save, + ARRAY_SIZE(exynos4210_clk_save), + src_mask_suspend_e4210, + ARRAY_SIZE(src_mask_suspend_e4210)); + else + samsung_clk_sleep_init(reg_base, exynos4x12_clk_save, + ARRAY_SIZE(exynos4x12_clk_save)); samsung_clk_of_add_provider(np, ctx); From patchwork Wed Aug 29 15:50:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10580599 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 7CB115A4 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 6B0F22B683 for ; Wed, 29 Aug 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67ED32B6A7; 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=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB4B02B683 for ; Wed, 29 Aug 2018 15:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729200AbeH2Tsj (ORCPT ); Wed, 29 Aug 2018 15:48:39 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55850 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729218AbeH2Tsj (ORCPT ); Wed, 29 Aug 2018 15:48:39 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155104euoutp017bc2e2dcc7d05193579677f4e3cf6212~PZb34kBIg0370903709euoutp01q; Wed, 29 Aug 2018 15:51:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155104euoutp017bc2e2dcc7d05193579677f4e3cf6212~PZb34kBIg0370903709euoutp01q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557864; bh=TI9gOZRB3r4tnQPcekOrcuMLRHftqnHX83vDH5qp3q0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=dKSJxC+5Na+UahVGMpY67dLZjLmx1rgy5MFwfGLpGJ6l2rQ4kophGQcW33vVPmbZy /8mvfk8yz+LgsQZ3QkjNwSM8IA+wPd/tovRI4++HawDASc23bBWRaYdzkPFjGA0eH6 4ZMHBzpxb3Plq+2Bzjv8jivdzMa2QLwwWSndIru4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155104eucas1p14b1737f1b75a68ecaf7885e6866521a8~PZb3dTqhe0107501075eucas1p11; Wed, 29 Aug 2018 15:51:04 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 4F.FA.04806.7E0C68B5; Wed, 29 Aug 2018 16:51:03 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155103eucas1p16b6cddb4babcfb60a3257e017bea347e~PZb2dLvAz0667306673eucas1p1Z; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-3f-5b86c0e7ecdd Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 28.76.04128.6E0C68B5; Wed, 29 Aug 2018 16:51:02 +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:02 +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 10/10] clk: samsung: exynos5420: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:46 +0200 Message-id: <20180829155046.29359-11-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+NgFlrAIsWRmVeSWpSXmKPExsWy7djPc7rPD7RFGzzYpG+xccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4918g4JH0hVfLj5lb2BcKt7FyMkhIWAicf/OXZYuRi4OIYEVjBILz/xghHA+M0rs WrSBrYuRA6yq86ImRHwZo8SeV1egihqYJCYv28gCMopNwFCi620XG4gtIuAg8fnTa7AiZoHH jBJbT35lBkkICyRKTH73kBXEZhFQlVjR8wMszitgJ7Hw5Rx2iJvkJVZvOAAW5wSKvzjeywoy SELgK6vElilL2CCKXCR2nfwB1SAs8er4FihbRuLy5G4WiIZmRon2GbPYIZweoDPm7IDqtpY4 fPwi2BnMAnwSk7ZNZ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t1rbD0J0fdfDoufPikxFKckWioxVxUnAgA4h5BHQ4CAAA= X-CMS-MailID: 20180829155103eucas1p16b6cddb4babcfb60a3257e017bea347e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155103eucas1p16b6cddb4babcfb60a3257e017bea347e 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 --- drivers/clk/samsung/clk-exynos5420.c | 73 +++------------------------- 1 file changed, 7 insertions(+), 66 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 95e1bf69449b..9f2f53d7be70 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -15,7 +15,6 @@ #include #include #include -#include #include "clk.h" #include "clk-cpu.h" @@ -156,10 +155,6 @@ enum exynos5x_plls { static void __iomem *reg_base; static enum exynos5x_soc exynos5x_soc; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *exynos5x_save; -static struct samsung_clk_reg_dump *exynos5800_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -283,66 +278,6 @@ static const struct samsung_clk_reg_dump exynos5420_set_clksrc[] = { { .offset = GATE_IP_PERIC, .value = 0xffffffff, }, }; -static int exynos5420_clk_suspend(void) -{ - samsung_clk_save(reg_base, exynos5x_save, - ARRAY_SIZE(exynos5x_clk_regs)); - - if (exynos5x_soc == EXYNOS5800) - samsung_clk_save(reg_base, exynos5800_save, - ARRAY_SIZE(exynos5800_clk_regs)); - - samsung_clk_restore(reg_base, exynos5420_set_clksrc, - ARRAY_SIZE(exynos5420_set_clksrc)); - - return 0; -} - -static void exynos5420_clk_resume(void) -{ - samsung_clk_restore(reg_base, exynos5x_save, - ARRAY_SIZE(exynos5x_clk_regs)); - - if (exynos5x_soc == EXYNOS5800) - samsung_clk_restore(reg_base, exynos5800_save, - ARRAY_SIZE(exynos5800_clk_regs)); -} - -static struct syscore_ops exynos5420_clk_syscore_ops = { - .suspend = exynos5420_clk_suspend, - .resume = exynos5420_clk_resume, -}; - -static void __init exynos5420_clk_sleep_init(void) -{ - exynos5x_save = samsung_clk_alloc_reg_dump(exynos5x_clk_regs, - ARRAY_SIZE(exynos5x_clk_regs)); - if (!exynos5x_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - if (exynos5x_soc == EXYNOS5800) { - exynos5800_save = - samsung_clk_alloc_reg_dump(exynos5800_clk_regs, - ARRAY_SIZE(exynos5800_clk_regs)); - if (!exynos5800_save) - goto err_soc; - } - - register_syscore_ops(&exynos5420_clk_syscore_ops); - return; -err_soc: - kfree(exynos5x_save); - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; -} -#else -static void __init exynos5420_clk_sleep_init(void) {} -#endif - /* list of all parent clocks */ PNAME(mout_mspll_cpu_p) = {"mout_sclk_cpll", "mout_sclk_dpll", "mout_sclk_mpll", "mout_sclk_spll"}; @@ -1540,7 +1475,13 @@ static void __init exynos5x_clk_init(struct device_node *np, mout_kfc_p[0], mout_kfc_p[1], 0x28200, exynos5420_kfcclk_d, ARRAY_SIZE(exynos5420_kfcclk_d), 0); - exynos5420_clk_sleep_init(); + samsung_clk_sleep_init2(reg_base, exynos5x_clk_regs, + ARRAY_SIZE(exynos5x_clk_regs), + exynos5420_set_clksrc, + ARRAY_SIZE(exynos5420_set_clksrc)); + if (soc == EXYNOS5800) + samsung_clk_sleep_init(reg_base, exynos5800_clk_regs, + ARRAY_SIZE(exynos5800_clk_regs)); exynos5_subcmus_init(ctx, ARRAY_SIZE(exynos5x_subcmus), exynos5x_subcmus);