Kuninori Morimoto | 8459293 | 2012-07-05 01:25:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * r8a7740 power management support |
| 3 | * |
| 4 | * Copyright (C) 2012 Renesas Solutions Corp. |
| 5 | * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| 6 | * |
| 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 |
| 9 | * for more details. |
| 10 | */ |
Kuninori Morimoto | 802a563 | 2012-07-05 01:26:31 -0700 | [diff] [blame] | 11 | #include <linux/console.h> |
Kuninori Morimoto | 8459293 | 2012-07-05 01:25:58 -0700 | [diff] [blame] | 12 | #include <mach/pm-rmobile.h> |
| 13 | |
| 14 | #ifdef CONFIG_PM |
| 15 | static int r8a7740_pd_a4s_suspend(void) |
| 16 | { |
| 17 | /* |
| 18 | * The A4S domain contains the CPU core and therefore it should |
| 19 | * only be turned off if the CPU is in use. |
| 20 | */ |
| 21 | return -EBUSY; |
| 22 | } |
| 23 | |
Kuninori Morimoto | 802a563 | 2012-07-05 01:26:31 -0700 | [diff] [blame] | 24 | static int r8a7740_pd_a3sp_suspend(void) |
| 25 | { |
| 26 | /* |
| 27 | * Serial consoles make use of SCIF hardware located in A3SP, |
| 28 | * keep such power domain on if "no_console_suspend" is set. |
| 29 | */ |
| 30 | return console_suspend_enabled ? 0 : -EBUSY; |
| 31 | } |
| 32 | |
Rafael J. Wysocki | 7b56740 | 2012-08-07 01:13:37 +0200 | [diff] [blame] | 33 | static struct rmobile_pm_domain r8a7740_pm_domains[] = { |
| 34 | { |
| 35 | .genpd.name = "A4S", |
| 36 | .bit_shift = 10, |
| 37 | .gov = &pm_domain_always_on_gov, |
| 38 | .no_debug = true, |
| 39 | .suspend = r8a7740_pd_a4s_suspend, |
| 40 | }, |
| 41 | { |
| 42 | .genpd.name = "A3SP", |
| 43 | .bit_shift = 11, |
| 44 | .gov = &pm_domain_always_on_gov, |
| 45 | .no_debug = true, |
| 46 | .suspend = r8a7740_pd_a3sp_suspend, |
| 47 | }, |
| 48 | { |
| 49 | .genpd.name = "A4LC", |
| 50 | .bit_shift = 1, |
| 51 | }, |
Kuninori Morimoto | 802a563 | 2012-07-05 01:26:31 -0700 | [diff] [blame] | 52 | }; |
| 53 | |
Rafael J. Wysocki | 7b56740 | 2012-08-07 01:13:37 +0200 | [diff] [blame] | 54 | void __init r8a7740_init_pm_domains(void) |
| 55 | { |
| 56 | rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains)); |
| 57 | pm_genpd_add_subdomain_names("A4S", "A3SP"); |
| 58 | } |
Kuninori Morimoto | a330ce3 | 2012-07-05 01:26:53 -0700 | [diff] [blame] | 59 | |
Kuninori Morimoto | 8459293 | 2012-07-05 01:25:58 -0700 | [diff] [blame] | 60 | #endif /* CONFIG_PM */ |