ARM: cpu topology: Add debugfs interface for cpu_power
[cmplus.git] / arch / arm / mach-omap2 / omap_dmm.c
blobc2c44d2195151c0df65206e43accf3a295521d65
1 /*
2 * DMM driver support functions for TI OMAP processors.
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 #include <linux/io.h>
16 #include <linux/init.h>
17 #include <linux/module.h>
18 #include <mach/dmm.h>
19 #include <plat/omap_device.h>
20 #include <plat/omap_hwmod.h>
21 #include <linux/errno.h>
22 #include <linux/err.h>
23 #include <mach/dmm.h>
24 #include <mach/tiler.h>
26 #ifdef CONFIG_TI_TILER
28 static struct omap_dmm_platform_data dmm_data = {
29 .oh_name = "dmm",
32 static struct platform_device omap_tiler_device = {
33 .name = "tiler",
34 .id = -1,
37 static struct omap_device_pm_latency omap_dmm_latency[] = {
38 [0] = {
39 .deactivate_func = omap_device_idle_hwmods,
40 .activate_func = omap_device_enable_hwmods,
41 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
46 void __init omap_dmm_init(void)
48 struct omap_hwmod *oh = NULL;
49 struct omap_device *od = NULL;
51 oh = omap_hwmod_lookup(dmm_data.oh_name);
52 if (!oh)
53 return;
55 dmm_data.base = omap_hwmod_get_mpu_rt_va(oh);
56 dmm_data.irq = oh->mpu_irqs[0].irq;
58 od = omap_device_build(dmm_data.oh_name, -1, oh, &dmm_data,
59 sizeof(dmm_data), omap_dmm_latency,
60 ARRAY_SIZE(omap_dmm_latency), false);
62 /* register tiler platform device to go along with the dmm device */
63 if (platform_device_register(&omap_tiler_device) < 0)
64 printk(KERN_ERR "Unable to register OMAP Tiler device\n");
66 return;
69 #else
70 void __init omap_dmm_init(void)
73 #endif