2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
8 #include <linux/compiler.h>
10 #include <linux/init.h>
12 #include <mach/mx23.h>
13 #include <mach/mx28.h>
14 #include <mach/devices-common.h>
16 #define mxs_saif_data_entry_single(soc, _id) \
19 .iobase = soc ## _SAIF ## _id ## _BASE_ADDR, \
20 .irq = soc ## _INT_SAIF ## _id, \
21 .dma = soc ## _DMA_SAIF ## _id, \
22 .dmairq = soc ## _INT_SAIF ## _id ##_DMA, \
25 #define mxs_saif_data_entry(soc, _id) \
26 [_id] = mxs_saif_data_entry_single(soc, _id)
28 #ifdef CONFIG_SOC_IMX28
29 const struct mxs_saif_data mx28_saif_data
[] __initconst
= {
30 mxs_saif_data_entry(MX28
, 0),
31 mxs_saif_data_entry(MX28
, 1),
35 struct platform_device
*__init
mxs_add_saif(const struct mxs_saif_data
*data
,
36 const struct mxs_saif_platform_data
*pdata
)
38 struct resource res
[] = {
40 .start
= data
->iobase
,
41 .end
= data
->iobase
+ SZ_4K
- 1,
42 .flags
= IORESOURCE_MEM
,
46 .flags
= IORESOURCE_IRQ
,
50 .flags
= IORESOURCE_DMA
,
52 .start
= data
->dmairq
,
54 .flags
= IORESOURCE_IRQ
,
59 return mxs_add_platform_device("mxs-saif", data
->id
, res
,
60 ARRAY_SIZE(res
), pdata
, sizeof(*pdata
));