diff options
author | Alan Tull <alan.tull@freescale.com> | 2011-05-18 16:32:35 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2011-09-17 23:04:25 +0800 |
commit | ed85ff32100063b05cdc15c9c6bb0f2b98827583 (patch) | |
tree | f33777c53b53aece985cd77441eb389eb91dfefb /arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c | |
parent | 0c2a37ea569fba79614bee4922fd1c76d4bde13c (diff) |
ENGR00139461-1 mxc alsa soc spdif driver
BugLink: http://bugs.launchpad.net/bugs/837155
S/PDIF tx and rx using ASoC layer.
Signed-off-by: Alan Tull <alan.tull@freescale.com>
Signed-off-by: Eric Miao <eric.miao@linaro.org>
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c')
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c b/arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c new file mode 100644 index 000000000000..516ebc52467f --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 Pengutronix + * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> + * + * Copyright (C) 2011 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ +#include <mach/hardware.h> +#include <mach/devices-common.h> + +#define MXC_SPDIF_TX_REG 0x2C +#define MXC_SPDIF_RX_REG 0x14 + +#define imx_spdif_dai_data_entry(soc) \ + { \ + .iobase = soc ## _SPDIF_BASE_ADDR, \ + .dmatx = soc ## _DMA_REQ_SPDIF_TX, \ + .dmarx = soc ## _DMA_REQ_SPDIF_RX, \ + } + +#ifdef CONFIG_SOC_IMX51 +const struct imx_spdif_dai_data imx51_spdif_dai_data __initconst = { + .iobase = MX51_SPDIF_BASE_ADDR, + .dmatx = MX51_DMA_REQ_SPDIF, + }; +#endif /* ifdef CONFIG_SOC_IMX51 */ + +#ifdef CONFIG_SOC_IMX53 +const struct imx_spdif_dai_data imx53_spdif_dai_data __initconst = + imx_spdif_dai_data_entry(MX53); +#endif /* ifdef CONFIG_SOC_IMX53 */ + +struct platform_device *__init imx_add_spdif_dai( + const struct imx_spdif_dai_data *data) +{ + struct resource res[] = { + { + .name = "tx_reg", + .start = data->iobase + MXC_SPDIF_TX_REG, + .end = data->iobase + MXC_SPDIF_TX_REG, + .flags = IORESOURCE_DMA, + }, { + .name = "rx_reg", + .start = data->iobase + MXC_SPDIF_RX_REG, + .end = data->iobase + MXC_SPDIF_RX_REG, + .flags = IORESOURCE_DMA, + }, { + .name = "tx", + .start = data->dmatx, + .end = data->dmatx, + .flags = IORESOURCE_DMA, + }, { + .name = "rx", + .start = data->dmarx, + .end = data->dmarx, + .flags = IORESOURCE_DMA, + }, + }; + + return imx_add_platform_device("imx-spdif-dai", 0, + res, ARRAY_SIZE(res), NULL, 0); +} |