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: 145452 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp831299ljw; Wed, 29 Aug 2018 08:51:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbI8o++c0Qnv6slcxYzyczN9H1ihdwgAmbLW9lcgVJaxUsPWotBm1jW5ENzP9qGt0YiwPdh X-Received: by 2002:a62:8d84:: with SMTP id p4-v6mr6542800pfk.251.1535557867274; Wed, 29 Aug 2018 08:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535557867; cv=none; d=google.com; s=arc-20160816; b=ekojfZXHXk/SFI66BLB8ysE7Bij6HXQzNjSIk+QVqzlCu5QPVCEpOsagJVk3pYyc+l jExKJemo//75dvBggemFxAzL7f5t5WWe00am6pBi84zsuesMMW+ZDo9E1AYXY4GhU0fW pKsZREXVSLjOTGKqqK1h6uDqkJCGLanC4Zvk4OkfUaS4DtipgN6jjfXNc9G9eDssKkRc Maedhnko37SYexlF2HAsJD7z56gzf73HIN2rVJBjC8XgBrJGChEPT7etxIhxZY/T5WYz br82jSX8w4+YDqEqGjwNGIwmCLMVP7vl0pTjq6yMP/NTZXkxkxALG5mQV794euXNbQ75 8nfg== 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=VabrHE1sLkSCwa3GnzCCPplcOEzJjGW7kjRp3BZkJBw=; b=KAv/gW1KPbPJuNyHLxZ/BcIiZr4FeAH9n0/HlMRMo2XCGWqWuPLpSPo4evJZRjMhX7 gXgBAtp30WveUQvM4yqBhsvaSwtBseQF0krN18R9JW5rTUgGqsou/Euo5kJCM/1UCRff 4CiSzHr7+oM98XYOfF7JCaKNm4X7v7OyI9FALM5ZdbKnD3/jKZ9Z0oQ0NXjHspZ2OvAs vMRG8LLtXANK84dzCAfWRFXg6Kzy32oJtg9sHT3wIb8Payl3zWkbN7pJj7vuhx50RfDk 3NI6cCCPCzB/MezcFGbDnMz5pifbW4tYNLuvcrS3vNG5Q2iIKAWyHKK5IK3Cv2ci2rNw Hvsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="B/0KZwWM"; 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.07; Wed, 29 Aug 2018 08:51:07 -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="B/0KZwWM"; 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 S1729227AbeH2Tsi (ORCPT + 3 others); Wed, 29 Aug 2018 15:48:38 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55854 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729250AbeH2Tsi (ORCPT ); Wed, 29 Aug 2018 15:48:38 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180829155103euoutp01420b005c814aa95052f361d40adbcfa7~PZb2mOoWf0241702417euoutp01T; Wed, 29 Aug 2018 15:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155103euoutp01420b005c814aa95052f361d40adbcfa7~PZb2mOoWf0241702417euoutp01T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557863; bh=VabrHE1sLkSCwa3GnzCCPplcOEzJjGW7kjRp3BZkJBw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=B/0KZwWMCzRjdsZJzasWYNIYJHhSui0On20yBCMHlCqzS9KiNMgVZKUj2QSrHjOIY 8s8YWSuIU3q5o14jn1jDjAtTv9NfEuNUOT/ufFIFyhFVwLQNK0N9DAzriW+rP5mGI9 YeFEIg/BrZJJpZf/03ZJ1OlkoSUf9kQ3DnFEQ8X0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180829155102eucas1p1790d3e0f1a7d38b0256c28fefb2abf0d~PZb11wdNx0107501075eucas1p1z; Wed, 29 Aug 2018 15:51:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id D9.DF.04441.5E0C68B5; Wed, 29 Aug 2018 16:51:02 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88~PZb0-06x_1893718937eucas1p2n; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-e2-5b86c0e55c97 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B2.37.04284.5E0C68B5; Wed, 29 Aug 2018 16:51:01 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PE800FCUC0UPL60@eusync4.samsung.com>; Wed, 29 Aug 2018 16:51:01 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 07/10] clk: samsung: exynos5250: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:43 +0200 Message-id: <20180829155046.29359-8-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180829155046.29359-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsWy7djP87rPDrRFG7wItdg4Yz2rxfUvz1kt zp/fwG7xseceq8WM8/uYLNYeuctu0f70JbMDu8emVZ1sHn1bVjF6fN4kF8AcxWWTkpqTWZZa pG+XwJVxelcfY8F94Yq/rXINjDcEuhg5OSQETCTmXnvC3MXIxSEksIJR4nfXJXYI5zOjxLkF 85hgqlasWAVmCwksY5T41sgFUdTAJLH91QQWkASbgKFE19suNhBbRMBB4vOn14wgRcwCjxkl tp78ygySEBZIlPh8fycjiM0ioCoxc0MXmM0rYCvR8HUZO8Q2eYnVGw6A1XMK2Em8ON7LChH/ yiqx4g4/hO0icfv4Dah6YYlXx7dA2TISnR0HmUAWSwg0M0q0z5jFDuH0AF0xZwcbRJW1xOHj F8GmMgvwSUzaNh1oGwdQnFeio00IosRDou/7SiaINycySjx4tIRtAqPkAkaGVYziqaXFuemp xYZ5qeV6xYm5xaV56XrJ+bmbGIGxdvrf8U87GL9eSjrEKMDBqMTDqzG7LVqINbGsuDL3EKME B7OSCO/ehUAh3pTEyqrUovz4otKc1OJDjNIcLErivHxaadFCAumJJanZqakFqUUwWSYOTqkG xgOMOQIW7SmhZdxyNxaHGP4O2vYsaHV4QLS3lb679cvES2vZJ3nnaC4WvTdtxv+Fm/aqdDVK Hd2fK1yw5OMMDWEFro+1b5n1LXP+l234E1wiOo074/w7T/fZC6R5FquKV2t+vCbG9OBrh8Gp XVd3rwvsnvBfJL+Q9Y79vmdLre492bhvQ+a1SUosxRmJhlrMRcWJAAJDAaCxAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t/xa7pPD7RFGyx5ImWxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4/SuPsaC+8IVf1vlGhhvCHQxcnJICJhIrFixiqmLkYtDSGAJo8S1vp0sEE4Tk8TD JQ/YQarYBAwlut52sYHYIgIOEp8/vWYEKWIWeMwocW7xBlaQhLBAosTn+zsZQWwWAVWJmRu6 wGxeAVuJhq/L2CHWyUus3nCAGcTmFLCTeHG8F6xXCKhm4Z3vjBMYeRYwMqxiFEktLc5Nzy02 1CtOzC0uzUvXS87P3cQIDJRtx35u3sF4aWPwIUYBDkYlHt4LM9qihVgTy4orcw8xSnAwK4nw 7l0IFOJNSaysSi3Kjy8qzUktPsQozcGiJM573qAySkggPbEkNTs1tSC1CCbLxMEp1cCYaRRW megofL3fJNLvkaJG7PTKfbvWtctFLNQ+VbomX5DZoKWsfH3c12irB77y3TIftDk1pjqwPFFT N73AJmPLZbhu48uSaQdONOi9+7nhjpDKmVrTF8e5hO0N35n07g7gUxXia/oppHLWe/YXYXWW KVdXScpOiHlhrx/3lvPh24Vxn3b/v6jEUpyRaKjFXFScCACpq3/gEAIAAA== X-CMS-MailID: 20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88 References: <20180829155046.29359-1-m.szyprowski@samsung.com> Sender: linux-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-exynos5250.c | 42 ++-------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) -- 2.17.1 Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski 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);