summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dsp_xaf_api.c
diff options
context:
space:
mode:
authorBing Song <bing.song@nxp.com>2020-08-12 10:22:04 +0800
committerBing Song <bing.song@nxp.com>2020-08-14 16:48:50 +0800
commitc731ea37eeb2390ebf91d5185ffb8860c86ffc34 (patch)
tree8fb6b891b8eb98a312d4fd939b323f345ab563c2 /sound/soc/fsl/fsl_dsp_xaf_api.c
parent5ae911fd64fb27e97fd95b0e5f4813a4b2546e2f (diff)
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 <bing.song@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_dsp_xaf_api.c')
-rw-r--r--sound/soc/fsl/fsl_dsp_xaf_api.c9
1 files changed, 5 insertions, 4 deletions
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) {