ARM: OMAP2+: fix build breakage introduced by commit b7754452b3e27716347a528b47b0a108...
[deliverable/linux.git] / arch / arm / mach-omap1 / pm_bus.c
CommitLineData
e933ec7c
KH
1/*
2 * Runtime PM support code for OMAP1
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 *
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.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/pm_runtime.h>
b5e8d269 16#include <linux/pm_clock.h>
e933ec7c
KH
17#include <linux/platform_device.h>
18#include <linux/mutex.h>
19#include <linux/clk.h>
20#include <linux/err.h>
21
e933ec7c
KH
22#ifdef CONFIG_PM_RUNTIME
23static int omap1_pm_runtime_suspend(struct device *dev)
24{
600b776e 25 int ret;
e933ec7c
KH
26
27 dev_dbg(dev, "%s\n", __func__);
28
29 ret = pm_generic_runtime_suspend(dev);
600b776e
RW
30 if (ret)
31 return ret;
e933ec7c 32
3d5c3036 33 ret = pm_clk_suspend(dev);
600b776e
RW
34 if (ret) {
35 pm_generic_runtime_resume(dev);
36 return ret;
e933ec7c
KH
37 }
38
39 return 0;
600b776e 40}
e933ec7c
KH
41
42static int omap1_pm_runtime_resume(struct device *dev)
43{
e933ec7c
KH
44 dev_dbg(dev, "%s\n", __func__);
45
3d5c3036 46 pm_clk_resume(dev);
600b776e
RW
47 return pm_generic_runtime_resume(dev);
48}
e933ec7c 49
564b905a 50static struct dev_pm_domain default_pm_domain = {
600b776e
RW
51 .ops = {
52 .runtime_suspend = omap1_pm_runtime_suspend,
53 .runtime_resume = omap1_pm_runtime_resume,
54 USE_PLATFORM_PM_SLEEP_OPS
55 },
56};
564b905a 57#define OMAP1_PM_DOMAIN (&default_pm_domain)
e9e35c5a 58#else
564b905a 59#define OMAP1_PM_DOMAIN NULL
e9e35c5a 60#endif /* CONFIG_PM_RUNTIME */
e933ec7c 61
600b776e 62static struct pm_clk_notifier_block platform_bus_notifier = {
564b905a 63 .pm_domain = OMAP1_PM_DOMAIN,
600b776e 64 .con_ids = { "ick", "fck", NULL, },
e933ec7c
KH
65};
66
67static int __init omap1_pm_runtime_init(void)
68{
7f9187c2
TL
69 if (!cpu_class_is_omap1())
70 return -ENODEV;
71
3d5c3036 72 pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
e933ec7c
KH
73
74 return 0;
75}
76core_initcall(omap1_pm_runtime_init);
e9e35c5a 77
This page took 0.137335 seconds and 5 git commands to generate.