Linux 5.7.7
[linux/fpc-iii.git] / arch / arm / mach-imx / devices / platform-pata_imx.c
blob0e985fffba7836ec824fd34def15f4d5bcbc1422
1 // SPDX-License-Identifier: GPL-2.0-only
2 #include "../hardware.h"
3 #include "devices-common.h"
5 #define imx_pata_imx_data_entry_single(soc, _size) \
6 { \
7 .iobase = soc ## _ATA_BASE_ADDR, \
8 .iosize = _size, \
9 .irq = soc ## _INT_ATA, \
12 #ifdef CONFIG_SOC_IMX27
13 const struct imx_pata_imx_data imx27_pata_imx_data __initconst =
14 imx_pata_imx_data_entry_single(MX27, SZ_4K);
15 #endif /* ifdef CONFIG_SOC_IMX27 */
17 #ifdef CONFIG_SOC_IMX31
18 const struct imx_pata_imx_data imx31_pata_imx_data __initconst =
19 imx_pata_imx_data_entry_single(MX31, SZ_16K);
20 #endif /* ifdef CONFIG_SOC_IMX31 */
22 #ifdef CONFIG_SOC_IMX35
23 const struct imx_pata_imx_data imx35_pata_imx_data __initconst =
24 imx_pata_imx_data_entry_single(MX35, SZ_16K);
25 #endif /* ifdef CONFIG_SOC_IMX35 */
27 struct platform_device *__init imx_add_pata_imx(
28 const struct imx_pata_imx_data *data)
30 struct resource res[] = {
32 .start = data->iobase,
33 .end = data->iobase + data->iosize - 1,
34 .flags = IORESOURCE_MEM,
37 .start = data->irq,
38 .end = data->irq,
39 .flags = IORESOURCE_IRQ,
42 return imx_add_platform_device("pata_imx", -1,
43 res, ARRAY_SIZE(res), NULL, 0);