aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig3
-rw-r--r--arch/arm/plat-mxc/devices/Makefile4
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-spdif-audio.c29
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c65
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-spdif.c64
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h17
-rw-r--r--arch/arm/plat-mxc/include/mach/dma.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/mx51.h2
8 files changed, 189 insertions, 2 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index 92d29376248e..9eedc159c025 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -109,3 +109,6 @@ config IMX_HAVE_PLATFORM_PERFMON
config IMX_HAVE_PLATFORM_LDB
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 81f270548df2..6d08cf726608 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -36,4 +36,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_RANDOM_RNGC) += platform-imx-rngb.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_PERFMON) += platform-imx-perfmon.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_LDB) += platform-imx_ldb.o
obj-y += platform-imx-scc2.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 1baf909fc98a..86c1d896d353 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -401,3 +401,20 @@ struct imx_mxc_scc2_data {
struct platform_device *__init imx_add_mxc_scc2(
const struct imx_mxc_scc2_data *data);
+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 ef7751546f5f..2d5c7e2eff4b 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