blob: 667c1637ff9198b5aa539c10b6ae83352ad3afda [file] [log] [blame]
Kevin Hilmane933ec72010-06-17 15:48:43 -07001/*
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. Wysockib5e8d262011-08-25 15:34:19 +020016#include <linux/pm_clock.h>
Kevin Hilmane933ec72010-06-17 15:48:43 -070017#include <linux/platform_device.h>
18#include <linux/mutex.h>
19#include <linux/clk.h>
20#include <linux/err.h>
21
Paul Walmsley47ba7092012-10-25 19:01:11 -060022#include "soc.h"
23
Rafael J. Wysocki564b9052011-06-23 01:52:55 +020024static struct dev_pm_domain default_pm_domain = {
Rafael J. Wysocki600b7762011-05-16 20:15:36 +020025 .ops = {
Rajendra Nayak2d3dc932015-04-23 14:03:11 +053026 USE_PM_CLK_RUNTIME_OPS
Rafael J. Wysocki600b7762011-05-16 20:15:36 +020027 USE_PLATFORM_PM_SLEEP_OPS
28 },
29};
30
31static struct pm_clk_notifier_block platform_bus_notifier = {
Rajendra Nayak2d3dc932015-04-23 14:03:11 +053032 .pm_domain = &default_pm_domain,
Rafael J. Wysocki600b7762011-05-16 20:15:36 +020033 .con_ids = { "ick", "fck", NULL, },
Kevin Hilmane933ec72010-06-17 15:48:43 -070034};
35
36static int __init omap1_pm_runtime_init(void)
37{
Tony Lindgren7f9187c2010-12-10 09:46:24 -080038 if (!cpu_class_is_omap1())
39 return -ENODEV;
40
Rafael J. Wysocki3d5c3032011-07-01 22:13:44 +020041 pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
Kevin Hilmane933ec72010-06-17 15:48:43 -070042
43 return 0;
44}
45core_initcall(omap1_pm_runtime_init);
Kevin Hilmane9e35c52011-06-14 05:53:18 -070046