2 * Copyright (C) 2010 Pengutronix
3 * Sascha Hauer <s.hauer@pengutronix.de>
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.
10 #include <mach/mx23.h>
11 #include <mach/mx28.h>
12 #include <mach/devices-common.h>
14 #define mxs_auart_data_entry_single(soc, _id, hwid) \
17 .iobase = soc ## _AUART ## hwid ## _BASE_ADDR, \
18 .irq = soc ## _INT_AUART ## hwid, \
21 #define mxs_auart_data_entry(soc, _id, hwid) \
22 [_id] = mxs_auart_data_entry_single(soc, _id, hwid)
24 #ifdef CONFIG_SOC_IMX23
25 const struct mxs_auart_data mx23_auart_data
[] __initconst
= {
26 #define mx23_auart_data_entry(_id, hwid) \
27 mxs_auart_data_entry(MX23, _id, hwid)
28 mx23_auart_data_entry(0, 1),
29 mx23_auart_data_entry(1, 2),
33 #ifdef CONFIG_SOC_IMX28
34 const struct mxs_auart_data mx28_auart_data
[] __initconst
= {
35 #define mx28_auart_data_entry(_id) \
36 mxs_auart_data_entry(MX28, _id, _id)
37 mx28_auart_data_entry(0),
38 mx28_auart_data_entry(1),
39 mx28_auart_data_entry(2),
40 mx28_auart_data_entry(3),
41 mx28_auart_data_entry(4),
45 struct platform_device
*__init
mxs_add_auart(
46 const struct mxs_auart_data
*data
)
48 struct resource res
[] = {
50 .start
= data
->iobase
,
51 .end
= data
->iobase
+ SZ_8K
- 1,
52 .flags
= IORESOURCE_MEM
,
56 .flags
= IORESOURCE_IRQ
,
60 return mxs_add_platform_device_dmamask("mxs-auart", data
->id
,
61 res
, ARRAY_SIZE(res
), NULL
, 0,