[alsa-devel] [PATCH 7/9] ARM: DaVinci: ASoC: Adds ALSA SoC DIT/DIR driver support for DM646X
broonie at sirena.org.uk
Mon Mar 16 16:25:18 CET 2009
On Mon, Mar 16, 2009 at 08:05:48AM -0400, Naresh Medisetty wrote:
> --- /dev/null
> +++ b/sound/soc/codecs/codec_stubs.c
> @@ -0,0 +1,63 @@
> + * ALSA SoC DaVinci DIT/DIR driver
> + *
> + * TI DaVinci audio controller can operate in DIT/DIR (SPDI/F) where
> + * no codec is needed. This file provides stub codec that can be used
> + * in these configurations.
Either the driver is a generic driver (in which case this comment should
reflect that) or it's specific to this hardware (in which case the name
is entirely inappropriate)...
> +#define STUB_RATES SNDRV_PCM_RATE_8000_96000
> +#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
> + SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
...looking at this and the rest of the definitions I'd suggest that the
driver is specific to a particular device at the minute.
> +static int __init dit_modinit(void)
> + return snd_soc_register_dai(dit_stub_dai);
> +static void __exit dit_exit(void)
> + snd_soc_unregister_dai(dit_stub_dai);
It should really probe as a platform device and register the DAIs when
that happens (see wm8350 and wm8400 for examples). You could make the
driver more generic by passing in the parameters as platform data.
More information about the Alsa-devel