提交 3d8b2ce0 编写于 作者: M Mark Brown

ASoC: Use snd_pcm_format_width() in snd_soc_params_to_frame_size()

Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 2bc9a81e
...@@ -28,26 +28,9 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params) ...@@ -28,26 +28,9 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
{ {
int sample_size; int sample_size;
switch (params_format(params)) { sample_size = snd_pcm_format_width(params_format(params));
case SNDRV_PCM_FORMAT_S16_LE: if (sample_size < 0)
case SNDRV_PCM_FORMAT_S16_BE: return sample_size;
sample_size = 16;
break;
case SNDRV_PCM_FORMAT_S20_3LE:
case SNDRV_PCM_FORMAT_S20_3BE:
sample_size = 20;
break;
case SNDRV_PCM_FORMAT_S24_LE:
case SNDRV_PCM_FORMAT_S24_BE:
sample_size = 24;
break;
case SNDRV_PCM_FORMAT_S32_LE:
case SNDRV_PCM_FORMAT_S32_BE:
sample_size = 32;
break;
default:
return -ENOTSUPP;
}
return snd_soc_calc_frame_size(sample_size, params_channels(params), return snd_soc_calc_frame_size(sample_size, params_channels(params),
1); 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册