pm_runtime.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Runtime PM support code
  3. *
  4. * Copyright (C) 2009-2010 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/kernel.h>
  12. #include <linux/io.h>
  13. #include <linux/pm_runtime.h>
  14. #include <linux/pm_domain.h>
  15. #include <linux/pm_clock.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/clk.h>
  18. #include <linux/sh_clk.h>
  19. #include <linux/bitmap.h>
  20. #include <linux/slab.h>
  21. static struct dev_pm_domain default_pm_domain = {
  22. .ops = {
  23. USE_PM_CLK_RUNTIME_OPS
  24. USE_PLATFORM_PM_SLEEP_OPS
  25. },
  26. };
  27. static struct pm_clk_notifier_block platform_bus_notifier = {
  28. .pm_domain = &default_pm_domain,
  29. .con_ids = { NULL, },
  30. };
  31. static int __init sh_pm_runtime_init(void)
  32. {
  33. if (IS_ENABLED(CONFIG_ARCH_SHMOBILE_MULTI)) {
  34. if (!of_machine_is_compatible("renesas,emev2") &&
  35. !of_machine_is_compatible("renesas,r7s72100") &&
  36. #ifndef CONFIG_PM_GENERIC_DOMAINS_OF
  37. !of_machine_is_compatible("renesas,r8a73a4") &&
  38. !of_machine_is_compatible("renesas,r8a7740") &&
  39. !of_machine_is_compatible("renesas,sh73a0") &&
  40. #endif
  41. !of_machine_is_compatible("renesas,r8a7778") &&
  42. !of_machine_is_compatible("renesas,r8a7779") &&
  43. !of_machine_is_compatible("renesas,r8a7790") &&
  44. !of_machine_is_compatible("renesas,r8a7791") &&
  45. !of_machine_is_compatible("renesas,r8a7792") &&
  46. !of_machine_is_compatible("renesas,r8a7793") &&
  47. !of_machine_is_compatible("renesas,r8a7794"))
  48. return 0;
  49. }
  50. pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
  51. return 0;
  52. }
  53. core_initcall(sh_pm_runtime_init);