2 * Runtime PM support code for DaVinci
6 * Copyright (C) 2012 Texas Instruments, Inc.
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
12 #include <linux/init.h>
13 #include <linux/pm_runtime.h>
14 #include <linux/pm_clock.h>
15 #include <linux/platform_device.h>
17 #ifdef CONFIG_PM_RUNTIME
18 static int davinci_pm_runtime_suspend(struct device
*dev
)
22 dev_dbg(dev
, "%s\n", __func__
);
24 ret
= pm_generic_runtime_suspend(dev
);
28 ret
= pm_clk_suspend(dev
);
30 pm_generic_runtime_resume(dev
);
37 static int davinci_pm_runtime_resume(struct device
*dev
)
39 dev_dbg(dev
, "%s\n", __func__
);
42 return pm_generic_runtime_resume(dev
);
46 static struct dev_pm_domain davinci_pm_domain
= {
48 SET_RUNTIME_PM_OPS(davinci_pm_runtime_suspend
,
49 davinci_pm_runtime_resume
, NULL
)
50 USE_PLATFORM_PM_SLEEP_OPS
54 static struct pm_clk_notifier_block platform_bus_notifier
= {
55 .pm_domain
= &davinci_pm_domain
,
56 .con_ids
= { "fck", "master", "slave", NULL
},
59 static int __init
davinci_pm_runtime_init(void)
61 pm_clk_add_notifier(&platform_bus_type
, &platform_bus_notifier
);
65 core_initcall(davinci_pm_runtime_init
);