blob: ccdb5dc4ddbdde117ae662c92ae25786bfaae764 [file] [log] [blame]
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +02001/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
Shawn Guoe0557c02012-09-13 15:51:15 +08009#include "devices-common.h"
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +020010
Shawn Guoe51d0f02012-09-15 21:11:28 +080011struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
Shawn Guo73930eb2012-09-15 15:57:00 +080012 resource_size_t iobase, int irq, int irq_err)
Shawn Guo36223602011-06-22 22:41:30 +080013{
Shawn Guo73930eb2012-09-15 15:57:00 +080014 struct resource res[] = {
15 {
16 .start = iobase,
17 .end = iobase + SZ_4K - 1,
18 .flags = IORESOURCE_MEM,
19 }, {
20 .start = irq,
21 .end = irq,
22 .flags = IORESOURCE_IRQ,
23 }, {
24 .start = irq_err,
25 .end = irq_err,
26 .flags = IORESOURCE_IRQ,
27 },
28 };
29
Shawn Guo36223602011-06-22 22:41:30 +080030 return platform_device_register_resndata(&mxc_ahb_bus,
Shawn Guoe51d0f02012-09-15 21:11:28 +080031 name, -1, res, ARRAY_SIZE(res), NULL, 0);
Shawn Guo36223602011-06-22 22:41:30 +080032}
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +020033
Shawn Guo62550cd2011-07-13 21:33:17 +080034struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
Shawn Guo36223602011-06-22 22:41:30 +080035 resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +020036{
37 struct resource res[] = {
38 {
Shawn Guo36223602011-06-22 22:41:30 +080039 .start = iobase,
40 .end = iobase + SZ_16K - 1,
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +020041 .flags = IORESOURCE_MEM,
42 }, {
Shawn Guo36223602011-06-22 22:41:30 +080043 .start = irq,
44 .end = irq,
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +020045 .flags = IORESOURCE_IRQ,
46 },
47 };
48
Shawn Guo62550cd2011-07-13 21:33:17 +080049 return platform_device_register_resndata(&mxc_ahb_bus, name,
Shawn Guo36223602011-06-22 22:41:30 +080050 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
Uwe Kleine-König8a8d2062010-10-08 16:00:11 +020051}