Skip to contentSkip to conversation

ARM: DaVinci: ASoC: Add dummy codec support

PATCH In review Naresh Medisetty 2 participants 2 messages Apr 16, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 4/6 ARM: DaVinci: ASoC: Add dummy codec support

From: Naresh.Medisetty <[email protected]>

McASP on DM646x can operate in DIT (S/PDIF) where no codec is needed. This patch provides stub codec that can be used in these configurations. On DM646x EVM the McASP1 is connected to the S/PDIF out.

---
This patch applies against ALSA mainline - that's the topic/asoc branch of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git

 sound/soc/codecs/Kconfig             |    3 +
 sound/soc/codecs/Makefile            |    2 +
 sound/soc/codecs/spdif_transciever.c |   69 ++++++++++++++++++++++++++++++++++
 sound/soc/codecs/spdif_transciever.h |   17 ++++++++
 sound/soc/davinci/Kconfig            |    1 +
 5 files changed, 92 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/spdif_transciever.c
 create mode 100644 sound/soc/codecs/spdif_transciever.h
sound/soc/codecs/Kconfig +3 -0
index 121d63f..154c64c 100644
@@ -22,6 +22,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_TLV320AIC23 if I2C
 	select SND_SOC_TLV320AIC26 if SPI_MASTER
 	select SND_SOC_TLV320AIC3X if I2C
+	select SND_SOC_SPDIF
 	select SND_SOC_TWL4030 if TWL4030_CORE
 	select SND_SOC_UDA134X
 	select SND_SOC_UDA1380 if I2C
@@ -93,6 +94,8 @@ config SND_SOC_SSM2602
 
 config SND_SOC_TLV320AIC23
 	tristate
+config SND_SOC_SPDIF
+        tristate
 
 config SND_SOC_TLV320AIC26
 	tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE
sound/soc/codecs/Makefile +2 -0
index d8e15a4..10d5729 100644
@@ -10,6 +10,7 @@ snd-soc-ssm2602-objs := ssm2602.o
 snd-soc-tlv320aic23-objs := tlv320aic23.o
 snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
+snd-soc-spdif-objs := spdif_transciever.o
 snd-soc-twl4030-objs := twl4030.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
@@ -43,6 +44,7 @@ obj-$(CONFIG_SND_SOC_SSM2602)	+= snd-soc-ssm2602.o
 obj-$(CONFIG_SND_SOC_TLV320AIC23)	+= snd-soc-tlv320aic23.o
 obj-$(CONFIG_SND_SOC_TLV320AIC26)	+= snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)	+= snd-soc-tlv320aic3x.o
+obj-$(CONFIG_SND_SOC_SPDIF)	+= snd-soc-spdif.o
 obj-$(CONFIG_SND_SOC_TWL4030)	+= snd-soc-twl4030.o
 obj-$(CONFIG_SND_SOC_UDA134X)	+= snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)	+= snd-soc-uda1380.o
sound/soc/codecs/spdif_transciever.c new file +69 -0

69 lines not on this page · raw message

sound/soc/codecs/spdif_transciever.h new file +17 -0
new file mode 100644
index 0000000..296f2eb
@@ -0,0 +1,17 @@
+/*
+ * ALSA SoC DIT/DIR driver header
+ *
+ * Author:      Steve Chen,  <[email protected]>
+ * Copyright:   (C) 2008 MontaVista Software, Inc., <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef CODEC_STUBS_H
+#define CODEC_STUBS_H
+
+extern struct snd_soc_dai dit_stub_dai;
+
+#endif /* CODEC_STUBS_H */
sound/soc/davinci/Kconfig +1 -0
index 0ae84d4..03631a7 100644
@@ -26,6 +26,7 @@ config  SND_DM6467_SOC_EVM
         depends on SND_DAVINCI_SOC && MACH_DAVINCI_DM6467_EVM
         select SND_DAVINCI_SOC_I2S_MCASP
         select SND_SOC_TLV320AIC3X
+        select SND_SOC_SPDIF
         help
           Say Y if you want to add support for SoC audio on TI
           DaVinci DM6467 EVM platform.
Signature · 1 line
1.5.6
#1 lore raw

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 28

Quoted 7 lines · Naresh Medisetty
sound/soc/codecs/Kconfig +1 -0
 	select SND_SOC_TLV320AIC23 if I2C
 	select SND_SOC_TLV320AIC26 if SPI_MASTER
 	select SND_SOC_TLV320AIC3X if I2C
+	select SND_SOC_SPDIF
 	select SND_SOC_TWL4030 if TWL4030_CORE
 	select SND_SOC_UDA134X
 	select SND_SOC_UDA1380 if I2C

This should be alphabetically sorted....

sound/soc/codecs/Kconfig config SND_SOC_SSM2602 · line 98

Quoted 6 lines
sound/soc/codecs/Kconfig +2 -0
@@ -93,6 +94,8 @@ config SND_SOC_SSM2602
 
 config SND_SOC_TLV320AIC23
 	tristate
+config SND_SOC_SPDIF
+        tristate

...as should this. The same issue applies in the Makefile. You're also missing a blank line and your indentation seems wrong.

sound/soc/codecs/spdif_transciever.c line 6

Quoted 9 lines
sound/soc/codecs/spdif_transciever.c new file +6 -0
@@ -0,0 +1,69 @@
+/*
+ * ALSA SoC DaVinci DIT driver
+ *
+ *  TI DaVinci audio controller can operate in DIT (SPDI/F) where
+ *  no codec is needed.  This file provides stub codec that can be used
+ *  in these configurations.

These comments need refreshing.

sound/soc/codecs/spdif_transciever.c line 56

Quoted 9 lines
sound/soc/codecs/spdif_transciever.c new file +9 -0
+static struct platform_driver davinci_dit_driver = {
+	.probe		= davinci_dit_probe,
+	.remove		= davinci_dit_remove,
+	.driver		= {
+		.name	= "davinci-dit",
+		.owner	= THIS_MODULE,
+	},
+};
+

Better to s/davinci/spdif/ for the driver name everywhere - it'd look odd to be registering a DaVinci specific thing on another platform.

sound/soc/codecs/spdif_transciever.c config SND_DM6467_SOC_EVM · line 32

Quoted 8 lines
sound/soc/codecs/spdif_transciever.c new file +1 -0
@@ -26,6 +26,7 @@ config  SND_DM6467_SOC_EVM
         depends on SND_DAVINCI_SOC && MACH_DAVINCI_DM6467_EVM
         select SND_DAVINCI_SOC_I2S_MCASP
         select SND_SOC_TLV320AIC3X
+        select SND_SOC_SPDIF
         help
           Say Y if you want to add support for SoC audio on TI
           DaVinci DM6467 EVM platform.

This should be part of a separate patch which adds the code to hook up the DAI.