pm_domain.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * PM domain driver for Keystone2 devices
  4. *
  5. * Copyright 2013 Texas Instruments, Inc.
  6. * Santosh Shilimkar <[email protected]>
  7. *
  8. * Based on Kevins work on DAVINCI SOCs
  9. * Kevin Hilman <[email protected]>
  10. */
  11. #include <linux/init.h>
  12. #include <linux/pm_runtime.h>
  13. #include <linux/pm_clock.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/of.h>
  16. #include "keystone.h"
  17. static struct dev_pm_domain keystone_pm_domain = {
  18. .ops = {
  19. USE_PM_CLK_RUNTIME_OPS
  20. USE_PLATFORM_PM_SLEEP_OPS
  21. },
  22. };
  23. static struct pm_clk_notifier_block platform_domain_notifier = {
  24. .pm_domain = &keystone_pm_domain,
  25. .con_ids = { NULL },
  26. };
  27. static const struct of_device_id of_keystone_table[] = {
  28. {.compatible = "ti,k2hk"},
  29. {.compatible = "ti,k2e"},
  30. {.compatible = "ti,k2l"},
  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. }