Kevin Hilman | e933ec7 | 2010-06-17 15:48:43 -0700 | [diff] [blame] | 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> |
Rafael J. Wysocki | b5e8d26 | 2011-08-25 15:34:19 +0200 | [diff] [blame] | 16 | #include <linux/pm_clock.h> |
Kevin Hilman | e933ec7 | 2010-06-17 15:48:43 -0700 | [diff] [blame] | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/mutex.h> |
| 19 | #include <linux/clk.h> |
| 20 | #include <linux/err.h> |
| 21 | |
Paul Walmsley | 47ba709 | 2012-10-25 19:01:11 -0600 | [diff] [blame] | 22 | #include "soc.h" |
| 23 | |
Rafael J. Wysocki | 564b905 | 2011-06-23 01:52:55 +0200 | [diff] [blame] | 24 | static struct dev_pm_domain default_pm_domain = { |
Rafael J. Wysocki | 600b776 | 2011-05-16 20:15:36 +0200 | [diff] [blame] | 25 | .ops = { |
Rajendra Nayak | 2d3dc93 | 2015-04-23 14:03:11 +0530 | [diff] [blame] | 26 | USE_PM_CLK_RUNTIME_OPS |
Rafael J. Wysocki | 600b776 | 2011-05-16 20:15:36 +0200 | [diff] [blame] | 27 | USE_PLATFORM_PM_SLEEP_OPS |
| 28 | }, |
| 29 | }; |
| 30 | |
| 31 | static struct pm_clk_notifier_block platform_bus_notifier = { |
Rajendra Nayak | 2d3dc93 | 2015-04-23 14:03:11 +0530 | [diff] [blame] | 32 | .pm_domain = &default_pm_domain, |
Rafael J. Wysocki | 600b776 | 2011-05-16 20:15:36 +0200 | [diff] [blame] | 33 | .con_ids = { "ick", "fck", NULL, }, |
Kevin Hilman | e933ec7 | 2010-06-17 15:48:43 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | static int __init omap1_pm_runtime_init(void) |
| 37 | { |
Tony Lindgren | 7f9187c | 2010-12-10 09:46:24 -0800 | [diff] [blame] | 38 | if (!cpu_class_is_omap1()) |
| 39 | return -ENODEV; |
| 40 | |
Rafael J. Wysocki | 3d5c303 | 2011-07-01 22:13:44 +0200 | [diff] [blame] | 41 | pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier); |
Kevin Hilman | e933ec7 | 2010-06-17 15:48:43 -0700 | [diff] [blame] | 42 | |
| 43 | return 0; |
| 44 | } |
| 45 | core_initcall(omap1_pm_runtime_init); |
Kevin Hilman | e9e35c5 | 2011-06-14 05:53:18 -0700 | [diff] [blame] | 46 | |