aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-utils.c')
-rw-r--r--sound/soc/soc-utils.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index 1d07b931f3d8..3f45e6a439bf 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -28,26 +28,9 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
28{ 28{
29 int sample_size; 29 int sample_size;
30 30
31 switch (params_format(params)) { 31 sample_size = snd_pcm_format_width(params_format(params));
32 case SNDRV_PCM_FORMAT_S16_LE: 32 if (sample_size < 0)
33 case SNDRV_PCM_FORMAT_S16_BE: 33 return sample_size;
34 sample_size = 16;
35 break;
36 case SNDRV_PCM_FORMAT_S20_3LE:
37 case SNDRV_PCM_FORMAT_S20_3BE:
38 sample_size = 20;
39 break;
40 case SNDRV_PCM_FORMAT_S24_LE:
41 case SNDRV_PCM_FORMAT_S24_BE:
42 sample_size = 24;
43 break;
44 case SNDRV_PCM_FORMAT_S32_LE:
45 case SNDRV_PCM_FORMAT_S32_BE:
46 sample_size = 32;
47 break;
48 default:
49 return -ENOTSUPP;
50 }
51 34
52 return snd_soc_calc_frame_size(sample_size, params_channels(params), 35 return snd_soc_calc_frame_size(sample_size, params_channels(params),
53 1); 36 1);