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: 145449 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp831268ljw; Wed, 29 Aug 2018 08:51:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTsks4/6xQ7LLkzX4jihhGx3HyC9s74tSM77NDPicNBrE5sdQ36hvQq1r4MTxdmTEhdTPn X-Received: by 2002:a17:902:8348:: with SMTP id z8-v6mr6601759pln.51.1535557865224; Wed, 29 Aug 2018 08:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535557865; cv=none; d=google.com; s=arc-20160816; b=IbvgRrbr5ndpbpumVUvGLTzZorYKXEcoj4b1s9FHV1RKVHlN3P4WgT84UfjlaGvHan nNtYkDkuDW4dSRspSIviPW8Xuiul0mJu/Mm2F3boHXXjh8Io7Y3QKv9LiOMGDeB0B3uP uXoLGUSAVXHOrwxDFiqfIIaDygeZ7veBHHU11l4nDG+BVp7vAHo1U0Xhr9Z7VuA7GCWj +LnZhvaXWXOtyV49Kr/x91GP+Vnl6Lb+Dn4x7a5O2xLJY7MxiZeMOEl6bb0mehPp7eL1 4BVOG9vt6BX1ff0bTaM1ZgF3PaO1/Tz6lIhE4WHYCE586UZG2gj4KP3Bi5kQSw3pIWtW JJTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=ak4RGJp1vIijhetnQYtg6ixxodfuEf7895yWFHLuAiM=; b=SfGXrekHrW37VR8vP+QVHYWPPFfj/rw4HpDDqfj5GZapjXuXmHducsNLQgaaJwf23g mHkmOAofMXJ1hW3IaYtW1dCBOdrp8bsl95NwmFRHECtFgtkwe9IceqUkYL7zonVa55Ys lJWRc4f7BCElEwbPccePKo7J7fyI1wKQxenoMAYSabNrKTYZ4RoLF/Fv6B7GEBgm6VeZ W/ecRd0gt/YNbeYEay8Nzp8iUqCTGeuIB5c7rx7NAh0TI7vJk7QxDR9JmJIDXI1pf4h+ 9PX4XADd1bXo+/hmnWUmNoZ3fYt7KfiB51TLILQsz1VTaG8TRIBW4nR3VnZw8ZWDlucP LupA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=JN3qvX7t; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32-v6si4160278pgk.59.2018.08.29.08.51.05; Wed, 29 Aug 2018 08:51:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=JN3qvX7t; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729216AbeH2Tsh (ORCPT + 3 others); 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/YAk2AUOJrrddbCC2iICDxOdPr8HGMgs8 ZpTYevIrM0hCWCBOYt+Ma2ANLAKqEue2PmYDOYNXwFZi5ppaiGXyEqs3HAAr5xSwk3hxvJcV Iv6VVeLLd10I20Vi16UmZghbWOLV8S3sELaMRGfHQSaQvRICzYwS7TNmsUM4PUBHzNnBBlFl LXH4+EWwqcwCfBKTtk1nhoQFr0RHmxBEiYfE+QnbmCC+nAj08dEbbBMYJRcwMqxiFE8tLc5N Ty02zEst1ytOzC0uzUvXS87P3cQIjLXT/45/2sH49VLSIUYBDkYlHl6N2W3RQqyJZcWVuYcY JTiYlUR49y4ECvGmJFZWpRblxxeV5qQWH2KU5mBREufl00qLFhJITyxJzU5NLUgtgskycXBK NTBOjPiQtud2m90hx5IAT45nqeuXvIpvO9ujpG+abKcfpnLQmnXCKjk1wdrX0dOy/ut6Lwi/ 8PFd3jKxVe1z5N45NWrGPFjWkvfOdG7+VcmkiH2CXx/djfxo4DLPvpP7eeuBaqaTBVcv3Fu9 /d2H92WpPNcTVqbs/O10V5PFYaJ+z2U7I9G/OvxKLMUZiYZazEXFiQAfaPQBsQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t/xa7qPD7RFG8xeLW2xccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEro2XnIqaCWUIVf75+YW5gnMPfxcjJISFgIrH53neWLkYuDiGBJYwSlya8YoJwmpgk nn9dyw5SxSZgKNH1tosNxBYRcJD4/Ok1I0gRs8BjRolzizewgiSEBeIk9vUfZgaxWQRUJc5t fQzUwMHBK2ArMXNNLcQ2eYnVGw6AlXAK2Em8ON4L1ioEVLLwznfGCYw8CxgZVjGKpJYW56bn FhvqFSfmFpfmpesl5+duYgQGyrZjPzfvYLy0MfgQowAHoxIP74UZbdFCrIllxZW5hxglOJiV RHj3LgQK8aYkVlalFuXHF5XmpBYfYpTmYFES5z1vUBklJJCeWJKanZpakFoEk2Xi4JRqYNQq 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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Replace common suspend/resume handling code by generic helper. No functional change. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-s3c2410.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) -- 2.17.1 Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski 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); }