From bacd8d15e8e7d50eedda3348523f88d3b27ffef7 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 5 Jul 2012 01:25:58 -0700 Subject: [PATCH] --- yaml --- r: 319262 b: refs/heads/master c: 8459293c27bcd13aabacb7ee8097f6818f2ceedb h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-shmobile/Makefile | 1 + .../arm/mach-shmobile/include/mach/r8a7740.h | 6 ++++ trunk/arch/arm/mach-shmobile/pm-r8a7740.c | 30 +++++++++++++++++++ trunk/arch/arm/mach-shmobile/setup-r8a7740.c | 5 ++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 trunk/arch/arm/mach-shmobile/pm-r8a7740.c diff --git a/[refs] b/[refs] index 91f8e14a3e79..44b319ff70df 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 444c5ed8d746140cd8f5591f708e5f1f84a9876e +refs/heads/master: 8459293c27bcd13aabacb7ee8097f6818f2ceedb diff --git a/trunk/arch/arm/mach-shmobile/Makefile b/trunk/arch/arm/mach-shmobile/Makefile index 3ffe4126922f..0df5ae6740c6 100644 --- a/trunk/arch/arm/mach-shmobile/Makefile +++ b/trunk/arch/arm/mach-shmobile/Makefile @@ -41,6 +41,7 @@ obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_ARCH_SHMOBILE) += pm-rmobile.o obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o +obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o # Board objects diff --git a/trunk/arch/arm/mach-shmobile/include/mach/r8a7740.h b/trunk/arch/arm/mach-shmobile/include/mach/r8a7740.h index 8bd7b9c136a1..e8c87e92a60d 100644 --- a/trunk/arch/arm/mach-shmobile/include/mach/r8a7740.h +++ b/trunk/arch/arm/mach-shmobile/include/mach/r8a7740.h @@ -19,6 +19,8 @@ #ifndef __ASM_R8A7740_H__ #define __ASM_R8A7740_H__ +#include + /* * MD_CKx pin */ @@ -604,4 +606,8 @@ enum { SHDMA_SLAVE_USBHS_RX, }; +#ifdef CONFIG_PM +extern struct rmobile_pm_domain r8a7740_pd_a4s; +#endif /* CONFIG_PM */ + #endif /* __ASM_R8A7740_H__ */ diff --git a/trunk/arch/arm/mach-shmobile/pm-r8a7740.c b/trunk/arch/arm/mach-shmobile/pm-r8a7740.c new file mode 100644 index 000000000000..d2fe81570a74 --- /dev/null +++ b/trunk/arch/arm/mach-shmobile/pm-r8a7740.c @@ -0,0 +1,30 @@ +/* + * r8a7740 power management support + * + * Copyright (C) 2012 Renesas Solutions Corp. + * Copyright (C) 2012 Kuninori Morimoto + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#include + +#ifdef CONFIG_PM +static int r8a7740_pd_a4s_suspend(void) +{ + /* + * The A4S domain contains the CPU core and therefore it should + * only be turned off if the CPU is in use. + */ + return -EBUSY; +} + +struct rmobile_pm_domain r8a7740_pd_a4s = { + .genpd.name = "A4S", + .bit_shift = 10, + .gov = &pm_domain_always_on_gov, + .no_debug = true, + .suspend = r8a7740_pd_a4s_suspend, +}; +#endif /* CONFIG_PM */ diff --git a/trunk/arch/arm/mach-shmobile/setup-r8a7740.c b/trunk/arch/arm/mach-shmobile/setup-r8a7740.c index 48d7bbf0d2e2..c37ad75151f3 100644 --- a/trunk/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/trunk/arch/arm/mach-shmobile/setup-r8a7740.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -671,6 +672,10 @@ void __init r8a7740_add_standard_devices(void) r8a7740_i2c_workaround(&i2c0_device); r8a7740_i2c_workaround(&i2c1_device); + /* PM domain */ + rmobile_init_pm_domain(&r8a7740_pd_a4s); + + /* add devices */ platform_add_devices(r8a7740_early_devices, ARRAY_SIZE(r8a7740_early_devices)); platform_add_devices(r8a7740_late_devices,