ARM: DaVinci: ASoC: Add dummy codec support
PATCH 4/5 ARM: DaVinci: ASoC: Add dummy codec support
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/davinci_codec_stubs.c | 83 ++++++++++++++++++++++++++++++++ sound/soc/codecs/davinci_codec_stubs.h | 23 +++++++++ 4 files changed, 111 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/davinci_codec_stubs.c create mode 100644 sound/soc/codecs/davinci_codec_stubs.h
sound/soc/codecs/Kconfig +3 -0
@@ -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_CODEC_STUBS select SND_SOC_TWL4030 if TWL4030_CORE select SND_SOC_UDA134X select SND_SOC_UDA1380 if I2C
@@ -91,6 +92,8 @@ config SND_SOC_SSM2602 config SND_SOC_TLV320AIC23 tristate +config SND_SOC_CODEC_STUBS + tristate config SND_SOC_TLV320AIC26 tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE
sound/soc/codecs/Makefile +2 -0
@@ -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-davinci_stubs-objs := davinci_codec_stubs.o snd-soc-twl4030-objs := twl4030.o snd-soc-uda134x-objs := uda134x.o snd-soc-uda1380-objs := uda1380.o
@@ -41,6 +42,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_CODEC_STUBS) += snd-soc-davinci_stubs.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/davinci_codec_stubs.c new file +83 -0
83 lines not on this page · raw message
sound/soc/codecs/davinci_codec_stubs.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* 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 + +#ifdef CONFIG_SND_SOC_CODEC_STUBS +extern struct snd_soc_dai dit_stub_dai[]; +extern struct snd_soc_dai dir_stub_dai[]; +#else +#define dit_stub_dai NULL +#define dir_stub_dai NULL +#endif + +#endif /* CODEC_STUBS_H */
Signature · 1 line
1.5.6
Quoted 3 lines · Naresh Medisetty
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 looks pretty good apart from the small issues below but it occurs to me that this would probably work for any S/PDIF transciever - perhaps the driver should be renamed to something more generic like spdif_transciever?
sound/soc/codecs/davinci_codec_stubs.c line 64
Quoted 3 lines
sound/soc/codecs/davinci_codec_stubs.c new file +3
-0+static struct platform_driver davinci_dit_driver = { + .probe = davinci_dit_probe, + .remove = davici_dit_remove,
Spelling mistake?
sound/soc/codecs/davinci_codec_stubs.h line 21
Quoted 7 lines
sound/soc/codecs/davinci_codec_stubs.h new file +7
-0+#ifdef CONFIG_SND_SOC_CODEC_STUBS +extern struct snd_soc_dai dit_stub_dai[]; +extern struct snd_soc_dai dir_stub_dai[]; +#else +#define dit_stub_dai NULL +#define dir_stub_dai NULL +#endif
No need to do the ifdefs here.