From patchwork Wed Aug 29 15:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 145451 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp831296ljw; Wed, 29 Aug 2018 08:51:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZv8PzU7GVKAoJS83rifuW4QzJknJODPCSD2mwMzwOLp0W2/b0n7yaE3ZBonjSxJbzcu5hq X-Received: by 2002:a63:9c5:: with SMTP id 188-v6mr6109090pgj.343.1535557866994; Wed, 29 Aug 2018 08:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535557866; cv=none; d=google.com; s=arc-20160816; b=EQn5OgGR2brYfFHjJBjxg6UrgBTzPdiQxgkWP8FpYwykTeigrf8jMCFWsa62Fxkb12 /Q/TlsUN1R8e9yeEHhxJRMx5YsFE9MO4CQKiBh1aeLLiEiaJBLyXmKIDsQ6R0wy6JMJs yljU7RlGspUYg/QmOCMgpWYlPswQB0L1+hZSUpf7Q9xs3pqMEsd9suLX2HzwbrE40+ei Rg4fkYqtsvtVuyT4mERucInjWYz8DfPeIlColrOINYT3JVtl7GbHkdoLAIiZp4qRFif6 XtTn9dACnnxo+BZ6Ua4Xz/vZ56Vw2aNvdd1cLNSSHrEGhwks/ynXU/1H7ymBmldeHSa/ l8zQ== 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=PwIMWaqUxZMX0jTBnJCIfRn7bRV7FDqULB3ToEAwgY4=; b=wQ/BRUhA0wjsWQrMwAwOct9ARLVV6XsHclrBN+Nvgp5jl9WIodtSBZAiMWAadQfgjD yjS8q8UodBpCHq00yr5v17MZoQeNYaB/I6Ui3fcY1dL7eZ8zhcw67BID4/Aw1+h8MVkC jkPs/JkaENNs9fyUoMkRphMF98gwuAGRK2LM5NBkbOc11Q3yDrvlkpnuZjb5RjoXbvCc EIXD0vYQKzwRPA0DSnbjseRSpzvZAR6vCil1xN/cynUetRnC+Q1xmFuQHo6b1PEOLL7x HyknqmeR6+sjt/h2hTNfxOQeHK0NImc1kiRNuYBD/uiqk/tUbKjq+GcXSg6EIdTE6k7v ELfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="mmXTjkI/"; 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.06; Wed, 29 Aug 2018 08:51:06 -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="mmXTjkI/"; 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 S1729256AbeH2Tsh (ORCPT + 3 others); Wed, 29 Aug 2018 15:48:37 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55846 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbeH2Tsg (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 20180829155101euoutp017fbf2814ceaf34246fc614f26a645f81~PZb1TLQXh0242402424euoutp01T; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180829155101euoutp017fbf2814ceaf34246fc614f26a645f81~PZb1TLQXh0242402424euoutp01T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535557861; bh=PwIMWaqUxZMX0jTBnJCIfRn7bRV7FDqULB3ToEAwgY4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=mmXTjkI/pE9YWK+42gzZcDxIfIQNPDXjAIBC1ZI4O7V394fBb3ZX1RS2kZsKnsui4 3cnLCHhZ6W5Bg5RxCeDuAJY3U7euFlg5JrMi8+OWQRibzAViqm1gDt2aO+ubICxIlB nxZ+BLfXROqvMGNJ3h4HRhTgqHfDTtcsJw8aJSOQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829155101eucas1p28757841bab87b3acd0c9dfbba1da288d~PZb0viZP82214922149eucas1p2u; Wed, 29 Aug 2018 15:51:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8E.DB.04294.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 20180829155100eucas1p1ba8149066e026fc15f82091968b78a08~PZbz9ytdH0107901079eucas1p1r; Wed, 29 Aug 2018 15:51:00 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-93-5b86c0e47e0f Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F5.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 04/10] clk: samsung: s3c2443: Use generic helper for handling suspend/resume Date: Wed, 29 Aug 2018 17:50:40 +0200 Message-id: <20180829155046.29359-5-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+NgFprPIsWRmVeSWpSXmKPExsWy7djPc7pPDrRFGxw6ZmixccZ6VovrX56z Wpw/v4Hd4mPPPVaLGef3MVmsPXKX3aL96UtmB3aPTas62Tz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr49/Mz8wFW4QqTi48wdLAuIG/i5GTQ0LARGLbqStMILaQwApGiaUfkrsYuYDsz4wS FzobmGCK+i9PYIJILGOUOHRkHzOE08Ak8ebTTkaQKjYBQ4mut11sILaIgIPE50+vGUGKmAUe M0psPfmVGSQhLBAnsfpzK9hYFgFVif+Hz7F2MXJw8ArYSnyZZQCxTV5i9YYDYOWcAnYSL473 soLMkRD4yirx8NJVRogiF4netVtYIGxhiVfHt7BD2DISlyd3s0A0NDNKtM+YxQ7h9ABdMWcH G0SVtcTh4xdZQWxmAT6JSdumM4NcISHAK9HRJgRR4iGx6MRNFkjATGSUaJ5qPYFRcgEjwypG 8dTS4tz01GKjvNRyveLE3OLSvHS95PzcTYzAaDv97/iXHYy7/iQdYhTgYFTi4b0woy1aiDWx rLgy9xCjBAezkgjv3oVAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rx8WmnRQgLpiSWp2ampBalF MFkmDk6pBsaVTRFOBVpeVrF1L1UCuT8zyNZ4TUjRzQqb/ZPFu2+mNUeSV8D3DxyHedpdb50o /WbbcP3jkV97t/3tUHs/8/LZuC6+xKOKN1ZuqP7+UVuUncvqbfDpq0Hbzz48vTZv7orco/ei s93u3zcJm75uZYZRzCIjzer0dNfcnZYJ+1k7j9vJvvinYKvEUpyRaKjFXFScCABFmyqwsgIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t/xa7pPDrRFG7QdEbDYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV8W/mZ+aCLUIVJxeeYGlg3MDfxcjJISFgItF/eQJTFyMXh5DAEkaJB7vvskM4TUwS T963sIFUsQkYSnS97QKzRQQcJD5/es0IUsQs8JhR4tziDawgCWGBOIlbjU1gNouAqsT/w+eA bA4OXgFbiS+zDCC2yUus3nCAGcTmFLCTeHG8F6xcCKhk4Z3vjBMYeRYwMqxiFEktLc5Nzy02 0itOzC0uzUvXS87P3cQIDJRtx35u2cHY9S74EKMAB6MSD6/BorZoIdbEsuLK3EOMEhzMSiK8 excChXhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgskycXBKNTAequV1 fG60r/7j9UttPTxfPqfXThH4Yub04tXrnJkb/1dl3s8NmMtQFpKg78vhZT7z+5baLNcNpW76 vovXz1kbvigwoHRHQnWa/Im8Wau0Ss/N3cJnl8PeuPFo3MxJDConVny5MVvYrO+v0sWDiyZc e+XCGxvRIFz2g41n863A4jc7r/04suKrEktxRqKhFnNRcSIA0yfHcBACAAA= X-CMS-MailID: 20180829155100eucas1p1ba8149066e026fc15f82091968b78a08 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180829155100eucas1p1ba8149066e026fc15f82091968b78a08 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-s3c2443.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-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index c46e6d5bc9bc..884067e4f1a1 100644 --- a/drivers/clk/samsung/clk-s3c2443.c +++ b/drivers/clk/samsung/clk-s3c2443.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -43,9 +42,6 @@ enum supported_socs { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c2443_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -65,42 +61,6 @@ static unsigned long s3c2443_clk_regs[] __initdata = { SCLKCON, }; -static int s3c2443_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c2443_save, - ARRAY_SIZE(s3c2443_clk_regs)); - - return 0; -} - -static void s3c2443_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c2443_save, - ARRAY_SIZE(s3c2443_clk_regs)); -} - -static struct syscore_ops s3c2443_clk_syscore_ops = { - .suspend = s3c2443_clk_suspend, - .resume = s3c2443_clk_resume, -}; - -static void __init s3c2443_clk_sleep_init(void) -{ - s3c2443_save = samsung_clk_alloc_reg_dump(s3c2443_clk_regs, - ARRAY_SIZE(s3c2443_clk_regs)); - if (!s3c2443_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&s3c2443_clk_syscore_ops); - return; -} -#else -static void __init s3c2443_clk_sleep_init(void) {} -#endif - PNAME(epllref_p) = { "mpllref", "mpllref", "xti", "ext" }; PNAME(esysclk_p) = { "epllref", "epll" }; PNAME(mpllref_p) = { "xti", "mdivclk" }; @@ -450,7 +410,8 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, break; } - s3c2443_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s3c2443_clk_regs, + ARRAY_SIZE(s3c2443_clk_regs)); samsung_clk_of_add_provider(np, ctx);