ARM: shmobile: r8a7740: add A3SP pm domain support
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / arm / mach-shmobile / pm-r8a7740.c
index d2fe815..de7c621 100644 (file)
@@ -8,6 +8,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
+#include <linux/console.h>
 #include <mach/pm-rmobile.h>
 
 #ifdef CONFIG_PM
@@ -27,4 +28,22 @@ struct rmobile_pm_domain r8a7740_pd_a4s = {
        .no_debug       = true,
        .suspend        = r8a7740_pd_a4s_suspend,
 };
+
+static int r8a7740_pd_a3sp_suspend(void)
+{
+       /*
+        * Serial consoles make use of SCIF hardware located in A3SP,
+        * keep such power domain on if "no_console_suspend" is set.
+        */
+       return console_suspend_enabled ? 0 : -EBUSY;
+}
+
+struct rmobile_pm_domain r8a7740_pd_a3sp = {
+       .genpd.name     = "A3SP",
+       .bit_shift      = 11,
+       .gov            = &pm_domain_always_on_gov,
+       .no_debug       = true,
+       .suspend        = r8a7740_pd_a3sp_suspend,
+};
+
 #endif /* CONFIG_PM */