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>
12 #include <linux/suspend.h>
14 #include "pm-rmobile.h"
16 #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
17 static int r8a7740_pd_a3sm_suspend(void)
20 * The A3SM domain contains the CPU core and therefore it should
21 * only be turned off if the CPU is not in use.
26 static int r8a7740_pd_a3sp_suspend(void)
29 * Serial consoles make use of SCIF hardware located in A3SP,
30 * keep such power domain on if "no_console_suspend" is set.
32 return console_suspend_enabled
? 0 : -EBUSY
;
35 static int r8a7740_pd_d4_suspend(void)
38 * The D4 domain contains the Coresight-ETM hardware block and
39 * therefore it should only be turned off if the debug module is
45 static struct rmobile_pm_domain r8a7740_pm_domains
[] = {
55 .gov
= &pm_domain_always_on_gov
,
56 .suspend
= r8a7740_pd_d4_suspend
,
70 .gov
= &pm_domain_always_on_gov
,
72 .suspend
= r8a7740_pd_a3sp_suspend
,
76 .gov
= &pm_domain_always_on_gov
,
77 .suspend
= r8a7740_pd_a3sm_suspend
,
87 void __init
r8a7740_init_pm_domains(void)
89 rmobile_init_domains(r8a7740_pm_domains
, ARRAY_SIZE(r8a7740_pm_domains
));
90 pm_genpd_add_subdomain_names("A4R", "A3RV");
91 pm_genpd_add_subdomain_names("A4S", "A3SP");
92 pm_genpd_add_subdomain_names("A4S", "A3SM");
93 pm_genpd_add_subdomain_names("A4S", "A3SG");
95 #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
98 static int r8a7740_enter_suspend(suspend_state_t suspend_state
)
104 static void r8a7740_suspend_init(void)
106 shmobile_suspend_ops
.enter
= r8a7740_enter_suspend
;
109 static void r8a7740_suspend_init(void) {}
112 void __init
r8a7740_pm_init(void)
114 r8a7740_suspend_init();