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.
16 #include <linux/init.h>
17 #include <linux/module.h>
19 #include <plat/omap_device.h>
20 #include <plat/omap_hwmod.h>
21 #include <linux/errno.h>
22 #include <linux/err.h>
24 #include <mach/tiler.h>
26 #ifdef CONFIG_TI_TILER
28 static struct omap_dmm_platform_data dmm_data
= {
32 static struct platform_device omap_tiler_device
= {
37 static struct omap_device_pm_latency omap_dmm_latency
[] = {
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
);
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");
70 void __init
omap_dmm_init(void)