Commit | Line | Data |
---|---|---|
d2912cb1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
8a8d2060 UKK |
2 | /* |
3 | * Copyright (C) 2010 Pengutronix | |
4 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | |
8a8d2060 | 5 | */ |
e0557c0d | 6 | #include "devices-common.h" |
8a8d2060 | 7 | |
e51d0f0a | 8 | struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name, |
73930eb3 | 9 | resource_size_t iobase, int irq, int irq_err) |
36223604 | 10 | { |
73930eb3 SG |
11 | struct resource res[] = { |
12 | { | |
13 | .start = iobase, | |
14 | .end = iobase + SZ_4K - 1, | |
15 | .flags = IORESOURCE_MEM, | |
16 | }, { | |
17 | .start = irq, | |
18 | .end = irq, | |
19 | .flags = IORESOURCE_IRQ, | |
20 | }, { | |
21 | .start = irq_err, | |
22 | .end = irq_err, | |
23 | .flags = IORESOURCE_IRQ, | |
24 | }, | |
25 | }; | |
26 | ||
36223604 | 27 | return platform_device_register_resndata(&mxc_ahb_bus, |
e51d0f0a | 28 | name, -1, res, ARRAY_SIZE(res), NULL, 0); |
36223604 | 29 | } |
931de392 | 30 | |
62550cd7 | 31 | struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name, |
36223604 | 32 | resource_size_t iobase, int irq, struct sdma_platform_data *pdata) |
8a8d2060 UKK |
33 | { |
34 | struct resource res[] = { | |
35 | { | |
36223604 SG |
36 | .start = iobase, |
37 | .end = iobase + SZ_16K - 1, | |
8a8d2060 UKK |
38 | .flags = IORESOURCE_MEM, |
39 | }, { | |
36223604 SG |
40 | .start = irq, |
41 | .end = irq, | |
8a8d2060 UKK |
42 | .flags = IORESOURCE_IRQ, |
43 | }, | |
44 | }; | |
45 | ||
62550cd7 | 46 | return platform_device_register_resndata(&mxc_ahb_bus, name, |
36223604 | 47 | -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); |
8a8d2060 | 48 | } |