From patchwork Thu Feb 6 19:12:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3598051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 308D3BF418 for ; Thu, 6 Feb 2014 19:22:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35417200FF for ; Thu, 6 Feb 2014 19:22:31 +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 31D7A200FE for ; Thu, 6 Feb 2014 19:22:30 +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 1WBUQD-0006vM-MJ; Thu, 06 Feb 2014 19:15:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBUPV-0000mo-IF; Thu, 06 Feb 2014 19:14:53 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBUOH-0000cK-4A for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 19:13:41 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0L00J289DT6LB0@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 19:13:05 +0000 (GMT) X-AuditID: cbfec7f5-b7fc96d000004885-3c-52f3dec54885 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 60.84.18565.5CED3F25; Thu, 06 Feb 2014 19:13:09 +0000 (GMT) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0L002UD9DPUJ50@eusync4.samsung.com>; Thu, 06 Feb 2014 19:13:09 +0000 (GMT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 10/12] ARM: EXYNOS: Remove PM initcalls and useless indirection Date: Thu, 06 Feb 2014 20:12:55 +0100 Message-id: <1391713977-22300-11-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.5.2 In-reply-to: <1391713977-22300-1-git-send-email-t.figa@samsung.com> References: <1391713977-22300-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmluLIzCtJLcpLzFFi42I5/e/4Nd2j9z4HGVzr4rH4O+kYu8XZZQfZ LHoXXGWzONv0ht1i0+NrrBYzzu9jslh75C67xanrn9ks1s94zeLA6fH71yRGj9kNF1k8Ni+p 97hyoonVo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDK+X+pmKVgmWfFv5x72Bsb5ol2MnBwS AiYSrya1sEDYYhIX7q1n62Lk4hASWMooMa3xIROE08ckcW/7bUaQKjYBNYnPDY/YQGwRAVWJ z20L2EFsZoHNTBJrjjiB2MICIRJzTn4Cq2cBqtlx7iuYzSvgLDHn5yygeg6gbQoSq68LgYQ5 gcLtE3YwgdhCAk4Sdy/fY5/AyLuAkWEVo2hqaXJBcVJ6rpFecWJucWleul5yfu4mRkjAfd3B uPSY1SFGAQ5GJR5exRWfg4RYE8uKK3MPMUpwMCuJ8NreAQrxpiRWVqUW5ccXleakFh9iZOLg lGpgPKYp8G3S3WrJC9m3iz+5vF+iF7NdfMXUEv1G7wdiGjovXe7pHWE9IFMl4uT5RakpepWG 3dmrbsdeW/vNu/hJ18b0/+50STm2B9KfZN7NFTu26m2Q712/8KMpLu4qTAcve+fYO/RP5/D8 fbxwwcPua2l8l3wntQiefMjWm7Ti0+bZcqp6rcwKSizFGYmGWsxFxYkAsva/+RYCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140206_141337_322592_AF9526FD X-CRM114-Status: GOOD ( 12.41 ) X-Spam-Score: -7.4 (-------) Cc: Kukjin Kim , Arnd Bergmann , Tomasz Figa , Doug Anderson , Kyungmin Park , Olof Johansson , linux-arm-kernel@lists.infradead.org, Marek Szyprowski 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 Acked-by: Kyungmin Park --- 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 f18be40..fb4e7dc 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -315,6 +315,7 @@ void __init exynos_init_late(void) return; pm_genpd_poweroff_unused(); + 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 f76967b..82e08fb 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -27,6 +27,12 @@ void exynos_init_late(void); void exynos_firmware_init(void); +#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 ba18214..596ed13 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);