Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 1 | /* |
| 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 Guo | e0557c0 | 2012-09-13 15:51:15 +0800 | [diff] [blame] | 9 | #include "devices-common.h" |
Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 10 | |
Shawn Guo | e51d0f0 | 2012-09-15 21:11:28 +0800 | [diff] [blame] | 11 | struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name, |
Shawn Guo | 73930eb | 2012-09-15 15:57:00 +0800 | [diff] [blame] | 12 | resource_size_t iobase, int irq, int irq_err) |
Shawn Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 13 | { |
Shawn Guo | 73930eb | 2012-09-15 15:57:00 +0800 | [diff] [blame] | 14 | 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 Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 30 | return platform_device_register_resndata(&mxc_ahb_bus, |
Shawn Guo | e51d0f0 | 2012-09-15 21:11:28 +0800 | [diff] [blame] | 31 | name, -1, res, ARRAY_SIZE(res), NULL, 0); |
Shawn Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 32 | } |
Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 33 | |
Shawn Guo | 62550cd | 2011-07-13 21:33:17 +0800 | [diff] [blame] | 34 | struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name, |
Shawn Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 35 | resource_size_t iobase, int irq, struct sdma_platform_data *pdata) |
Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 36 | { |
| 37 | struct resource res[] = { |
| 38 | { |
Shawn Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 39 | .start = iobase, |
| 40 | .end = iobase + SZ_16K - 1, |
Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 41 | .flags = IORESOURCE_MEM, |
| 42 | }, { |
Shawn Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 43 | .start = irq, |
| 44 | .end = irq, |
Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 45 | .flags = IORESOURCE_IRQ, |
| 46 | }, |
| 47 | }; |
| 48 | |
Shawn Guo | 62550cd | 2011-07-13 21:33:17 +0800 | [diff] [blame] | 49 | return platform_device_register_resndata(&mxc_ahb_bus, name, |
Shawn Guo | 3622360 | 2011-06-22 22:41:30 +0800 | [diff] [blame] | 50 | -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); |
Uwe Kleine-König | 8a8d206 | 2010-10-08 16:00:11 +0200 | [diff] [blame] | 51 | } |