[alsa-devel] [PATCH 1/5] ASoC: ad1836: Use params_width() rather than explicit memory format

Lars-Peter Clausen lars at metafoo.de
Thu Jan 9 11:27:27 CET 2014


On 01/08/2014 07:51 PM, Mark Brown wrote:
> From: Mark Brown <broonie at linaro.org>

It would have been nice to have a least a small explanation why this is a
better approach. It might not be immediately obvious to somebody reading the
log later on.

> 
> Signed-off-by: Mark Brown <broonie at linaro.org>

All five patches in this series

Acked-by: Lars-Peter Clausen <lars at metafoo.de>

Thanks.

> ---
>  sound/soc/codecs/ad1836.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
> index d7c983862cf0..77f459868579 100644
> --- a/sound/soc/codecs/ad1836.c
> +++ b/sound/soc/codecs/ad1836.c
> @@ -168,15 +168,15 @@ static int ad1836_hw_params(struct snd_pcm_substream *substream,
>  	int word_len = 0;
>  
>  	/* bit size */
> -	switch (params_format(params)) {
> -	case SNDRV_PCM_FORMAT_S16_LE:
> +	switch (params_width(params)) {
> +	case 16:
>  		word_len = AD1836_WORD_LEN_16;
>  		break;
> -	case SNDRV_PCM_FORMAT_S20_3LE:
> +	case 20:
>  		word_len = AD1836_WORD_LEN_20;
>  		break;
> -	case SNDRV_PCM_FORMAT_S24_LE:
> -	case SNDRV_PCM_FORMAT_S32_LE:
> +	case 24:
> +	case 32:
>  		word_len = AD1836_WORD_LEN_24;
>  		break;
>  	default:
> 



More information about the Alsa-devel mailing list