Commit 4bb4582d96337d181a560838fc9192899abfafbb
Committed by
Jiri Slaby
1 parent
465da614d4
Exists in
ti-linux-3.12.y
and in
2 other branches
ASoC: blackfin: use samples to set silence
commit 30443408fd7201fd1911b09daccf92fae3cc700d upstream. The third parameter for snd_pcm_format_set_silence needs the number of samples instead of sample bytes. Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
sound/soc/blackfin/bf5xx-i2s-pcm.c
... | ... | @@ -293,19 +293,19 @@ |
293 | 293 | unsigned int sample_size = runtime->sample_bits / 8; |
294 | 294 | void *buf = runtime->dma_area; |
295 | 295 | struct bf5xx_i2s_pcm_data *dma_data; |
296 | - unsigned int offset, size; | |
296 | + unsigned int offset, samples; | |
297 | 297 | |
298 | 298 | dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
299 | 299 | |
300 | 300 | if (dma_data->tdm_mode) { |
301 | 301 | offset = pos * 8 * sample_size; |
302 | - size = count * 8 * sample_size; | |
302 | + samples = count * 8; | |
303 | 303 | } else { |
304 | 304 | offset = frames_to_bytes(runtime, pos); |
305 | - size = frames_to_bytes(runtime, count); | |
305 | + samples = count * runtime->channels; | |
306 | 306 | } |
307 | 307 | |
308 | - snd_pcm_format_set_silence(runtime->format, buf + offset, size); | |
308 | + snd_pcm_format_set_silence(runtime->format, buf + offset, samples); | |
309 | 309 | |
310 | 310 | return 0; |
311 | 311 | } |