From patchwork Wed Dec 5 12:13:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Hecht X-Patchwork-Id: 1841201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8A275DF266 for ; Wed, 5 Dec 2012 12:18:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TgDqu-0001sQ-3H; Wed, 05 Dec 2012 12:13:24 +0000 Received: from mail-ea0-f177.google.com ([209.85.215.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TgDqj-0001rD-5t for linux-arm-kernel@lists.infradead.org; Wed, 05 Dec 2012 12:13:14 +0000 Received: by mail-ea0-f177.google.com with SMTP id c10so1994861eaa.36 for ; Wed, 05 Dec 2012 04:13:11 -0800 (PST) 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=zEdtZTUkPdbxPBPX+sAQDAmHgUlsjZdlfczDvdsIGgk=; b=vILdG1wQvTOb9NHh68Zu0uhRCdhih6YcocWeGNU0bdujvJP07nAFWMweYN1M7e2ctn uQHyCis93R5Eurd+uhiYHRP7nB7o2k1TkHl26dPQmkKBjnHbHnuP3OH5AAYrSUf04kyR heraRF5gmyIG5tfmiyw98ehdVSkf1gncXxqjSDWsGWgHDw4vhwNDPnRofCZ1uhEg3iAw LI1Qdyl3HHf5p4U3Or9xpj/Mr60dmMwussSytAKFUa+eL0ZmT0CMow3adxLAhBuHliet 4BlCPjoGafvjSsPRQUeqcU+nBzKnAYqWlOfG2fxC1WqyKMg4Nu7N4aQjy3RJzk9Ido6I prvQ== Received: by 10.14.215.194 with SMTP id e42mr60235177eep.32.1354709591454; Wed, 05 Dec 2012 04:13:11 -0800 (PST) Received: from localhost.localdomain (p4FD26911.dip.t-dialin.net. [79.210.105.17]) by mx.google.com with ESMTPS id y44sm8865119eel.14.2012.12.05.04.13.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Dec 2012 04:13:10 -0800 (PST) From: Bastian Hecht To: linux-sh@vger.kernel.org Subject: [PATCH 2/2] ARM: shmobile: r8a7740: Add CPU sleep suspend Date: Wed, 5 Dec 2012 13:13:07 +0100 Message-Id: <1354709587-25288-2-git-send-email-hechtb+renesas@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1354709587-25288-1-git-send-email-hechtb+renesas@gmail.com> References: <1354709587-25288-1-git-send-email-hechtb+renesas@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121205_071313_544025_D4CEDAA7 X-CRM114-Status: GOOD ( 12.73 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hechtb[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: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Bastian Hecht Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system. Signed-off-by: Bastian Hecht Acked-by: Magnus Damm --- arch/arm/mach-shmobile/board-armadillo800eva.c | 2 ++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/pm-r8a7740.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 3cc8b1c..48847f6 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -1213,6 +1213,8 @@ static void __init eva_init(void) rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device); if (usb) rmobile_add_device_to_domain("A3SP", usb); + + r8a7740_pm_init(); } static void __init eva_earlytimer_init(void) diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index 318551b3..ebcd28d 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h @@ -66,6 +66,7 @@ extern void r8a7740_add_early_devices(void); extern void r8a7740_add_standard_devices(void); extern void r8a7740_clock_init(u8 md_ck); extern void r8a7740_pinmux_init(void); +extern void r8a7740_pm_init(void); extern void r8a7779_init_irq(void); extern void r8a7779_map_io(void); diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c index 21e5316d..8cfb5bc 100644 --- a/arch/arm/mach-shmobile/pm-r8a7740.c +++ b/arch/arm/mach-shmobile/pm-r8a7740.c @@ -58,3 +58,23 @@ void __init r8a7740_init_pm_domains(void) } #endif /* CONFIG_PM */ + +#ifdef CONFIG_SUSPEND +static int r8a7740_enter_suspend(suspend_state_t suspend_state) +{ + cpu_do_idle(); + return 0; +} + +static void r8a7740_suspend_init(void) +{ + shmobile_suspend_ops.enter = r8a7740_enter_suspend; +} +#else +static void r8a7740_suspend_init(void) {} +#endif + +void __init r8a7740_pm_init(void) +{ + r8a7740_suspend_init(); +}