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: 145454 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp831312ljw; Wed, 29 Aug 2018 08:51:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbzC+33uvtDJ9Pn7mKw8NEkvahyzKarkzHI6oQrwvoXb4f0ETK6hnaDX+FmWh12g/XtREdA X-Received: by 2002:a62:c699:: with SMTP id x25-v6mr6621734pfk.16.1535557868112; Wed, 29 Aug 2018 08:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535557868; cv=none; d=google.com; s=arc-20160816; b=u+jcQY0ubuh7HVYoPEwAwKO2GNSukF5y3/aBI6FVUgD7RhLfD+iCmPTV2TqvO8UheV f2wnvzgKSEnIzDGd+PxE23GXr0VTYRVGEo8kvgu87jkqZUsU/TR+KOioDjQTCCRssztC oAIC7eOYafaR7XOMTk7KR58usoAxiNwbPhlb9Fr8hq2S2KFdnXmLGKO1KsDNf2YbQdtt y4jinvpje93a1vwmxkckWO8ZDy8yllRaMQzbwqcDNLkElfxIpIqoc0SnwcLWJgC4z3fX v8AOpsG7YHCiby3NssrW8QSVkypo2mAs6OC5hV3Mwl/idHClCuyYXKk0T8vDHsdwuLGi a+nQ== 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=Q9uhlE382LBHHSiqnvSM3mlLkFzoBC4lKxDmhF6BdmM=; b=fxa4AqNKBG+RGF6TxC2iDMFa7E0I00V5YAP1H5/kB1FxcoQa9nbKGFP2+VPbvhcaX+ zrXEeClFtwk97QPnotBlc+eoxoaSFGHfKCjque/81RW2bPeNYK33Z5zqlaKEDgju8f2x SV0nFAQa7pD4f9uoH0XoEynyt9F12K6OnwAIf1YTz4nvIn8Th3UPSmGyTWZ/fBaN3i/4 kUiD8tok6Tay+v9KpsiosOMiwFCd+xca5VHTut8rZ8HXyTNGhcjR/R5FBbWVF/L3CjgM xB/dI18478ZwC9Kb0VYNW4P189XqWEU8sLcAuIRUijaiSElNBl+Um7mMHP3xI13xbZgp f7bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sbyd0vcJ; 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:08 -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=sbyd0vcJ; 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 S1729229AbeH2Tsi (ORCPT + 3 others); 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-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-s5pv210.c | 41 ++----------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) -- 2.17.1 Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski 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);