1*0fdebc5eSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 2ce9dcb87SKevin Hilman /* 3ce9dcb87SKevin Hilman * Runtime PM support code for DaVinci 4ce9dcb87SKevin Hilman * 5ce9dcb87SKevin Hilman * Author: Kevin Hilman 6ce9dcb87SKevin Hilman * 7ce9dcb87SKevin Hilman * Copyright (C) 2012 Texas Instruments, Inc. 8ce9dcb87SKevin Hilman */ 9ce9dcb87SKevin Hilman #include <linux/init.h> 10ce9dcb87SKevin Hilman #include <linux/pm_runtime.h> 11ce9dcb87SKevin Hilman #include <linux/pm_clock.h> 12ce9dcb87SKevin Hilman #include <linux/platform_device.h> 13bfd107bdSDavid Lechner #include <linux/of.h> 14ce9dcb87SKevin Hilman 15ce9dcb87SKevin Hilman static struct dev_pm_domain davinci_pm_domain = { 16ce9dcb87SKevin Hilman .ops = { 17ea6f8334SRajendra Nayak USE_PM_CLK_RUNTIME_OPS 18ce9dcb87SKevin Hilman USE_PLATFORM_PM_SLEEP_OPS 19ce9dcb87SKevin Hilman }, 20ce9dcb87SKevin Hilman }; 21ce9dcb87SKevin Hilman 22ce9dcb87SKevin Hilman static struct pm_clk_notifier_block platform_bus_notifier = { 23ce9dcb87SKevin Hilman .pm_domain = &davinci_pm_domain, 249a3e89b1SLad, Prabhakar .con_ids = { "fck", "master", "slave", NULL }, 25ce9dcb87SKevin Hilman }; 26ce9dcb87SKevin Hilman davinci_pm_runtime_init(void)27ce9dcb87SKevin Hilmanstatic int __init davinci_pm_runtime_init(void) 28ce9dcb87SKevin Hilman { 29bfd107bdSDavid Lechner if (of_have_populated_dt()) 30bfd107bdSDavid Lechner return 0; 31bfd107bdSDavid Lechner 32bfd107bdSDavid Lechner /* Use pm_clk as fallback if we're not using genpd. */ 33ce9dcb87SKevin Hilman pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier); 34ce9dcb87SKevin Hilman 35ce9dcb87SKevin Hilman return 0; 36ce9dcb87SKevin Hilman } 37ce9dcb87SKevin Hilman core_initcall(davinci_pm_runtime_init); 38