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: 1841191 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5773EDF266 for ; Wed, 5 Dec 2012 12:13:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243Ab2LEMNN (ORCPT ); Wed, 5 Dec 2012 07:13:13 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:36076 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869Ab2LEMNM (ORCPT ); Wed, 5 Dec 2012 07:13:12 -0500 Received: by mail-ea0-f174.google.com with SMTP id e13so2006732eaa.19 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 Cc: linux-arm-kernel@lists.infradead.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> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.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(); +}