imx51: add pata device
[pandora-kernel.git] / arch / arm / plat-mxc / devices / platform-pata_imx.c
1 /*
2  * This program is free software; you can redistribute it and/or modify it under
3  * the terms of the GNU General Public License version 2 as published by the
4  * Free Software Foundation.
5  */
6 #include <mach/hardware.h>
7 #include <mach/devices-common.h>
8
9 #define imx_pata_imx_data_entry_single(soc)                             \
10         {                                                               \
11                 .iobase = soc ## _ATA_BASE_ADDR,                        \
12                 .irq = soc ## _MXC_INT_ATA,                             \
13         }
14
15 #ifdef CONFIG_SOC_IMX51
16 const struct imx_pata_imx_data imx51_pata_imx_data __initconst =
17         imx_pata_imx_data_entry_single(MX51);
18 #endif /* ifdef CONFIG_SOC_IMX51 */
19
20 struct platform_device *__init imx_add_pata_imx(
21                 const struct imx_pata_imx_data *data)
22 {
23         struct resource res[] = {
24                 {
25                         .start = data->iobase,
26                         .end = data->iobase + SZ_16K - 1,
27                         .flags = IORESOURCE_MEM,
28                 },
29                 {
30                         .start = data->irq,
31                         .end = data->irq,
32                         .flags = IORESOURCE_IRQ,
33                 },
34         };
35         return imx_add_platform_device("pata_imx", -1,
36                         res, ARRAY_SIZE(res), NULL, 0);
37 }
38