summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorCharles Keepax2016-02-02 17:41:36 +0100
committerMark Brown2016-02-02 20:27:11 +0100
commitda2b33589013b4cb3dad163f50fae060896cb8b6 (patch)
tree205ae38a10f9c18d5b5f023fe127633442c77efc /sound/soc/codecs
parentLinux 4.5-rc1 (diff)
downloadkernel-qcow2-linux-da2b33589013b4cb3dad163f50fae060896cb8b6.tar.gz
kernel-qcow2-linux-da2b33589013b4cb3dad163f50fae060896cb8b6.tar.xz
kernel-qcow2-linux-da2b33589013b4cb3dad163f50fae060896cb8b6.zip
ASoC: wm_adsp: Return sample rate in wm_adsp_compr_pointer
We should return a valid sample rate from the pointer callback, this patch adds this into the driver. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/wm_adsp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 33806d487b8a..68b85ee67586 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -295,6 +295,8 @@ struct wm_adsp_compr {
u32 *raw_buf;
unsigned int copied_total;
+
+ unsigned int sample_rate;
};
#define WM_ADSP_DATA_WORD_SIZE 3
@@ -2471,6 +2473,8 @@ int wm_adsp_compr_set_params(struct snd_compr_stream *stream,
if (!compr->raw_buf)
return -ENOMEM;
+ compr->sample_rate = params->codec.sample_rate;
+
return 0;
}
EXPORT_SYMBOL_GPL(wm_adsp_compr_set_params);
@@ -2911,6 +2915,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
tstamp->copied_total = compr->copied_total;
tstamp->copied_total += buf->avail * WM_ADSP_DATA_WORD_SIZE;
+ tstamp->sampling_rate = compr->sample_rate;
out:
mutex_unlock(&dsp->pwr_lock);