0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <linux/init.h>
0013 #include <linux/pm_runtime.h>
0014 #include <linux/pm_clock.h>
0015 #include <linux/platform_device.h>
0016 #include <linux/of.h>
0017
0018 #include "keystone.h"
0019
0020 static struct dev_pm_domain keystone_pm_domain = {
0021 .ops = {
0022 USE_PM_CLK_RUNTIME_OPS
0023 USE_PLATFORM_PM_SLEEP_OPS
0024 },
0025 };
0026
0027 static struct pm_clk_notifier_block platform_domain_notifier = {
0028 .pm_domain = &keystone_pm_domain,
0029 .con_ids = { NULL },
0030 };
0031
0032 static const struct of_device_id of_keystone_table[] = {
0033 {.compatible = "ti,k2hk"},
0034 {.compatible = "ti,k2e"},
0035 {.compatible = "ti,k2l"},
0036 { },
0037 };
0038
0039 int __init keystone_pm_runtime_init(void)
0040 {
0041 struct device_node *np;
0042
0043 np = of_find_matching_node(NULL, of_keystone_table);
0044 if (!np)
0045 return 0;
0046
0047 pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier);
0048
0049 return 0;
0050 }