From c731ea37eeb2390ebf91d5185ffb8860c86ffc34 Mon Sep 17 00:00:00 2001 From: Bing Song Date: Wed, 12 Aug 2020 10:22:04 +0800 Subject: MLK-24501-5 dsp: add lpa pcm support. Use reserved memory as PCM mode need more memory. Use ping-pong buffer for PCM LPA playback to avoid underrun. Signed-off-by: Bing Song Reviewed-by: Shengjiu Wang --- sound/soc/fsl/fsl_dsp_xaf_api.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sound/soc/fsl/fsl_dsp_xaf_api.c') diff --git a/sound/soc/fsl/fsl_dsp_xaf_api.c b/sound/soc/fsl/fsl_dsp_xaf_api.c index f721854ac67c..f544b6a3adba 100644 --- a/sound/soc/fsl/fsl_dsp_xaf_api.c +++ b/sound/soc/fsl/fsl_dsp_xaf_api.c @@ -205,13 +205,18 @@ int xaf_comp_create(struct xf_client *client, struct xf_proxy *proxy, p_comp->codec_lib.lib_type = DSP_CODEC_LIB; } + size = INBUF_SIZE; switch (comp_type) { case CODEC_PCM_DEC: p_comp->dec_id = "audio-decoder/pcm"; + if (dsp_priv->dsp_is_lpa) + size = INBUF_SIZE_LPA_PCM; break; case CODEC_MP3_DEC: p_comp->dec_id = "audio-decoder/mp3"; strcat(lib_path, "lib_dsp_mp3_dec.so"); + if (dsp_priv->dsp_is_lpa) + size = INBUF_SIZE_LPA; break; case CODEC_AAC_DEC: p_comp->dec_id = "audio-decoder/aac"; @@ -258,10 +263,6 @@ int xaf_comp_create(struct xf_client *client, struct xf_proxy *proxy, if (request_inbuf) { /* ...allocate input buffer */ - if (dsp_priv->dsp_is_lpa) - size = INBUF_SIZE_LPA; - else - size = INBUF_SIZE; ret = xf_pool_alloc(client, proxy, 1, size, XF_POOL_INPUT, &p_comp->inpool); if (ret) { -- cgit v1.2.3