aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Jiang <scott.jiang.linux@gmail.com>2014-07-18 04:14:57 -0400
committerMark Brown <broonie@linaro.org>2014-07-17 07:27:56 -0400
commit30443408fd7201fd1911b09daccf92fae3cc700d (patch)
tree9bb07d0e83eb87a0739eef275dedff0548c7667e
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
ASoC: blackfin: use samples to set silence
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> Cc: stable@vger.kernel.org
-rw-r--r--sound/soc/blackfin/bf5xx-i2s-pcm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index a3881c4381c9..bcf591373a7a 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -290,19 +290,19 @@ static int bf5xx_pcm_silence(struct snd_pcm_substream *substream,
290 unsigned int sample_size = runtime->sample_bits / 8; 290 unsigned int sample_size = runtime->sample_bits / 8;
291 void *buf = runtime->dma_area; 291 void *buf = runtime->dma_area;
292 struct bf5xx_i2s_pcm_data *dma_data; 292 struct bf5xx_i2s_pcm_data *dma_data;
293 unsigned int offset, size; 293 unsigned int offset, samples;
294 294
295 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 295 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
296 296
297 if (dma_data->tdm_mode) { 297 if (dma_data->tdm_mode) {
298 offset = pos * 8 * sample_size; 298 offset = pos * 8 * sample_size;
299 size = count * 8 * sample_size; 299 samples = count * 8;
300 } else { 300 } else {
301 offset = frames_to_bytes(runtime, pos); 301 offset = frames_to_bytes(runtime, pos);
302 size = frames_to_bytes(runtime, count); 302 samples = count * runtime->channels;
303 } 303 }
304 304
305 snd_pcm_format_set_silence(runtime->format, buf + offset, size); 305 snd_pcm_format_set_silence(runtime->format, buf + offset, samples);
306 306
307 return 0; 307 return 0;
308} 308}