4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
10 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
12 * Copyright (C) 2009 Texas Instruments
13 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
15 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
16 * Converted DMA library into platform driver
17 * - G, Manjunath Kondaiah <manjugk@ti.com>
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License version 2 as
21 * published by the Free Software Foundation.
24 #include <linux/err.h>
26 #include <linux/slab.h>
27 #include <linux/module.h>
28 #include <linux/init.h>
29 #include <linux/device.h>
31 #include <plat/omap_hwmod.h>
32 #include <plat/omap_device.h>
35 static struct omap_device_pm_latency omap2_dma_latency[] = {
37 .deactivate_func = omap_device_idle_hwmods,
38 .activate_func = omap_device_enable_hwmods,
39 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
43 /* One time initializations */
44 static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
46 struct omap_device *od;
47 struct omap_system_dma_plat_info *p;
48 char *name = "omap_dma_system";
50 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
52 pr_err("%s: Unable to allocate pdata for %s:%s\n",
53 __func__, name, oh->name);
57 od = omap_device_build(name, 0, oh, p, sizeof(*p),
58 omap2_dma_latency, ARRAY_SIZE(omap2_dma_latency), 0);
61 pr_err("%s: Cant build omap_device for %s:%s.\n",
62 __func__, name, oh->name);
69 static int __init omap2_system_dma_init(void)
71 return omap_hwmod_for_each_by_class("dma",
72 omap2_system_dma_init_dev, NULL);
74 arch_initcall(omap2_system_dma_init);