• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (C) 2010 Pengutronix
4  * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5  */
6 #include "devices-common.h"
7 
imx_add_imx_dma(char * name,resource_size_t iobase,int irq,int irq_err)8 struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
9 	resource_size_t iobase, int irq, int irq_err)
10 {
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 
27 	return platform_device_register_resndata(&mxc_ahb_bus,
28 			name, -1, res, ARRAY_SIZE(res), NULL, 0);
29 }
30 
imx_add_imx_sdma(char * name,resource_size_t iobase,int irq,struct sdma_platform_data * pdata)31 struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
32 	resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
33 {
34 	struct resource res[] = {
35 		{
36 			.start = iobase,
37 			.end = iobase + SZ_16K - 1,
38 			.flags = IORESOURCE_MEM,
39 		}, {
40 			.start = irq,
41 			.end = irq,
42 			.flags = IORESOURCE_IRQ,
43 		},
44 	};
45 
46 	return platform_device_register_resndata(&mxc_ahb_bus, name,
47 			-1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
48 }
49