pm_domain.c 840 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Runtime PM support code for DaVinci
  4. *
  5. * Author: Kevin Hilman
  6. *
  7. * Copyright (C) 2012 Texas Instruments, Inc.
  8. */
  9. #include <linux/init.h>
  10. #include <linux/pm_runtime.h>
  11. #include <linux/pm_clock.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/of.h>
  14. static struct dev_pm_domain davinci_pm_domain = {
  15. .ops = {
  16. USE_PM_CLK_RUNTIME_OPS
  17. USE_PLATFORM_PM_SLEEP_OPS
  18. },
  19. };
  20. static struct pm_clk_notifier_block platform_bus_notifier = {
  21. .pm_domain = &davinci_pm_domain,
  22. .con_ids = { "fck", "master", "slave", NULL },
  23. };
  24. static int __init davinci_pm_runtime_init(void)
  25. {
  26. if (of_have_populated_dt())
  27. return 0;
  28. /* Use pm_clk as fallback if we're not using genpd. */
  29. pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
  30. return 0;
  31. }
  32. core_initcall(davinci_pm_runtime_init);