[alsa-devel] [PATCH] ASOC: utils: Fix the dummy_codec

Vinod Koul vinod.koul at linux.intel.com
Thu Jun 7 10:35:58 CEST 2012


On Wed, 2012-06-06 at 10:02 +0200, Selma Bensaid wrote:
> This patch consists in settings the channels_min, rates and formats
> of the dummy codec DAI driver to enable the creation of the PCM streams
> using it.
patch title is not clear what you are fixing in dummy_codec, pls
consider appropriate title.

> 
> Signed-off-by: Selma Bensaid <selma.bensaid at intel.com>
> ---
>  sound/soc/soc-utils.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
> index 6005370..465a094 100644
> --- a/sound/soc/soc-utils.c
> +++ b/sound/soc/soc-utils.c
> @@ -89,9 +89,27 @@ static struct snd_soc_platform_driver dummy_platform = {
>  	.ops = &dummy_dma_ops,
>  };
>  
> +#define NULL_FORMATS \
> +	(SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_U16 |\
> +	SNDRV_PCM_FMTBIT_S24 | SNDRV_PCM_FMTBIT_U24 |\
> +	SNDRV_PCM_FMTBIT_S32 | SNDRV_PCM_FMTBIT_U32)
Would it make sense to have a CONTINUOUS format macro instead?
As people start using these, I can see this becoming big and ugly.

But are the other formats defined in pcm.h widely used?

> +
>  static struct snd_soc_codec_driver dummy_codec;
>  static struct snd_soc_dai_driver dummy_dai = {
>  	.name = "snd-soc-dummy-dai",
> +	.playback = {
> +		.channels_min = 1,
> +		.channels_max = 16,
> +		.rates = SNDRV_PCM_RATE_CONTINUOUS,
> +		.formats = NULL_FORMATS,
> +	},
> +	.capture = {
> +		.channels_min = 1,
> +		.channels_max = 16,
> +		.rates = SNDRV_PCM_RATE_CONTINUOUS,
> +		.formats = NULL_FORMATS,
> +	},
> +	.ops = NULL,
>  };
>  
>  static __devinit int snd_soc_dummy_probe(struct platform_device *pdev)


-- 
~Vinod



More information about the Alsa-devel mailing list