2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
11 #include <mach/mx23.h>
12 #include <mach/mx28.h>
13 #include <mach/devices-common.h>
15 #define mxs_duart_data_entry(soc) \
17 .iobase = soc ## _DUART_BASE_ADDR, \
18 .irq = soc ## _INT_DUART, \
21 #ifdef CONFIG_SOC_IMX23
22 const struct mxs_duart_data mx23_duart_data __initconst =
23 mxs_duart_data_entry(MX23);
26 #ifdef CONFIG_SOC_IMX28
27 const struct mxs_duart_data mx28_duart_data __initconst =
28 mxs_duart_data_entry(MX28);
31 struct platform_device *__init mxs_add_duart(
32 const struct mxs_duart_data *data)
34 struct resource res[] = {
36 .start = data->iobase,
37 .end = data->iobase + SZ_8K - 1,
38 .flags = IORESOURCE_MEM,
42 .flags = IORESOURCE_IRQ,
46 return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res),