summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Tull <r80115@freescale.com>2010-04-05 17:54:01 -0500
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:20:21 +0200
commit2dd7d6980a9f5f622e89183da684a6e150631f08 (patch)
treefb1ca82ff211cdf2d2aeaaf24b37f9acf6b5f0bf
parent5b93cac16c87d49a100184ebfbfe7ed33d68d3d4 (diff)
ENGR00122274 mx23: spdif playback
Support S/PDIF playback on the mx23evk. Signed-off-by: Alan Tull <r80115@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
-rw-r--r--arch/arm/mach-mx23/clock.c18
-rw-r--r--arch/arm/mach-mx23/device.c15
-rw-r--r--arch/arm/mach-mx23/mx23evk_pins.c14
-rw-r--r--sound/soc/codecs/mxs_spdif.c1
-rw-r--r--sound/soc/mxs/Kconfig3
-rw-r--r--sound/soc/mxs/mxs-spdif-dai.c1
6 files changed, 50 insertions, 2 deletions
diff --git a/arch/arm/mach-mx23/clock.c b/arch/arm/mach-mx23/clock.c
index d68f30109498..b73b4a6c8bc5 100644
--- a/arch/arm/mach-mx23/clock.c
+++ b/arch/arm/mach-mx23/clock.c
@@ -898,6 +898,20 @@ static unsigned long ssp_get_rate(struct clk *clk)
return clk->parent->get_rate(clk->parent) / reg;
}
+static unsigned long pcmspdif_get_rate(struct clk *clk)
+{
+ return clk->parent->get_rate(clk->parent) / 4;
+}
+
+static struct clk pcmspdif_clk = {
+ .parent = &pll_clk,
+ .get_rate = pcmspdif_get_rate,
+ .enable = mx23_raw_enable,
+ .disable = mx23_raw_disable,
+ .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_SPDIF,
+ .enable_bits = BM_CLKCTRL_SPDIF_CLKGATE,
+};
+
/* usb_clk for usb0 */
static struct clk usb_clk = {
.parent = &pll_clk,
@@ -1008,6 +1022,10 @@ static struct clk_lookup onchip_clocks[] = {
{
.con_id = "audio",
.clk = &audio_clk,
+ },
+ {
+ .con_id = "spdif",
+ .clk = &pcmspdif_clk,
}
};
diff --git a/arch/arm/mach-mx23/device.c b/arch/arm/mach-mx23/device.c
index b480c2b73e1c..9d56f9aa4ff9 100644
--- a/arch/arm/mach-mx23/device.c
+++ b/arch/arm/mach-mx23/device.c
@@ -718,6 +718,20 @@ static void mx23_init_battery(void)
}
#endif
+#if defined(CONFIG_SND_SOC_MXS_SPDIF) || \
+ defined(CONFIG_SND_SOC_MXS_SPDIF_MODULE)
+void __init mx23_init_spdif(void)
+{ struct platform_device *pdev;
+ pdev = mxs_get_device("mxs-spdif", 0);
+ if (pdev == NULL || IS_ERR(pdev))
+ return;
+ mxs_add_device(pdev, 3);
+}
+#else
+static inline mx23_init_spdif(void)
+{
+}
+#endif
int __init mx23_device_init(void)
{
@@ -733,6 +747,7 @@ int __init mx23_device_init(void)
mx23_init_rtc();
mx23_init_dcp();
mx23_init_mmc();
+ mx23_init_spdif();
mx23_init_lcdif();
mx23_init_pxp();
mx23_init_battery();
diff --git a/arch/arm/mach-mx23/mx23evk_pins.c b/arch/arm/mach-mx23/mx23evk_pins.c
index 459c6df833e1..8c8198c06291 100644
--- a/arch/arm/mach-mx23/mx23evk_pins.c
+++ b/arch/arm/mach-mx23/mx23evk_pins.c
@@ -497,7 +497,19 @@ static struct pin_desc mx23evk_fixed_pins[] = {
.voltage = PAD_3_3V,
},
#endif
-
+#if defined(CONFIG_SND_SOC_MXS_SPDIF) || \
+ defined(CONFIG_SND_SOC_MXS_SPDIF_MODULE)
+ {
+ .name = "SPDIF",
+ .id = PINID_ROTARYA,
+ .fun = PIN_FUN3,
+ .strength = PAD_12MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+#endif
};
#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)
diff --git a/sound/soc/codecs/mxs_spdif.c b/sound/soc/codecs/mxs_spdif.c
index a59f3a0fdefa..af47dcb547cf 100644
--- a/sound/soc/codecs/mxs_spdif.c
+++ b/sound/soc/codecs/mxs_spdif.c
@@ -30,6 +30,7 @@
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <asm/dma.h>
+#include <mach/hardware.h>
#include "mxs_spdif.h"
diff --git a/sound/soc/mxs/Kconfig b/sound/soc/mxs/Kconfig
index 10bed6d4f436..213feb404a6b 100644
--- a/sound/soc/mxs/Kconfig
+++ b/sound/soc/mxs/Kconfig
@@ -42,7 +42,8 @@ config SND_MXS_SOC_ADC
config SND_MXS_SOC_EVK_DEVB_SPDIF
tristate "SoC SPDIF support for MXS EVK Development Board"
- depends on SND_MXS_SOC && ARCH_MX28
+ default n
+ depends on SND_MXS_SOC && ARCH_MXS
select SND_MXS_SOC_SPDIF_DAI
select SND_SOC_MXS_SPDIF
help
diff --git a/sound/soc/mxs/mxs-spdif-dai.c b/sound/soc/mxs/mxs-spdif-dai.c
index 5c9f93d73801..052c404c496d 100644
--- a/sound/soc/mxs/mxs-spdif-dai.c
+++ b/sound/soc/mxs/mxs-spdif-dai.c
@@ -22,6 +22,7 @@
#include <sound/pcm.h>
#include <sound/soc.h>
#include <mach/dma.h>
+#include <mach/hardware.h>
#include "../codecs/mxs_spdif.h"
#include "mxs-pcm.h"