xref: /OK3568_Linux_fs/kernel/arch/arm/mach-omap1/pm_bus.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Runtime PM support code for OMAP1
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Author: Kevin Hilman, Deep Root Systems, LLC
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2010 Texas Instruments, Inc.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * This file is licensed under the terms of the GNU General Public
9*4882a593Smuzhiyun  * License version 2. This program is licensed "as is" without any
10*4882a593Smuzhiyun  * warranty of any kind, whether express or implied.
11*4882a593Smuzhiyun  */
12*4882a593Smuzhiyun #include <linux/init.h>
13*4882a593Smuzhiyun #include <linux/kernel.h>
14*4882a593Smuzhiyun #include <linux/io.h>
15*4882a593Smuzhiyun #include <linux/pm_runtime.h>
16*4882a593Smuzhiyun #include <linux/pm_clock.h>
17*4882a593Smuzhiyun #include <linux/platform_device.h>
18*4882a593Smuzhiyun #include <linux/mutex.h>
19*4882a593Smuzhiyun #include <linux/clk.h>
20*4882a593Smuzhiyun #include <linux/err.h>
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun #include "soc.h"
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun static struct dev_pm_domain default_pm_domain = {
25*4882a593Smuzhiyun 	.ops = {
26*4882a593Smuzhiyun 		USE_PM_CLK_RUNTIME_OPS
27*4882a593Smuzhiyun 		USE_PLATFORM_PM_SLEEP_OPS
28*4882a593Smuzhiyun 	},
29*4882a593Smuzhiyun };
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun static struct pm_clk_notifier_block platform_bus_notifier = {
32*4882a593Smuzhiyun 	.pm_domain = &default_pm_domain,
33*4882a593Smuzhiyun 	.con_ids = { "ick", "fck", NULL, },
34*4882a593Smuzhiyun };
35*4882a593Smuzhiyun 
omap1_pm_runtime_init(void)36*4882a593Smuzhiyun static int __init omap1_pm_runtime_init(void)
37*4882a593Smuzhiyun {
38*4882a593Smuzhiyun 	if (!cpu_class_is_omap1())
39*4882a593Smuzhiyun 		return -ENODEV;
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun 	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun 	return 0;
44*4882a593Smuzhiyun }
45*4882a593Smuzhiyun core_initcall(omap1_pm_runtime_init);
46*4882a593Smuzhiyun 
47