Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Runtime PM support code for DaVinci
0004  *
0005  * Author: Kevin Hilman
0006  *
0007  * Copyright (C) 2012 Texas Instruments, Inc.
0008  */
0009 #include <linux/init.h>
0010 #include <linux/pm_runtime.h>
0011 #include <linux/pm_clock.h>
0012 #include <linux/platform_device.h>
0013 #include <linux/of.h>
0014 
0015 static struct dev_pm_domain davinci_pm_domain = {
0016     .ops = {
0017         USE_PM_CLK_RUNTIME_OPS
0018         USE_PLATFORM_PM_SLEEP_OPS
0019     },
0020 };
0021 
0022 static struct pm_clk_notifier_block platform_bus_notifier = {
0023     .pm_domain = &davinci_pm_domain,
0024     .con_ids = { "fck", "master", "slave", NULL },
0025 };
0026 
0027 static int __init davinci_pm_runtime_init(void)
0028 {
0029     if (of_have_populated_dt())
0030         return 0;
0031 
0032     /* Use pm_clk as fallback if we're not using genpd. */
0033     pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
0034 
0035     return 0;
0036 }
0037 core_initcall(davinci_pm_runtime_init);