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/pm_clock.h>
17 #include <linux/platform_device.h>
18 #include <linux/mutex.h>
19 #include <linux/clk.h>
20 #include <linux/err.h>
22 #ifdef CONFIG_PM_RUNTIME
23 static int omap1_pm_runtime_suspend(struct device *dev)
27 dev_dbg(dev, "%s\n", __func__);
29 ret = pm_generic_runtime_suspend(dev);
33 ret = pm_clk_suspend(dev);
35 pm_generic_runtime_resume(dev);
42 static int omap1_pm_runtime_resume(struct device *dev)
44 dev_dbg(dev, "%s\n", __func__);
47 return pm_generic_runtime_resume(dev);
50 static struct dev_pm_domain default_pm_domain = {
52 .runtime_suspend = omap1_pm_runtime_suspend,
53 .runtime_resume = omap1_pm_runtime_resume,
54 USE_PLATFORM_PM_SLEEP_OPS
57 #define OMAP1_PM_DOMAIN (&default_pm_domain)
59 #define OMAP1_PM_DOMAIN NULL
60 #endif /* CONFIG_PM_RUNTIME */
62 static struct pm_clk_notifier_block platform_bus_notifier = {
63 .pm_domain = OMAP1_PM_DOMAIN,
64 .con_ids = { "ick", "fck", NULL, },
67 static int __init omap1_pm_runtime_init(void)
69 if (!cpu_class_is_omap1())
72 pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
76 core_initcall(omap1_pm_runtime_init);