pm_domain.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * PM domain driver for Keystone2 devices
  3. *
  4. * Copyright 2013 Texas Instruments, Inc.
  5. * Santosh Shilimkar <santosh.shillimkar@ti.com>
  6. *
  7. * Based on Kevins work on DAVINCI SOCs
  8. * Kevin Hilman <khilman@linaro.org>
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms and conditions of the GNU General Public License,
  12. * version 2, as published by the Free Software Foundation.
  13. */
  14. #include <linux/init.h>
  15. #include <linux/pm_runtime.h>
  16. #include <linux/pm_clock.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/of.h>
  19. #include "keystone.h"
  20. static struct dev_pm_domain keystone_pm_domain = {
  21. .ops = {
  22. USE_PM_CLK_RUNTIME_OPS
  23. USE_PLATFORM_PM_SLEEP_OPS
  24. },
  25. };
  26. static struct pm_clk_notifier_block platform_domain_notifier = {
  27. .pm_domain = &keystone_pm_domain,
  28. };
  29. static const struct of_device_id of_keystone_table[] = {
  30. {.compatible = "ti,keystone"},
  31. { /* end of list */ },
  32. };
  33. int __init keystone_pm_runtime_init(void)
  34. {
  35. struct device_node *np;
  36. np = of_find_matching_node(NULL, of_keystone_table);
  37. if (!np)
  38. return 0;
  39. pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier);
  40. return 0;
  41. }