xref: /linux/drivers/sh/pm_runtime.c (revision f26e8817b235d8764363bffcc9cbfc61867371f2)
1750a7eeeSPaul Mundt /*
2d03299eeSPaul Mundt  * Runtime PM support code
3750a7eeeSPaul Mundt  *
4750a7eeeSPaul Mundt  *  Copyright (C) 2009-2010 Magnus Damm
5750a7eeeSPaul Mundt  *
6750a7eeeSPaul Mundt  * This file is subject to the terms and conditions of the GNU General Public
7750a7eeeSPaul Mundt  * License.  See the file "COPYING" in the main directory of this archive
8750a7eeeSPaul Mundt  * for more details.
9750a7eeeSPaul Mundt  */
10750a7eeeSPaul Mundt 
11750a7eeeSPaul Mundt #include <linux/init.h>
12750a7eeeSPaul Mundt #include <linux/kernel.h>
13750a7eeeSPaul Mundt #include <linux/io.h>
14750a7eeeSPaul Mundt #include <linux/pm_runtime.h>
15750a7eeeSPaul Mundt #include <linux/pm_domain.h>
16750a7eeeSPaul Mundt #include <linux/pm_clock.h>
17750a7eeeSPaul Mundt #include <linux/platform_device.h>
18750a7eeeSPaul Mundt #include <linux/clk.h>
19750a7eeeSPaul Mundt #include <linux/sh_clk.h>
20750a7eeeSPaul Mundt #include <linux/bitmap.h>
21750a7eeeSPaul Mundt #include <linux/slab.h>
22750a7eeeSPaul Mundt 
23750a7eeeSPaul Mundt static struct dev_pm_domain default_pm_domain = {
24750a7eeeSPaul Mundt 	.ops = {
25*d2c4b43dSRajendra Nayak 		USE_PM_CLK_RUNTIME_OPS
26750a7eeeSPaul Mundt 		USE_PLATFORM_PM_SLEEP_OPS
27750a7eeeSPaul Mundt 	},
28750a7eeeSPaul Mundt };
29750a7eeeSPaul Mundt 
30750a7eeeSPaul Mundt static struct pm_clk_notifier_block platform_bus_notifier = {
31*d2c4b43dSRajendra Nayak 	.pm_domain = &default_pm_domain,
32750a7eeeSPaul Mundt 	.con_ids = { NULL, },
33750a7eeeSPaul Mundt };
34750a7eeeSPaul Mundt 
sh_pm_runtime_init(void)35750a7eeeSPaul Mundt static int __init sh_pm_runtime_init(void)
36750a7eeeSPaul Mundt {
37750a7eeeSPaul Mundt 	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
38750a7eeeSPaul Mundt 	return 0;
39750a7eeeSPaul Mundt }
40750a7eeeSPaul Mundt core_initcall(sh_pm_runtime_init);
41