[alsa-devel] [PATCH 2/3] ASoC: Blackfin: add multi-channel supporting in Blackfin ASoC driver and AD1980 codec driver
Takashi Iwai
tiwai at suse.de
Tue Oct 21 08:46:11 CEST 2008
At Tue, 21 Oct 2008 11:36:12 +0800,
Bryan Wu wrote:
>
> From: Cliff Cai <cliff.cai at analog.com>
>
> Signed-off-by: Cliff Cai <cliff.cai at analog.com>
> Signed-off-by: Bryan Wu <cooloney at kernel.org>
> ---
> sound/soc/blackfin/Kconfig | 8 ++
> sound/soc/blackfin/bf5xx-ac97-pcm.c | 45 +++++++----
> sound/soc/blackfin/bf5xx-ac97.c | 152 +++++++++++++++++++++--------------
> sound/soc/blackfin/bf5xx-ac97.h | 35 +++++++-
> sound/soc/codecs/ad1980.c | 5 +-
> 5 files changed, 163 insertions(+), 82 deletions(-)
>
> diff --git a/sound/soc/blackfin/Kconfig b/sound/soc/blackfin/Kconfig
> index 3fce187..e58d5b1 100644
> --- a/sound/soc/blackfin/Kconfig
> +++ b/sound/soc/blackfin/Kconfig
> @@ -55,6 +55,14 @@ config SND_MMAP_SUPPORT
> Say y if you want AC97 driver to support mmap mode.
> We introduce an intermediate buffer to simulate mmap.
>
> +config SND_MULTICHAN_SUPPORT
SND_BF5XX_MULTICHAN_SUPPORT is preferred because it's pretty specific
to bf5xx.
(Well, the same about SND_MMAP_SUPPORT, which I overlooked it...)
> + bool "Enable Multichannel Support"
> + depends on SND_BF5XX_AC97
> + default n
> + help
> + Say y if you want AC97 driver to support up to 5.1 channel audio.
> + this mode will consume much more memory for DMA.
> +
> config SND_BF5XX_SOC_SPORT
> tristate
>
> diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
> index 25e50d2..eb1531f 100644
> --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
> +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
> @@ -43,24 +43,34 @@
> #include "bf5xx-ac97.h"
> #include "bf5xx-sport.h"
>
> +static unsigned int ac97_chan_mask[] = {
> + SP_FL, /* Mono */
> + SP_STEREO, /* Stereo */
> + SP_2DOT1, /* 2.1*/
> + SP_QUAD,/*Quadraquic*/
> + SP_FL | SP_FR | SP_FC | SP_SL | SP_SR,/*5 channels */
> + SP_5DOT1, /* 5.1 */
> +};
> +
> #if defined(CONFIG_SND_MMAP_SUPPORT)
> static void bf5xx_mmap_copy(struct snd_pcm_substream *substream,
> snd_pcm_uframes_t count)
> {
> struct snd_pcm_runtime *runtime = substream->runtime;
> struct sport_device *sport = runtime->private_data;
> + unsigned int chan_mask = ac97_chan_mask[substream->runtime->channels - 1];
"substream->" can be removed here. Ditto for the lines below.
> static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream)
> {
> + #if defined(CONFIG_SND_MMAP_SUPPORT)
Put '#' at the beginning of the line.
Also, in general, I recommend you to run checkpatch.pl once before
submitting patches.
thanks,
Takashi
More information about the Alsa-devel
mailing list