2 * r8a7740 power management support
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
11 #include <linux/console.h>
13 #include <linux/suspend.h>
16 #include "pm-rmobile.h"
18 #define SYSC_BASE IOMEM(0xe6180000)
20 #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
21 static int r8a7740_pd_a3sm_suspend(void)
24 * The A3SM domain contains the CPU core and therefore it should
25 * only be turned off if the CPU is not in use.
30 static int r8a7740_pd_a3sp_suspend(void)
33 * Serial consoles make use of SCIF hardware located in A3SP,
34 * keep such power domain on if "no_console_suspend" is set.
36 return console_suspend_enabled
? 0 : -EBUSY
;
39 static int r8a7740_pd_d4_suspend(void)
42 * The D4 domain contains the Coresight-ETM hardware block and
43 * therefore it should only be turned off if the debug module is
49 static struct rmobile_pm_domain r8a7740_pm_domains
[] = {
62 .gov
= &pm_domain_always_on_gov
,
63 .suspend
= r8a7740_pd_d4_suspend
,
81 .gov
= &pm_domain_always_on_gov
,
83 .suspend
= r8a7740_pd_a3sp_suspend
,
88 .gov
= &pm_domain_always_on_gov
,
89 .suspend
= r8a7740_pd_a3sm_suspend
,
101 void __init
r8a7740_init_pm_domains(void)
103 rmobile_init_domains(r8a7740_pm_domains
, ARRAY_SIZE(r8a7740_pm_domains
));
104 pm_genpd_add_subdomain_names("A4R", "A3RV");
105 pm_genpd_add_subdomain_names("A4S", "A3SP");
106 pm_genpd_add_subdomain_names("A4S", "A3SM");
107 pm_genpd_add_subdomain_names("A4S", "A3SG");
109 #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
111 #ifdef CONFIG_SUSPEND
112 static int r8a7740_enter_suspend(suspend_state_t suspend_state
)
118 static void r8a7740_suspend_init(void)
120 shmobile_suspend_ops
.enter
= r8a7740_enter_suspend
;
123 static void r8a7740_suspend_init(void) {}
126 void __init
r8a7740_pm_init(void)
128 r8a7740_suspend_init();