xref: /linux/arch/arm/mach-davinci/pm_domain.c (revision bfd107bd3b8ba4ce5f5536fe1d69d0ba06d0e741)
1ce9dcb87SKevin Hilman /*
2ce9dcb87SKevin Hilman  * Runtime PM support code for DaVinci
3ce9dcb87SKevin Hilman  *
4ce9dcb87SKevin Hilman  * Author: Kevin Hilman
5ce9dcb87SKevin Hilman  *
6ce9dcb87SKevin Hilman  * Copyright (C) 2012 Texas Instruments, Inc.
7ce9dcb87SKevin Hilman  *
8ce9dcb87SKevin Hilman  * This file is licensed under the terms of the GNU General Public
9ce9dcb87SKevin Hilman  * License version 2. This program is licensed "as is" without any
10ce9dcb87SKevin Hilman  * warranty of any kind, whether express or implied.
11ce9dcb87SKevin Hilman  */
12ce9dcb87SKevin Hilman #include <linux/init.h>
13ce9dcb87SKevin Hilman #include <linux/pm_runtime.h>
14ce9dcb87SKevin Hilman #include <linux/pm_clock.h>
15ce9dcb87SKevin Hilman #include <linux/platform_device.h>
16*bfd107bdSDavid Lechner #include <linux/of.h>
17ce9dcb87SKevin Hilman 
18ce9dcb87SKevin Hilman static struct dev_pm_domain davinci_pm_domain = {
19ce9dcb87SKevin Hilman 	.ops = {
20ea6f8334SRajendra Nayak 		USE_PM_CLK_RUNTIME_OPS
21ce9dcb87SKevin Hilman 		USE_PLATFORM_PM_SLEEP_OPS
22ce9dcb87SKevin Hilman 	},
23ce9dcb87SKevin Hilman };
24ce9dcb87SKevin Hilman 
25ce9dcb87SKevin Hilman static struct pm_clk_notifier_block platform_bus_notifier = {
26ce9dcb87SKevin Hilman 	.pm_domain = &davinci_pm_domain,
279a3e89b1SLad, Prabhakar 	.con_ids = { "fck", "master", "slave", NULL },
28ce9dcb87SKevin Hilman };
29ce9dcb87SKevin Hilman 
30ce9dcb87SKevin Hilman static int __init davinci_pm_runtime_init(void)
31ce9dcb87SKevin Hilman {
32*bfd107bdSDavid Lechner 	if (of_have_populated_dt())
33*bfd107bdSDavid Lechner 		return 0;
34*bfd107bdSDavid Lechner 
35*bfd107bdSDavid Lechner 	/* Use pm_clk as fallback if we're not using genpd. */
36ce9dcb87SKevin Hilman 	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
37ce9dcb87SKevin Hilman 
38ce9dcb87SKevin Hilman 	return 0;
39ce9dcb87SKevin Hilman }
40ce9dcb87SKevin Hilman core_initcall(davinci_pm_runtime_init);
41