diff options
author | Alan Tull <alan.tull@freescale.com> | 2011-05-18 16:32:35 -0500 |
---|---|---|
committer | Alan Tull <alan.tull@freescale.com> | 2011-06-08 16:02:16 -0500 |
commit | 91af5a07bf2a43e0dac803cf01def4add76f79a5 (patch) | |
tree | b9986c4488914c72f38ad2fab579d07eacfefb87 /arch/arm/plat-mxc | |
parent | c2e515928df7c18e350179db69b0dfdab06de281 (diff) |
ENGR00139461-1 mxc alsa soc spdif driver
S/PDIF tx and rx using ASoC layer.
Signed-off-by: Alan Tull <alan.tull@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-spdif-audio.c | 29 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c | 65 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-spdif.c | 64 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 18 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/dma.h | 7 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx51.h | 2 |
8 files changed, 193 insertions, 4 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 18205c46b3e7..d6591b3efa48 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig @@ -114,10 +114,13 @@ config IMX_HAVE_PLATFORM_PERFMON bool config IMX_HAVE_PLATFORM_LDB - bool + bool config IMX_HAVE_PLATFORM_IMX_PXP - bool + bool config IMX_HAVE_PLATFORM_IMX_EPDC - bool
\ No newline at end of file + bool + +config IMX_HAVE_PLATFORM_IMX_SPDIF + bool diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 05d7fbf6fb2c..62cbaf7a5a57 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile @@ -40,3 +40,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_LDB) += platform-imx_ldb.o obj-y += platform-imx-scc2.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_PXP) += platform-imx-pxp.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_EPDC) += platform-imx-epdc-fb.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SPDIF) += platform-imx-spdif.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SPDIF) += platform-imx-spdif-dai.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SPDIF) += platform-imx-spdif-audio.o diff --git a/arch/arm/plat-mxc/devices/platform-imx-spdif-audio.c b/arch/arm/plat-mxc/devices/platform-imx-spdif-audio.c new file mode 100644 index 000000000000..4a0cb7bf9a1f --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-spdif-audio.c @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include <mach/hardware.h> +#include <mach/devices-common.h> + +struct platform_device *__init imx_add_spdif_audio_device(void) +{ + return imx_add_platform_device("imx-spdif-audio-device", 0, + NULL, 0, NULL, 0); +} + 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); +} diff --git a/arch/arm/plat-mxc/devices/platform-imx-spdif.c b/arch/arm/plat-mxc/devices/platform-imx-spdif.c new file mode 100644 index 000000000000..80a5e782067e --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-spdif.c @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include <mach/hardware.h> +#include <mach/devices-common.h> + +#define imx5_spdif_data_entry_single(soc) \ + { \ + .iobase = soc ## _SPDIF_BASE_ADDR, \ + .irq = soc ## _INT_SPDIF, \ + } + +#ifdef CONFIG_SOC_IMX50 +const struct imx_spdif_data imx50_imx_spdif_data __initconst = + imx5_spdif_data_entry_single(MX53); +#endif /* ifdef CONFIG_SOC_IMX50 */ + +#ifdef CONFIG_SOC_IMX51 +const struct imx_spdif_data imx51_imx_spdif_data __initconst = + imx5_spdif_data_entry_single(MX51); +#endif /* ifdef CONFIG_SOC_IMX51 */ + +#ifdef CONFIG_SOC_IMX53 +const struct imx_spdif_data imx53_imx_spdif_data __initconst = + imx5_spdif_data_entry_single(MX53); +#endif /* ifdef CONFIG_SOC_IMX53 */ + +struct platform_device *__init imx_add_spdif( + const struct imx_spdif_data *data, + const struct mxc_spdif_platform_data *pdata) +{ + struct resource res[] = { + { + .start = data->iobase, + .end = data->iobase + 0x50, + .flags = IORESOURCE_MEM, + }, { + .start = data->irq, + .end = data->irq, + .flags = IORESOURCE_IRQ, + }, + }; + + return imx_add_platform_device("mxc_spdif", 0, + res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); +} + diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 84f5bd6a19cf..0189eff4d7ef 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h @@ -429,3 +429,21 @@ struct imx_epdc_data { struct platform_device *__init imx_add_imx_epdc( const struct imx_epdc_data *data, const struct imx_epdc_fb_platform_data *pdata); + +struct imx_spdif_data { + resource_size_t iobase; + resource_size_t irq; +}; +struct platform_device *__init imx_add_spdif( + const struct imx_spdif_data *data, + const struct mxc_spdif_platform_data *pdata); + +struct imx_spdif_dai_data { + resource_size_t iobase; + resource_size_t dmatx; + resource_size_t dmarx; +}; +struct platform_device *__init imx_add_spdif_dai( + const struct imx_spdif_dai_data *data); + +struct platform_device *__init imx_add_spdif_audio_device(void); diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/arch/arm/plat-mxc/include/mach/dma.h index 261b2c5d300d..df72f278ac35 100644 --- a/arch/arm/plat-mxc/include/mach/dma.h +++ b/arch/arm/plat-mxc/include/mach/dma.h @@ -53,6 +53,13 @@ struct imx_dma_data { int priority; }; +struct imx_pcm_dma_params { + enum sdma_peripheral_type peripheral_type; + int dma; + unsigned long dma_addr; + int burstsize; +}; + static inline int imx_dma_is_ipu(struct dma_chan *chan) { return !strcmp(dev_name(chan->device->dev), "ipu-core"); diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h index a2ee1d90c280..9db86a193ed2 100644 --- a/arch/arm/plat-mxc/include/mach/mx51.h +++ b/arch/arm/plat-mxc/include/mach/mx51.h @@ -358,7 +358,7 @@ #define MX51_MXC_INT_OWIRE 88 #define MX51_MXC_INT_CTI1_TG2 89 #define MX51_MXC_INT_SJC 90 -#define MX51_MXC_INT_SPDIF 91 +#define MX51_INT_SPDIF 91 #define MX51_INT_TVE 92 #define MX51_MXC_INT_FIRI 93 #define MX51_INT_PWM2 94 |