kvm tools, setup: Create private directory
[linux-2.6/next.git] / arch / arm / mach-mxs / devices / platform-auart.c
blob796606cce0ce233e973d084b53ea7674fb625f28
1 /*
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.
8 */
9 #include <asm/sizes.h>
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) \
15 { \
16 .id = _id, \
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),
31 #endif
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),
43 #endif
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,
53 }, {
54 .start = data->irq,
55 .end = data->irq,
56 .flags = IORESOURCE_IRQ,
60 return mxs_add_platform_device_dmamask("mxs-auart", data->id,
61 res, ARRAY_SIZE(res), NULL, 0,
62 DMA_BIT_MASK(32));