summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dsp_xaf_api.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2020-07-29 18:34:49 +0800
committerShengjiu Wang <shengjiu.wang@nxp.com>2020-07-30 09:54:07 +0800
commite17ee871b97ab37ed885673631d4d6d4e77f6fb1 (patch)
tree30b897691c1e16461c7b0be879e27faed3646558 /sound/soc/fsl/fsl_dsp_xaf_api.c
parentedfae0f3a63fa627dd07a5ecf640c00c186f3fbf (diff)
MLK-24444-1: ASoC: fsl_dsp: Support PCM format for compress sound card
For PCM format the supported format is mono/stereo, S16_LE/S32_LE, and 8KHz-192kHz frequency. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_dsp_xaf_api.c')
-rw-r--r--sound/soc/fsl/fsl_dsp_xaf_api.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_dsp_xaf_api.c b/sound/soc/fsl/fsl_dsp_xaf_api.c
index 2befc7c144b0..f721854ac67c 100644
--- a/sound/soc/fsl/fsl_dsp_xaf_api.c
+++ b/sound/soc/fsl/fsl_dsp_xaf_api.c
@@ -180,6 +180,7 @@ int xaf_comp_create(struct xf_client *client, struct xf_proxy *proxy,
struct xf_buffer *buf;
int ret = 0, size;
bool loadlib = true;
+ bool request_inbuf = true;
memset((void *)p_comp, 0, sizeof(struct xaf_comp));
@@ -190,9 +191,14 @@ int xaf_comp_create(struct xf_client *client, struct xf_proxy *proxy,
p_comp->comp_type = comp_type;
- if (comp_type == RENDER_ESAI || comp_type == RENDER_SAI)
+ /* No need to load library for PCM */
+ if (comp_type == RENDER_ESAI || comp_type == RENDER_SAI || comp_type == CODEC_PCM_DEC)
loadlib = false;
+ /* Need to allocate in buffer for PCM */
+ if (comp_type == RENDER_ESAI || comp_type == RENDER_SAI)
+ request_inbuf = false;
+
if (loadlib) {
p_comp->codec_lib.filename = lib_path;
p_comp->codec_wrap_lib.filename = lib_wrap_path;
@@ -200,6 +206,9 @@ int xaf_comp_create(struct xf_client *client, struct xf_proxy *proxy,
}
switch (comp_type) {
+ case CODEC_PCM_DEC:
+ p_comp->dec_id = "audio-decoder/pcm";
+ break;
case CODEC_MP3_DEC:
p_comp->dec_id = "audio-decoder/mp3";
strcat(lib_path, "lib_dsp_mp3_dec.so");
@@ -245,7 +254,9 @@ int xaf_comp_create(struct xf_client *client, struct xf_proxy *proxy,
dev_err(dsp_priv->dev, "load codec lib error\n");
goto err_codec_load;
}
+ }
+ if (request_inbuf) {
/* ...allocate input buffer */
if (dsp_priv->dsp_is_lpa)
size = INBUF_SIZE_LPA;