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: 145450 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp831281ljw; Wed, 29 Aug 2018 08:51:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZcivWnhNu4IbNDI5v2nX2oWxbSfqirJGzTU3KcugV7y9Bwu7KrK16e2xRrUTw5i/GgcsfL X-Received: by 2002:a63:5055:: with SMTP id q21-v6mr6203241pgl.397.1535557865989; 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=Ni/vwK+OFMrC255GpLaloNO87ZjRc8050ybMmBKUc+9bhmFfbrueYG7tVz/pndqIvx avDwnLaBoYT+DPvEss2MjN7GWvk0xRc3xSesvN2nPaE7H+mkHMb9eh5X9HRbhpY76/64 gmSkXl2OZLTQLhAXoHwKQrdPbKQJCczpg9oeuZ0zANdW/Q/3Jgem3yhCectNcB0wzdOv GDxqAQBnP8HHnq9dsotxYgYkgwTeMD62o0XQjw5eckvf9ocRBZbyHYvTFmmLpvkxFoPK 3J0/pgBauRDoBmI/00voPYD+d1uqPyb7QucsLtz0POLb4WyZq/0PFLvBpULJbkULrn4G S65w== 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=RiiECV9AZpgG0EuT9iBcBxNANooMXRfhb+MHTxsZTZI=; b=oz2kBBC/Efrn079c7+xpMJ9sxk6aYt5LE7gibJgTW6MvM4nDA2fNHQFhPfcZUBBp5R HSEvJMqzoEgLb9cr24IBmLyAgk9JbV1wF1WAab8kNqDtTl8/WNuZp4bBD7edKNSr52U5 vrf15TEPwE9EpE2M0O1amYf758YL1dEP3w1MJfL8+WGUglvLWeE0CeanzoNKI6CNbjeI oU7EAdCLs6UlaDkqhVoOHNxNB9tc5kOdA9S8yqWAN7MJuRQ+T6nAvg9mcZsRH5M9OFaS QjXS/4AtnHVDwpPFRzAzXdbhHK9rOHfCDCT8wOYvrQT33gTbUA/aJPPFi6mUlGhSz9x9 gfWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HVOi1jfS; 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=HVOi1jfS; 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 S1729236AbeH2Tsh (ORCPT + 3 others); 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+NgFlrIIsWRmVeSWpSXmKPExsWy7djPc7pPD7RFGxxtl7XYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVMWnJXJaCYxIVf4/dYG9gPC3SxcjJISFgIjF/wVTWLkYuDiGBFYwSkw60M0I4nxkl Vt57wgZT9fjddHaIxDJGiX9zljJDOA1MEm8+7WQEqWITMJToetsF1iEi4CDx+dNrsFHMAo8Z Jbae/ArUwcEhLBAnsXNTLEgNi4CqxNeHbawgNq+ArcSzJXdZIbbJS6zecIAZxOYUsJN4cbwX 7D4Jga+sEpe7p0Od5CLRd2w2lC0s8er4FnYIW0bi8uRuFoiGZkaJ9hmz2CGcHqAr5uyA6rCW OHz8Itg6ZgE+iUnbpoNdJyHAK9HRJgRR4iFxqP041M8TGSXePP3KOIFRcgEjwypG8dTS4tz0 1GLDvNRyveLE3OLSvHS95PzcTYzAiDv97/inHYxfLyUdYhTgYFTi4dWY3RYtxJpYVlyZe4hR goNZSYR370KgEG9KYmVValF+fFFpTmrxIUZpDhYlcV4+rbRoIYH0xJLU7NTUgtQimCwTB6dU A2OOy2KPhUHcMxzzD7x68ujTwR0nRd5y1X1sqLhfUJO/TL7e0FNC0rDzhFto/qXOfZyvk+a/ mtBydYP0txVJ31Y+uua1IOZQ/9MEw76emMf8HqIflNrvKj++0LL5yKLJ3Zb3EotaLzAe3nZb VFm74MrTi7dez1ssLZexJv9FUceJxsXSC4+b1UYpsRRnJBpqMRcVJwIA1s5m/7QCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xa7pPDrRFG5y4q26xccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoErY9KSuSwFxyQq/h67wd7AeFqki5GTQ0LAROLxu+nsXYxcHEICSxgl+p5/ZoJwmpgk 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-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-s3c64xx.c | 66 +++---------------------------- 1 file changed, 6 insertions(+), 60 deletions(-) -- 2.17.1 Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski 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);