Commit 5b499f8b authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown

ASoC: sst_platform: fix the pulseaudio error

Pulseaudio doesnt work with current driver and it was root caused to absense of
hw_params function and malloc_pages in it.
This patch adds this and allows pa to work fine with these drivers
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarHarsha Priya <priya.harsha@intel.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d58198b9
......@@ -365,6 +365,14 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer
return stream->stream_info.buffer_ptr;
}
static int sst_platform_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
memset(substream->runtime->dma_area, 0, params_buffer_bytes(params));
return 0;
}
static struct snd_pcm_ops sst_platform_ops = {
.open = sst_platform_open,
......@@ -373,6 +381,7 @@ static struct snd_pcm_ops sst_platform_ops = {
.prepare = sst_platform_pcm_prepare,
.trigger = sst_platform_pcm_trigger,
.pointer = sst_platform_pcm_pointer,
.hw_params = sst_platform_pcm_hw_params,
};
static void sst_pcm_free(struct snd_pcm *pcm)
......
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