summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlison Wang <b18965@freescale.com>2012-07-27 11:06:36 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-12 16:49:51 -0400
commitcb9324a27200e6ba9c39a0e2536336d8cb35d3ab (patch)
tree1560b4b829bebaaccab91fc5ff12b7da1c8660e4
parent8577543d132a5d7fc7e4c509c61def155e4991f4 (diff)
ENGR00212251-1: sai: add platform support for SAI driver
Add platform support for SAI driver. Signed-off-by: Alison Wang <b18965@freescale.com>
-rw-r--r--arch/arm/plat-mxc/devices/platform-mvf-sai.c54
-rw-r--r--arch/arm/plat-mxc/include/mach/sai.h14
-rw-r--r--include/linux/fsl_devices.h1
3 files changed, 69 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-mvf-sai.c b/arch/arm/plat-mxc/devices/platform-mvf-sai.c
new file mode 100644
index 000000000000..af57be1777b7
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mvf-sai.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2012 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 mvf_sai_data_entry_single(soc, id, size) \
+ { \
+ .iobase = soc ## _SAI ## id ## _BASE_ADDR, \
+ .iosize = size, \
+ .irq = soc ## _INT_SAI ## id, \
+ .dmatx0 = DMA_MUX03_SAI ## id ## _TX, \
+ .dmarx0 = DMA_MUX03_SAI ## id ## _RX, \
+ }
+
+const struct mvf_sai_data mvfa5_sai_data[] __initconst = {
+ mvf_sai_data_entry_single(MVF, 0, SZ_4K),
+ mvf_sai_data_entry_single(MVF, 1, SZ_4K),
+ mvf_sai_data_entry_single(MVF, 2, SZ_4K),
+};
+
+struct platform_device *__init mvf_add_sai(
+ int id,
+ const struct mvf_sai_data *data,
+ const struct mvf_sai_platform_data *pdata)
+{
+ struct resource res[] = {
+ {
+ .start = data->iobase,
+ .end = data->iobase + data->iosize - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = data->irq,
+ .end = data->irq,
+ .flags = IORESOURCE_IRQ,
+ },
+#define DMARES(_name) { \
+ .name = #_name, \
+ .start = data->dma ## _name, \
+ .end = data->dma ## _name, \
+ .flags = IORESOURCE_DMA, \
+}
+ DMARES(tx0),
+ DMARES(rx0),
+ };
+
+ return imx_add_platform_device("mvf-sai", data->id,
+ res, ARRAY_SIZE(res),
+ pdata, sizeof(*pdata));
+}
diff --git a/arch/arm/plat-mxc/include/mach/sai.h b/arch/arm/plat-mxc/include/mach/sai.h
new file mode 100644
index 000000000000..f47630006248
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/sai.h
@@ -0,0 +1,14 @@
+#ifndef __MACH_SAI_H
+#define __MACH_SAI_H
+
+struct mvf_sai_platform_data {
+ unsigned int flags;
+#define MVF_SAI_DMA (1 << 0)
+#define MVF_SAI_USE_AC97 (1 << 1)
+#define MVF_SAI_NET (1 << 2)
+#define MVF_SAI_TRA_SYN (1 << 3)
+#define MVF_SAI_REC_SYN (1 << 4)
+#define MVF_SAI_USE_I2S_SLAVE (1 << 5)
+};
+
+#endif /* __MACH_SAI_H */
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 5b701a8c12f8..2567d84afb73 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -344,6 +344,7 @@ struct mxc_otp_platform_data {
*/
struct mxc_audio_platform_data {
int ssi_num;
+ int sai_num;
int src_port;
int ext_port;