From patchwork Fri May 9 18:53:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gerlach X-Patchwork-Id: 4144811 Return-Path: X-Original-To: patchwork-linux-omap@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 C271FBFF02 for ; Fri, 9 May 2014 18:53:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3CE42034A for ; Fri, 9 May 2014 18:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E827920328 for ; Fri, 9 May 2014 18:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756938AbaEISxg (ORCPT ); Fri, 9 May 2014 14:53:36 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:56691 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754353AbaEISxf (ORCPT ); Fri, 9 May 2014 14:53:35 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s49IrCDN015266; Fri, 9 May 2014 13:53:12 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s49IrCSf015643; Fri, 9 May 2014 13:53:12 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 9 May 2014 13:53:12 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s49IrC10031195; Fri, 9 May 2014 13:53:12 -0500 Received: from localhost (dave-ubuntu.am.dhcp.ti.com [128.247.71.186]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id s49IrCt12835; Fri, 9 May 2014 13:53:12 -0500 (CDT) From: Dave Gerlach To: , CC: Tony Lindgren , Paul Walmsley , Dave Gerlach Subject: [PATCH] ARM: OMAP2+: Remove suspend_set_ops from common pm late init Date: Fri, 9 May 2014 13:53:00 -0500 Message-ID: <1399661580-54599-1-git-send-email-d-gerlach@ti.com> X-Mailer: git-send-email 1.9.0 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 In omap2_common_pm_late_init suspend_set_ops was called to set common suspend handling functions for all omap platforms. This created two problems. First, these suspend ops were being set for all platforms, regardless of whether or not suspend support has been integrated so in the case of AM33XX, suspend to mem was presented as available but failed every time. Second, some platforms will need to define a completely separate set of suspend ops, such as AM33XX, due to differences from previous omap platforms so there is no need to always set the common omap ops. This patch moves the suspend_set_ops call from omap2_common_pm_late_init into a separate function that then gets called in the omap*_pm_init functions for each platform. Signed-off-by: Dave Gerlach --- arch/arm/mach-omap2/common.h | 8 ++++++++ arch/arm/mach-omap2/pm.c | 8 ++++---- arch/arm/mach-omap2/pm24xx.c | 1 + arch/arm/mach-omap2/pm34xx.c | 1 + arch/arm/mach-omap2/pm44xx.c | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index d88aff7..091e1c7 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -162,6 +162,14 @@ static inline void omap44xx_restart(enum reboot_mode mode, const char *cmd) } #endif +#ifdef CONFIG_SUSPEND +void omap_common_suspend_init(void); +#else +static inline void omap_common_suspend_init(void) +{ +} +#endif + /* This gets called from mach-omap2/io.c, do not call this */ void __init omap2_set_globals_tap(u32 class, void __iomem *tap); diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index e1b4141..c9b36fb 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -243,6 +243,10 @@ static const struct platform_suspend_ops omap_pm_ops = { .valid = suspend_valid_only_mem, }; +void __init omap_common_suspend_init(void) +{ + suspend_set_ops(&omap_pm_ops); +} #endif /* CONFIG_SUSPEND */ static void __init omap3_init_voltages(void) @@ -310,9 +314,5 @@ int __init omap2_common_pm_late_init(void) /* cpufreq dummy device instantiation */ omap_init_cpufreq(); -#ifdef CONFIG_SUSPEND - suspend_set_ops(&omap_pm_ops); -#endif - return 0; } diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 8c07594..8cd2408 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c @@ -231,6 +231,7 @@ static void __init prcm_setup_regs(void) #ifdef CONFIG_SUSPEND omap_pm_suspend = omap2_enter_full_retention; + omap_common_suspend_init(); #endif /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 87099bb..32b2597 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -707,6 +707,7 @@ int __init omap3_pm_init(void) #ifdef CONFIG_SUSPEND omap_pm_suspend = omap3_pm_suspend; + omap_common_suspend_init(); #endif arm_pm_idle = omap3_pm_idle; diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index eefb30c..58d7cd7 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -253,6 +253,7 @@ int __init omap4_pm_init(void) #ifdef CONFIG_SUSPEND omap_pm_suspend = omap4_pm_suspend; + omap_common_suspend_init(); #endif /* Overwrite the default cpu_do_idle() */