From patchwork Fri Jul 26 03:17:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 262030 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 587362C00F8 for ; Fri, 26 Jul 2013 13:18:23 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2YXo-0006GL-TF; Fri, 26 Jul 2013 03:18:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2YXm-0004vc-BA; Fri, 26 Jul 2013 03:18:14 +0000 Received: from mail-gh0-x229.google.com ([2607:f8b0:4002:c05::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2YXj-0004uj-E6 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 03:18:12 +0000 Received: by mail-gh0-f169.google.com with SMTP id r1so738848ghr.28 for ; Thu, 25 Jul 2013 20:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=nO3kjcXkbuFqXDS8xX9PEslpkkn2oWuD+pXZUzheypw=; b=oRzO+BmD8cGqykcvfe+WLDBf+CLad+xKCrIUHonjkt2blg4uQQ2gHWrj0Ydjg++RDi sDRP5/a1rMW8MYstxLhwtJp42lbv8TlfTFWFTF1IyPAKpAZ/F2eze2ugf5HVlRrJwTT8 hCHqRMgLY0C9JwVpCAYpXYF2gxFFbQbXsuQNkipNUdp0F9Zw/7gwYHVkvsOqKoAto6mL 0sjS6r77F3qSge2W/16uhoyRF7G7Xr6IHjyrUlakQP/Crm/8FDxcBYW9GYmsWBe4hMhN q36P2fc3vBZmqD+zfdc0rIyLNm/L0/Csa5uZ32xvCX0fdkWW8LHeJntV+QkZdzAUFtZ0 7voA== X-Received: by 10.236.79.197 with SMTP id i45mr13066824yhe.17.1374808666586; Thu, 25 Jul 2013 20:17:46 -0700 (PDT) Received: from localhost.localdomain ([177.194.44.29]) by mx.google.com with ESMTPSA id i4sm62426242yhg.16.2013.07.25.20.17.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 20:17:46 -0700 (PDT) From: Fabio Estevam To: shawn.guo@linaro.org Subject: [PATCH 2/2] ARM: mx53: Allow suspend/resume Date: Fri, 26 Jul 2013 00:17:36 -0300 Message-Id: <1374808656-28609-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374808656-28609-1-git-send-email-festevam@gmail.com> References: <1374808656-28609-1-git-send-email-festevam@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130725_231811_533465_2CEE4A5E X-CRM114-Status: GOOD ( 12.48 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Fabio Estevam , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Fabio Estevam Current imx53_pm_init() implementation is incomplete as it lacks calling suspend_set_ops(). Use a single imx5_pm_init() function to handle both mx51 and mx53. This allows mx53 to enter in low-power mode. Tested on a mx53qsb: root@freescale /$ echo mem > /sys/power/state PM: Syncing filesystems ... done. mmc0: card e624 removed Freezing user space processes ... (elapsed 0.001 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. Suspending console(s) (use no_console_suspend to debug) ... (Press Power button) PM: suspend of devices complete after 17.067 msecs PM: suspend devices took 0.020 seconds PM: late suspend of devices complete after 0.954 msecs PM: noirq suspend of devices complete after 1.288 msecs Disabling non-boot CPUs ... PM: noirq resume of devices complete after 0.680 msecs PM: early resume of devices complete after 0.914 msecs PM: resume of devices complete after 44.955 msecs PM: resume devices took 0.050 seconds Restarting tasks ... done. mmc0: host does not support reading read-only switch. assuming write-enable. mmc0: new SDHC card at address e624 mmcblk0: mmc0:e624 SU04G 3.69 GiB mmcblk0: p1 p2 p3 libphy: 63fec000.etherne:00 - Link is Down libphy: 63fec000.etherne:00 - Link is Up - 100/Full root@freescale /$ Signed-off-by: Fabio Estevam --- arch/arm/mach-imx/common.h | 6 ++---- arch/arm/mach-imx/mm-imx5.c | 4 ++-- arch/arm/mach-imx/pm-imx5.c | 7 +------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index b96aff7..cdc9288 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -147,12 +147,10 @@ extern int imx_cpu_kill(unsigned int cpu); #ifdef CONFIG_PM extern void imx6q_pm_init(void); -extern void imx51_pm_init(void); -extern void imx53_pm_init(void); +extern void imx5_pm_init(void); #else static inline void imx6q_pm_init(void) {} -static inline void imx51_pm_init(void) {} -static inline void imx53_pm_init(void) {} +static inline void imx5_pm_init(void) {} #endif #ifdef CONFIG_NEON diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c index cf193d8..a8229b7 100644 --- a/arch/arm/mach-imx/mm-imx5.c +++ b/arch/arm/mach-imx/mm-imx5.c @@ -153,10 +153,10 @@ void __init imx51_soc_init(void) void __init imx51_init_late(void) { mx51_neon_fixup(); - imx51_pm_init(); + imx5_pm_init(); } void __init imx53_init_late(void) { - imx53_pm_init(); + imx5_pm_init(); } diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c index 82e79c6..58aeaf5 100644 --- a/arch/arm/mach-imx/pm-imx5.c +++ b/arch/arm/mach-imx/pm-imx5.c @@ -169,14 +169,9 @@ static int __init imx5_pm_common_init(void) return imx5_cpuidle_init(); } -void __init imx51_pm_init(void) +void __init imx5_pm_init(void) { int ret = imx5_pm_common_init(); if (!ret) suspend_set_ops(&mx5_suspend_ops); } - -void __init imx53_pm_init(void) -{ - imx5_pm_common_init(); -}