2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <mach/hardware.h>
22 #include <mach/devices-common.h>
24 #define imx5_spdif_data_entry_single(soc) \
26 .iobase = soc ## _SPDIF_BASE_ADDR, \
27 .irq = soc ## _INT_SPDIF, \
30 #ifdef CONFIG_SOC_IMX50
31 const struct imx_spdif_data imx50_imx_spdif_data __initconst =
32 imx5_spdif_data_entry_single(MX53);
33 #endif /* ifdef CONFIG_SOC_IMX50 */
35 #ifdef CONFIG_SOC_IMX51
36 const struct imx_spdif_data imx51_imx_spdif_data __initconst =
37 imx5_spdif_data_entry_single(MX51);
38 #endif /* ifdef CONFIG_SOC_IMX51 */
40 #ifdef CONFIG_SOC_IMX53
41 const struct imx_spdif_data imx53_imx_spdif_data __initconst =
42 imx5_spdif_data_entry_single(MX53);
43 #endif /* ifdef CONFIG_SOC_IMX53 */
45 struct platform_device *__init imx_add_spdif(
46 const struct imx_spdif_data *data,
47 const struct mxc_spdif_platform_data *pdata)
49 struct resource res[] = {
51 .start = data->iobase,
52 .end = data->iobase + 0x50,
53 .flags = IORESOURCE_MEM,
57 .flags = IORESOURCE_IRQ,
61 return imx_add_platform_device("mxc_spdif", 0,
62 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));