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: 145455 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp831320ljw; Wed, 29 Aug 2018 08:51:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZRGMkVIZN/QnkTdGOGRBZXqEyD99TGUru4ilCkeJJk6efn9mhJkpHGEO0lFLKFN37vTeQM X-Received: by 2002:a63:990a:: with SMTP id d10-v6mr6286176pge.80.1535557868634; 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=oRU/2Gi8SVsrrQ9jZokfDUuPY7vBmGoLyIbw/pxwFe7N1pw7xBhc6efq+DxiR2ugeQ 1usKuMXQLyatscX0pTfjWNlA8i3PWz7u2TmOODycm5YyC2K2fsourEHXK7QD/0K2N7dn KbwsIDrc1OJBuImSjenh3WbejXP8J2p3YC0rn60xmleVqplA/21XsdfszySXNWYk9I0D bNHVhxDNHpWMsZN/oEzC2bjfqscVvZgKRv9gSWtb4M9YOyewzrlYOw3brv5dIQWp7qar F/fdypH0tO2Wl9kH7mnfnuQJp+BxGmFEuhIGECYdirImRZ3SPmff4AC6FHlrntOUkHJ7 idVg== 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=u7ouEIbdPA0jpQSFbzOINyEQmSN+NmNxxnLK0fTpLfA=; b=SZ33d9KNnfjYaFjyOgvO4mcCDs6WbQckgMsXBEBk6P6ziYcBYw3a/jma+ANxtiEfQ2 5VixeqK4guaXLn9NnqjpPPUU6KmKQudfkd8VJrIzdrjxnToQwRSOO2J9Ejk7DfGBtqqr ku2fB8voEtlADd3YcVK6pmCGpD9oJKLCd2q5YruZf1ydmlxwhmnLq3CQ2HcRYbi4qBZ0 Z45v9kUOpOMT7waqnHArjN0qmrSMGoRsxsDMyFg1GT175tHA6ZO0fQeWUKaKszkih5ha BSk8XaauRxJF3S9l0ERpUuzmQ2yAnVZpi8Us61GJCIhR4vrGilelY9POhZzDFgJzaBKV jrVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=SqFmpG6z; 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.08; 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=SqFmpG6z; 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 S1729046AbeH2Tsh (ORCPT + 3 others); 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 WqRvl8CVsXr9JeaC7UIVh671MDUwruHvYuTkkBAwkdiw9wNrFyMXh5DACkaJR9MXQzmfGSWe 9F1ihqna+ukKG0RiGaPEgo9/mCCcBiaJz7P+soBUsQkYSnS97WIDsUUEHCQ+f3rNCFLELPCY UWLrya9go4QF4iQWz3wIVsQioCpxd+M3sGZeAVuJjnsz2CDWyUus3nAArJ5TwE7ixfFesJsk BL6ySrQt+c8EUeQisbvxHDuELSzx6vgWKFtG4vLkbhaIhmZGifYZs9ghnB6gM+bsgFphLXH4 +EVWEJtZgE9i0rbpQOs4gOK8Eh1tQhAlHhKvtxxngfhzIqPEsWl72SYwSi5gZFjFKJ5aWpyb nlpsnJdarlecmFtcmpeul5yfu4kRGHOn/x3/uoNx35+kQ4wCHIxKPLwXZrRFC7EmlhVX5h5i lOBgVhLh3bsQKMSbklhZlVqUH19UmpNafIhRmoNFSZyXTystWkggPbEkNTs1tSC1CCbLxMEp 1cCYrP9AY4E51xkR+9NPHxi9astNqTXea3uzR2Xzj4i86cwrQze5qR87eOCo+pLzFaaxazcJ +Sm725yIiaj1N7OeEvAqrFu+XSJ4WfR3/SuX90vGfoqYucuocNr6pgdnHVZdO3F4yY43UUzT rZe3bCu1mpkTtJc7jGF5RWqyxfdN76IPHlfYtXiqEktxRqKhFnNRcSIAhoFoVLUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xa7qPD7RFGzy+YWSxccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoErY/X6S8wF24UqDl3rYWpgXMPfxcjJISFgIrH10xW2LkYuDiGBJYwSDYeWMUI4TUwS z7+uZQepYhMwlOh628UGYosIOEh8/vQarIhZ4DGjxLnFG1hBEsICcRINRy8wgdgsAqoSdzd+ YwGxeQVsJTruzWCDWCcvsXrDAWYQm1PATuLF8V6wXiGgmoV3vjNOYORZwMiwilEktbQ4Nz23 2EivODG3uDQvXS85P3cTIzBUth37uWUHY9e74EOMAhyMSjy8BovaooVYE8uKK3MPMUpwMCuJ 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-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-s3c2412.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-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);