Commit da2b3358 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 92e963f5
...@@ -295,6 +295,8 @@ struct wm_adsp_compr { ...@@ -295,6 +295,8 @@ struct wm_adsp_compr {
u32 *raw_buf; u32 *raw_buf;
unsigned int copied_total; unsigned int copied_total;
unsigned int sample_rate;
}; };
#define WM_ADSP_DATA_WORD_SIZE 3 #define WM_ADSP_DATA_WORD_SIZE 3
...@@ -2471,6 +2473,8 @@ int wm_adsp_compr_set_params(struct snd_compr_stream *stream, ...@@ -2471,6 +2473,8 @@ int wm_adsp_compr_set_params(struct snd_compr_stream *stream,
if (!compr->raw_buf) if (!compr->raw_buf)
return -ENOMEM; return -ENOMEM;
compr->sample_rate = params->codec.sample_rate;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(wm_adsp_compr_set_params); EXPORT_SYMBOL_GPL(wm_adsp_compr_set_params);
...@@ -2911,6 +2915,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream, ...@@ -2911,6 +2915,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
tstamp->copied_total = compr->copied_total; tstamp->copied_total = compr->copied_total;
tstamp->copied_total += buf->avail * WM_ADSP_DATA_WORD_SIZE; tstamp->copied_total += buf->avail * WM_ADSP_DATA_WORD_SIZE;
tstamp->sampling_rate = compr->sample_rate;
out: out:
mutex_unlock(&dsp->pwr_lock); mutex_unlock(&dsp->pwr_lock);
......
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