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)
37 struct resource res[] = {
39 .start = data->iobase,
40 .end = data->iobase + SZ_4K - 1,
41 .flags = IORESOURCE_MEM,
45 .flags = IORESOURCE_IRQ,
49 .flags = IORESOURCE_DMA,
51 .start = data->dmairq,
53 .flags = IORESOURCE_IRQ,
58 return mxs_add_platform_device("mxs-saif", data->id, res,
59 ARRAY_SIZE(res), NULL, 0);