Commit 30443408 authored by Scott Jiang's avatar Scott Jiang Committed by Mark Brown

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: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
parent 7171511e
...@@ -290,19 +290,19 @@ static int bf5xx_pcm_silence(struct snd_pcm_substream *substream, ...@@ -290,19 +290,19 @@ static int bf5xx_pcm_silence(struct snd_pcm_substream *substream,
unsigned int sample_size = runtime->sample_bits / 8; unsigned int sample_size = runtime->sample_bits / 8;
void *buf = runtime->dma_area; void *buf = runtime->dma_area;
struct bf5xx_i2s_pcm_data *dma_data; struct bf5xx_i2s_pcm_data *dma_data;
unsigned int offset, size; unsigned int offset, samples;
dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
if (dma_data->tdm_mode) { if (dma_data->tdm_mode) {
offset = pos * 8 * sample_size; offset = pos * 8 * sample_size;
size = count * 8 * sample_size; samples = count * 8;
} else { } else {
offset = frames_to_bytes(runtime, pos); offset = frames_to_bytes(runtime, pos);
size = frames_to_bytes(runtime, count); samples = count * runtime->channels;
} }
snd_pcm_format_set_silence(runtime->format, buf + offset, size); snd_pcm_format_set_silence(runtime->format, buf + offset, samples);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment