pm-r8a7740.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. */
  11. #include <linux/console.h>
  12. #include <mach/pm-rmobile.h>
  13. #ifdef CONFIG_PM
  14. static int r8a7740_pd_a4s_suspend(void)
  15. {
  16. /*
  17. * The A4S domain contains the CPU core and therefore it should
  18. * only be turned off if the CPU is in use.
  19. */
  20. return -EBUSY;
  21. }
  22. static int r8a7740_pd_a3sp_suspend(void)
  23. {
  24. /*
  25. * Serial consoles make use of SCIF hardware located in A3SP,
  26. * keep such power domain on if "no_console_suspend" is set.
  27. */
  28. return console_suspend_enabled ? 0 : -EBUSY;
  29. }
  30. static struct rmobile_pm_domain r8a7740_pm_domains[] = {
  31. {
  32. .genpd.name = "A4S",
  33. .bit_shift = 10,
  34. .gov = &pm_domain_always_on_gov,
  35. .no_debug = true,
  36. .suspend = r8a7740_pd_a4s_suspend,
  37. },
  38. {
  39. .genpd.name = "A3SP",
  40. .bit_shift = 11,
  41. .gov = &pm_domain_always_on_gov,
  42. .no_debug = true,
  43. .suspend = r8a7740_pd_a3sp_suspend,
  44. },
  45. {
  46. .genpd.name = "A4LC",
  47. .bit_shift = 1,
  48. },
  49. };
  50. void __init r8a7740_init_pm_domains(void)
  51. {
  52. rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
  53. pm_genpd_add_subdomain_names("A4S", "A3SP");
  54. }
  55. #endif /* CONFIG_PM */