2 * Runtime PM support code for OMAP1
4 * Author: Kevin Hilman, Deep Root Systems, LLC
6 * Copyright (C) 2010 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/kernel.h>
15 #include <linux/pm_runtime.h>
16 #include <linux/platform_device.h>
17 #include <linux/mutex.h>
18 #include <linux/clk.h>
19 #include <linux/err.h>
21 #include <plat/omap_device.h>
22 #include <plat/omap-pm.h>
24 #ifdef CONFIG_PM_RUNTIME
25 static int omap1_pm_runtime_suspend(struct device
*dev
)
29 dev_dbg(dev
, "%s\n", __func__
);
31 ret
= pm_generic_runtime_suspend(dev
);
35 ret
= pm_runtime_clk_suspend(dev
);
37 pm_generic_runtime_resume(dev
);
44 static int omap1_pm_runtime_resume(struct device
*dev
)
46 dev_dbg(dev
, "%s\n", __func__
);
48 pm_runtime_clk_resume(dev
);
49 return pm_generic_runtime_resume(dev
);
52 static struct dev_power_domain default_power_domain
= {
54 .runtime_suspend
= omap1_pm_runtime_suspend
,
55 .runtime_resume
= omap1_pm_runtime_resume
,
56 USE_PLATFORM_PM_SLEEP_OPS
59 #define OMAP1_PWR_DOMAIN (&default_power_domain)
61 #define OMAP1_PWR_DOMAIN NULL
62 #endif /* CONFIG_PM_RUNTIME */
64 static struct pm_clk_notifier_block platform_bus_notifier
= {
65 .pwr_domain
= OMAP1_PWR_DOMAIN
,
66 .con_ids
= { "ick", "fck", NULL
, },
69 static int __init
omap1_pm_runtime_init(void)
71 if (!cpu_class_is_omap1())
74 pm_runtime_clk_add_notifier(&platform_bus_type
, &platform_bus_notifier
);
78 core_initcall(omap1_pm_runtime_init
);