summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorZhang Peng <peng_zhang_8@nxp.com>2019-10-23 10:02:00 +0800
committerShengjiu Wang <shengjiu.wang@nxp.com>2019-11-22 16:37:17 +0800
commit1d368c6c256434ebc586fedc613e5ef7ef90ad28 (patch)
treee4e20ed641d8e6f6bf8b761542c283e89db9c8c6 /sound
parent57d5b571102b34b8bf2ae6e3f4e1381d7ac8a2fc (diff)
MLK-22815-1: ASoC: fsl: dsp: Expand parameter msg size
Modified parameter msg in dsp, make sure still can transfer right msg between DSP and user, modified parameter msg in kernel. Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_dsp_platform_compress.c12
-rw-r--r--sound/soc/fsl/fsl_dsp_xaf_api.c4
-rw-r--r--sound/soc/fsl/fsl_dsp_xaf_api.h28
3 files changed, 34 insertions, 10 deletions
diff --git a/sound/soc/fsl/fsl_dsp_platform_compress.c b/sound/soc/fsl/fsl_dsp_platform_compress.c
index 7e84b1e2aa24..2f400c00ede5 100644
--- a/sound/soc/fsl/fsl_dsp_platform_compress.c
+++ b/sound/soc/fsl/fsl_dsp_platform_compress.c
@@ -193,32 +193,32 @@ static int dsp_platform_compr_set_params(struct snd_compr_stream *cstream,
drv->client->consume_bytes = 0;
s_param.id = XA_RENDERER_CONFIG_PARAM_SAMPLE_RATE;
- s_param.value = params->codec.sample_rate;
+ s_param.mixData.value = params->codec.sample_rate;
ret = xaf_comp_set_config(drv->client, &drv->component[1], 1, &s_param);
if (ret) {
dev_err(platform->dev,
"set param[cmd:0x%x|val:0x%x] error, err = %d\n",
- s_param.id, s_param.value, ret);
+ s_param.id, s_param.mixData.value, ret);
goto err_comp1_create;
}
s_param.id = XA_RENDERER_CONFIG_PARAM_CHANNELS;
- s_param.value = params->codec.ch_out;
+ s_param.mixData.value = params->codec.ch_out;
ret = xaf_comp_set_config(drv->client, &drv->component[1], 1, &s_param);
if (ret) {
dev_err(platform->dev,
"set param[cmd:0x%x|val:0x%x] error, err = %d\n",
- s_param.id, s_param.value, ret);
+ s_param.id, s_param.mixData.value, ret);
goto err_comp1_create;
}
s_param.id = XA_RENDERER_CONFIG_PARAM_PCM_WIDTH;
- s_param.value = 16;
+ s_param.mixData.value = 16;
ret = xaf_comp_set_config(drv->client, &drv->component[1], 1, &s_param);
if (ret) {
dev_err(platform->dev,
"set param[cmd:0x%x|val:0x%x] error, err = %d\n",
- s_param.id, s_param.value, ret);
+ s_param.id, s_param.mixData.value, ret);
goto err_comp1_create;
}
return 0;
diff --git a/sound/soc/fsl/fsl_dsp_xaf_api.c b/sound/soc/fsl/fsl_dsp_xaf_api.c
index 05d1a1685989..4312a6b29ef1 100644
--- a/sound/soc/fsl/fsl_dsp_xaf_api.c
+++ b/sound/soc/fsl/fsl_dsp_xaf_api.c
@@ -47,7 +47,7 @@ int xaf_comp_set_config(struct xf_client *client, struct xaf_comp *p_comp,
for (i = 0; i < num_param; i++) {
smsg[i].id = param[i].id;
- smsg[i].value = param[i].value;
+ smsg[i].mixData.value = param[i].mixData.value;
}
/* ...set command parameters */
@@ -129,7 +129,7 @@ int xaf_comp_get_config(struct xf_client *client, struct xaf_comp *p_comp,
}
for (i = 0; i < num_param; i++)
- param[i].value = smsg[i].value;
+ param[i].mixData.value = smsg[i].mixData.value;
return 0;
}
diff --git a/sound/soc/fsl/fsl_dsp_xaf_api.h b/sound/soc/fsl/fsl_dsp_xaf_api.h
index d6dc734000aa..2367b6c9c34d 100644
--- a/sound/soc/fsl/fsl_dsp_xaf_api.h
+++ b/sound/soc/fsl/fsl_dsp_xaf_api.h
@@ -106,12 +106,36 @@ struct __attribute__((__packed__)) xf_unroute_port_msg {
/* ...check if non-zero value is a power-of-two */
#define xf_is_power_of_two(v) (((v) & ((v) - 1)) == 0)
+
+/*******************************************************************************
+ * bascial message
+ ******************************************************************************/
+typedef union DATA {
+ u32 value;
+
+ struct {
+ u32 size;
+ u32 channel_table[10];
+ } chan_map_tab;
+
+ struct {
+ u32 samplerate;
+ u32 width;
+ u32 depth;
+ u32 channels;
+ u32 endian;
+ u32 interleave;
+ u32 layout[12];
+ u32 chan_pos_set; // indicate if channel position is set outside or use codec default
+ } outputFormat;
+} data_t;
+
/* ...component initialization parameter */
struct __attribute__((__packed__)) xf_set_param_msg {
/* ...index of parameter passed to SET_CONFIG_PARAM call */
u32 id;
/* ...value of parameter */
- u32 value;
+ data_t mixData;
};
/* ...message body (command/response) */
@@ -119,7 +143,7 @@ struct __attribute__((__packed__)) xf_get_param_msg {
/* ...array of parameters requested */
u32 id;
/* ...array of parameters values */
- u32 value;
+ data_t mixData;
};
/* ...renderer-specific configuration parameters */