Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / arch / arm / plat-mxc / devices / platform-imx-uart.c
1 /*
2  * Copyright (C) 2009-2010 Pengutronix
3  * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4  *
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 <mach/devices-common.h>
10
11 struct platform_device *__init imx_add_imx_uart_3irq(int id,
12                 resource_size_t iobase, resource_size_t iosize,
13                 resource_size_t irqrx, resource_size_t irqtx,
14                 resource_size_t irqrts,
15                 const struct imxuart_platform_data *pdata)
16 {
17         struct resource res[] = {
18                 {
19                         .start = iobase,
20                         .end = iobase + iosize - 1,
21                         .flags = IORESOURCE_MEM,
22                 }, {
23                         .start = irqrx,
24                         .end = irqrx,
25                         .flags = IORESOURCE_IRQ,
26                 }, {
27                         .start = irqtx,
28                         .end = irqtx,
29                         .flags = IORESOURCE_IRQ,
30                 }, {
31                         .start = irqrts,
32                         .end = irqrx,
33                         .flags = IORESOURCE_IRQ,
34                 },
35         };
36
37         return imx_add_platform_device("imx-uart", id, res, ARRAY_SIZE(res),
38                         pdata, sizeof(*pdata));
39 }
40
41 struct platform_device *__init imx_add_imx_uart_1irq(int id,
42                 resource_size_t iobase, resource_size_t iosize,
43                 resource_size_t irq,
44                 const struct imxuart_platform_data *pdata)
45 {
46         struct resource res[] = {
47                 {
48                         .start = iobase,
49                         .end = iobase + iosize - 1,
50                         .flags = IORESOURCE_MEM,
51                 }, {
52                         .start = irq,
53                         .end = irq,
54                         .flags = IORESOURCE_IRQ,
55                 },
56         };
57
58         return imx_add_platform_device("imx-uart", id, res, ARRAY_SIZE(res),
59                         pdata, sizeof(*pdata));
60 }