summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorScott Jiang <scott.jiang.linux@gmail.com>2014-07-18 16:14:57 +0800
committerMark Brown <broonie@linaro.org>2014-07-17 12:27:56 +0100
commit30443408fd7201fd1911b09daccf92fae3cc700d (patch)
tree9bb07d0e83eb87a0739eef275dedff0548c7667e /sound
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
downloadop-kernel-dev-30443408fd7201fd1911b09daccf92fae3cc700d.zip
op-kernel-dev-30443408fd7201fd1911b09daccf92fae3cc700d.tar.gz
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
Diffstat (limited to 'sound')
-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 a3881c4..bcf5913 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,
unsigned int sample_size = runtime->sample_bits / 8;
void *buf = runtime->dma_area;
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);
if (dma_data->tdm_mode) {
offset = pos * 8 * sample_size;
- size = count * 8 * sample_size;
+ samples = count * 8;
} else {
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;
}
OpenPOWER on IntegriCloud