From patchwork Tue Dec 24 14:14:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3403461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E1CFC9F169 for ; Tue, 24 Dec 2013 14:20:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3C832038C for ; Tue, 24 Dec 2013 14:20:43 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7773E20237 for ; Tue, 24 Dec 2013 14:20:42 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VvSpo-0004o5-Ny; Tue, 24 Dec 2013 14:19:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VvSpd-0005dY-GK; Tue, 24 Dec 2013 14:19:37 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VvSlo-00058e-B2 for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2013 14:15:45 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MYB00DAVE99LA60@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2013 14:15:09 +0000 (GMT) X-AuditID: cbfec7f4-b7f796d000005a13-cd-52b996ed693a Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id B7.19.23059.DE699B25; Tue, 24 Dec 2013 14:15:09 +0000 (GMT) Received: from amdc1227.digital.local ([106.116.147.199]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MYB00MNYE90WR00@eusync2.samsung.com>; Tue, 24 Dec 2013 14:15:09 +0000 (GMT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH RFC 09/11] ARM: EXYNOS: Remove PM initcalls and useless indirection Date: Tue, 24 Dec 2013 15:14:32 +0100 Message-id: <1387894474-14428-9-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.4.3 In-reply-to: <1387894474-14428-1-git-send-email-t.figa@samsung.com> References: <1387894474-14428-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsVy+t/xK7pvp+0MMnh3QNji76Rj7Ba9C66y WWx6fI3VYsb5fUwWp65/ZrNYP+M1iwObx+9fkxg9Ni+p97hyoonVo2/LKkaPz5vkAlijuGxS UnMyy1KL9O0SuDIerb7MVjBTsmJRv1ED40TRLkZODgkBE4mNbYeYIWwxiQv31rOB2EICSxkl jizm6GLkArL7mCTuHu5lBUmwCahJfG54BFYkIqAq8bltATtIEbPAJkaJz7sPgxUJC4RKrLpx EGwqC1DRzhN/gIo4OHgFnCT27fCCWKYg0bnmPyOIzSngLHH102V2iMVOEp8vvWaewMi7gJFh FaNoamlyQXFSeq6hXnFibnFpXrpecn7uJkZIGH3Zwbj4mNUhRgEORiUe3oLSHUFCrIllxZW5 hxglOJiVRHivKO4MEuJNSaysSi3Kjy8qzUktPsTIxMEp1cCYdko+/5g2/7nnN1cqF+q8yzgh VbIy4AOnTs7KxVqLnRh0Dd403rkof4Pr+V6XE6LMU3jyjjyQdGT5ZfhN+35XY1XlzF2qwo21 fmzWfQ3fnkznP7v5v/Cq/fNsepVML0/qZo0+xTplgt7nrHPyQtk/ta3L3aWkF1l90evwtHjp stVacHvLRmYlluKMREMt5qLiRAC/WJ2qAQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131224_091540_552359_55E9EADF X-CRM114-Status: GOOD ( 12.30 ) X-Spam-Score: -7.5 (-------) Cc: Olof Johansson , Tomasz Figa , Kukjin Kim , Arnd Bergmann , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch simplifies Exynos PM initialization and makes it multiplatform friendly by replacing initcalls used originally to invoke all the initialization code with explicit function calls. In addition, an useless subsys_interface is removed, as all its .add_dev callback did was setting two function pointers. Signed-off-by: Tomasz Figa --- arch/arm/mach-exynos/common.c | 1 + arch/arm/mach-exynos/common.h | 6 ++++++ arch/arm/mach-exynos/pm.c | 50 +++++++++++-------------------------------- 3 files changed, 19 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 61d2906..0e3f371 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -310,6 +310,7 @@ void __init exynos_init_late(void) return; exynos_pm_late_initcall(); + exynos_pm_init(); } static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname, diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index ff9b6a9..f2d1892 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -32,6 +32,12 @@ int exynos_pm_late_initcall(void); static inline int exynos_pm_late_initcall(void) { return 0; } #endif +#ifdef CONFIG_PM_SLEEP +extern void __init exynos_pm_init(void); +#else +static inline void exynos_pm_init(void) {} +#endif + extern struct smp_operations exynos_smp_ops; extern void exynos_cpu_die(unsigned int cpu); diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 78a22bf..8cdb000 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -92,39 +92,6 @@ static void exynos_pm_prepare(void) __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0); } -static int exynos_pm_add(struct device *dev, struct subsys_interface *sif) -{ - pm_cpu_prep = exynos_pm_prepare; - pm_cpu_sleep = exynos_cpu_suspend; - - return 0; -} - -static struct subsys_interface exynos_pm_interface = { - .name = "exynos_pm", - .subsys = &exynos_subsys, - .add_dev = exynos_pm_add, -}; - -static __init int exynos_pm_drvinit(void) -{ - unsigned int tmp; - - if (soc_is_exynos5440()) - return 0; - - s3c_pm_init(); - - /* All wakeup disable */ - - tmp = __raw_readl(S5P_WAKEUP_MASK); - tmp |= ((0xFF << 8) | (0x1F << 1)); - __raw_writel(tmp, S5P_WAKEUP_MASK); - - return subsys_interface_register(&exynos_pm_interface); -} -arch_initcall(exynos_pm_drvinit); - static int exynos_pm_suspend(void) { unsigned long tmp; @@ -220,12 +187,19 @@ static struct syscore_ops exynos_pm_syscore_ops = { .resume = exynos_pm_resume, }; -static __init int exynos_pm_syscore_init(void) +void __init exynos_pm_init(void) { - if (soc_is_exynos5440()) - return 0; + u32 tmp; + + pm_cpu_prep = exynos_pm_prepare; + pm_cpu_sleep = exynos_cpu_suspend; + + s3c_pm_init(); + + /* All wakeup disable */ + tmp = __raw_readl(S5P_WAKEUP_MASK); + tmp |= ((0xFF << 8) | (0x1F << 1)); + __raw_writel(tmp, S5P_WAKEUP_MASK); register_syscore_ops(&exynos_pm_syscore_ops); - return 0; } -arch_initcall(exynos_pm_syscore_init);