From patchwork Thu Jul 9 15:20:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 34830 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n69FNT0H028496 for ; Thu, 9 Jul 2009 15:23:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759503AbZGIPX4 (ORCPT ); Thu, 9 Jul 2009 11:23:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759667AbZGIPX4 (ORCPT ); Thu, 9 Jul 2009 11:23:56 -0400 Received: from mail-pz0-f175.google.com ([209.85.222.175]:49517 "EHLO mail-pz0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759503AbZGIPXz (ORCPT ); Thu, 9 Jul 2009 11:23:55 -0400 Received: by mail-pz0-f175.google.com with SMTP id 5so164114pzk.33 for ; Thu, 09 Jul 2009 08:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=kzqv9AttVXor7Ap8v2jgnvQKTJhx1dalR6iKotaZnNs=; b=FxuwNRq2hpwTZDSGO4Yqy65k1n9SX698hd8ANASCJ+3HI6Ghpb4bq33jDMfkJOBiy9 raWRF2TcwtxMWATAVzxtBu1kBgHpYQ8qsvKz781kPp5ATmPiWIMZWQWJ8X3TzciCPqlr b2jp+BosTHhD6D827pJ6BwbvbUxHt/eHs0oZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=ilzsj1OeG7p+79dOnJ5FKQatc3pZTrcxV5/KKpPk/RczNV5fLC/XcoOkH19fCsKrX7 Lqz0lc1Z5IZGk1yskzBg5SNB4+w4C0SSSPLYVZJB43PL/THMAoO5tayC/nE2LeUHBb+i W8fxQd64bbeaiqA0MIE2aTa7QWi2PaJUTepFk= Received: by 10.143.34.20 with SMTP id m20mr405801wfj.103.1247153035610; Thu, 09 Jul 2009 08:23:55 -0700 (PDT) Received: from rx1.opensource.se (58x80x213x53.ap58.ftth.ucom.ne.jp [58.80.213.53]) by mx.google.com with ESMTPS id 30sm10669686wfg.30.2009.07.09.08.23.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Jul 2009 08:23:54 -0700 (PDT) From: Magnus Damm To: linux-pm@lists.linux-foundation.org Cc: linux-sh@vger.kernel.org, gregkh@suse.de, rjw@sisk.pl, lethal@linux-sh.org, stern@rowland.harvard.edu, pavel@ucw.cz, Magnus Damm Date: Fri, 10 Jul 2009 00:20:02 +0900 Message-Id: <20090709152002.8385.30419.sendpatchset@rx1.opensource.se> In-Reply-To: <20090709151926.8385.92800.sendpatchset@rx1.opensource.se> References: <20090709151926.8385.92800.sendpatchset@rx1.opensource.se> Subject: [PATCH 04/06] sh: Runtime PM for sh7722 and Migo-R Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch contains sh7722 processor specific Runtime PM code along with some Migo-R board code that deals with sh7722. For each platform device within the SoC a hwblk id is added to the architecture specific platform device data area. The hwblk code for sh7722 which is invoked by cpuidle is extended in a hackish way to tell the system to start driver suspending. Signed-off-by: Magnus Damm --- arch/sh/boards/mach-migor/setup.c | 9 +++++++++ arch/sh/kernel/cpu/sh4a/hwblk-sh7722.c | 10 +++++++++- arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/sh/boards/mach-migor/setup.c +++ work/arch/sh/boards/mach-migor/setup.c 2009-07-09 18:43:42.000000000 +0900 @@ -98,6 +98,9 @@ static struct platform_device sh_keysc_d .dev = { .platform_data = &sh_keysc_info, }, + .archdata = { + .hw_blk_id = HWBLK_KEYSC, + }, }; static struct mtd_partition migor_nor_flash_partitions[] = @@ -292,6 +295,9 @@ static struct platform_device migor_lcdc .dev = { .platform_data = &sh_mobile_lcdc_info, }, + .archdata = { + .hw_blk_id = HWBLK_LCDC, + }, }; static struct clk *camera_clk; @@ -379,6 +385,9 @@ static struct platform_device migor_ceu_ .dev = { .platform_data = &sh_mobile_ceu_info, }, + .archdata = { + .hw_blk_id = HWBLK_CEU, + }, }; struct spi_gpio_platform_data sdcard_cn9_platform_data = { --- 0005/arch/sh/kernel/cpu/sh4a/hwblk-sh7722.c +++ work/arch/sh/kernel/cpu/sh4a/hwblk-sh7722.c 2009-07-09 18:44:44.000000000 +0900 @@ -89,10 +89,18 @@ static struct hwblk_info sh7722_hwblk_in .nr_hwblks = ARRAY_SIZE(sh7722_hwblk), }; +void platform_pm_runtime_suspend_idle(void); /* FIXME */ + int arch_hwblk_sleep_mode(void) { - if (!sh7722_hwblk_area[CORE_AREA].cnt[HWBLK_CNT_USAGE]) + if (!sh7722_hwblk_area[CORE_AREA].cnt[HWBLK_CNT_USAGE]) { + if (sh7722_hwblk_area[CORE_AREA].cnt[HWBLK_CNT_IDLE]) + platform_pm_runtime_suspend_idle(); + else + return SUSP_SH_USTANDBY | SUSP_SH_SF; + return SUSP_SH_STANDBY | SUSP_SH_SF; + } if (!sh7722_hwblk_area[CORE_AREA_BM].cnt[HWBLK_CNT_USAGE]) return SUSP_SH_SLEEP | SUSP_SH_SF; --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7722.c 2009-07-09 18:43:36.000000000 +0900 @@ -16,6 +16,7 @@ #include #include #include +#include static struct resource rtc_resources[] = { [0] = { @@ -45,6 +46,9 @@ static struct platform_device rtc_device .id = -1, .num_resources = ARRAY_SIZE(rtc_resources), .resource = rtc_resources, + .archdata = { + .hw_blk_id = HWBLK_RTC, + }, }; static struct resource usbf_resources[] = { @@ -70,6 +74,9 @@ static struct platform_device usbf_devic }, .num_resources = ARRAY_SIZE(usbf_resources), .resource = usbf_resources, + .archdata = { + .hw_blk_id = HWBLK_USBF, + }, }; static struct resource iic_resources[] = { @@ -91,6 +98,9 @@ static struct platform_device iic_device .id = 0, /* "i2c0" clock */ .num_resources = ARRAY_SIZE(iic_resources), .resource = iic_resources, + .archdata = { + .hw_blk_id = HWBLK_IIC, + }, }; static struct uio_info vpu_platform_data = { @@ -119,6 +129,9 @@ static struct platform_device vpu_device }, .resource = vpu_resources, .num_resources = ARRAY_SIZE(vpu_resources), + .archdata = { + .hw_blk_id = HWBLK_VPU, + }, }; static struct uio_info veu_platform_data = { @@ -147,6 +160,9 @@ static struct platform_device veu_device }, .resource = veu_resources, .num_resources = ARRAY_SIZE(veu_resources), + .archdata = { + .hw_blk_id = HWBLK_VEU, + }, }; static struct uio_info jpu_platform_data = { @@ -175,6 +191,9 @@ static struct platform_device jpu_device }, .resource = jpu_resources, .num_resources = ARRAY_SIZE(jpu_resources), + .archdata = { + .hw_blk_id = HWBLK_JPU, + }, }; static struct sh_timer_config cmt_platform_data = { @@ -207,6 +226,9 @@ static struct platform_device cmt_device }, .resource = cmt_resources, .num_resources = ARRAY_SIZE(cmt_resources), + .archdata = { + .hw_blk_id = HWBLK_CMT, + }, }; static struct sh_timer_config tmu0_platform_data = { @@ -238,6 +260,9 @@ static struct platform_device tmu0_devic }, .resource = tmu0_resources, .num_resources = ARRAY_SIZE(tmu0_resources), + .archdata = { + .hw_blk_id = HWBLK_TMU, + }, }; static struct sh_timer_config tmu1_platform_data = { @@ -269,6 +294,9 @@ static struct platform_device tmu1_devic }, .resource = tmu1_resources, .num_resources = ARRAY_SIZE(tmu1_resources), + .archdata = { + .hw_blk_id = HWBLK_TMU, + }, }; static struct sh_timer_config tmu2_platform_data = { @@ -299,6 +327,9 @@ static struct platform_device tmu2_devic }, .resource = tmu2_resources, .num_resources = ARRAY_SIZE(tmu2_resources), + .archdata = { + .hw_blk_id = HWBLK_TMU, + }, }; static struct plat_sci_port sci_platform_data[] = {