[alsa-devel] [PATCH] ASoC: Support 8 bit samples in soc-util

Jaroslav Kysela perex at perex.cz
Mon Jan 31 23:27:41 CET 2011


On Mon, 31 Jan 2011, Mark Brown wrote:

> Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>

Is any reason to avoid using the snd_pcm_format_width() function here?

 						Jaroslav

> ---
> sound/soc/soc-utils.c |    4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
> index 1d07b93..e31d843 100644
> --- a/sound/soc/soc-utils.c
> +++ b/sound/soc/soc-utils.c
> @@ -29,6 +29,10 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
> 	int sample_size;
>
> 	switch (params_format(params)) {
> +	case SNDRV_PCM_FORMAT_S8:
> +	case SNDRV_PCM_FORMAT_U8:
> +		sample_size = 8;
> +		break;
> 	case SNDRV_PCM_FORMAT_S16_LE:
> 	case SNDRV_PCM_FORMAT_S16_BE:
> 		sample_size = 16;

-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.



More information about the Alsa-devel mailing list