pm_domain.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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,k2hk"},
  31. {.compatible = "ti,k2e"},
  32. {.compatible = "ti,k2l"},
  33. { /* end of list */ },
  34. };
  35. int __init keystone_pm_runtime_init(void)
  36. {
  37. struct device_node *np;
  38. np = of_find_matching_node(NULL, of_keystone_table);
  39. if (!np)
  40. return 0;
  41. pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier);
  42. return 0;
  43. }