ASoC: dsp: Update ADM driver to support Instance ID

Add support to set and get ADM module params with
Instance ID support. Maintain support for non
Instance ID set and get param structures as well.
Use common pack and set param functions to set and
get parameters to DSP instead of handling them at an
individual module level.

CRs-Fixed: 2151551
Change-Id: I5ef920448dd827d8a315e248087997f703061263
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
This commit is contained in:
Vignesh Kulothungan 2018-01-29 16:21:22 -08:00 committed by Gerrit - the friendly Code Review server
parent 1ccc875287
commit 60cc03517f
5 changed files with 1088 additions and 1810 deletions

View file

@ -11517,10 +11517,11 @@ static int msm_routing_put_module_cfg_control(struct snd_kcontrol *kcontrol,
int ret = 0;
unsigned long copp;
struct msm_pcm_routing_bdai_data *bedai;
char *param_data = NULL;
uint32_t *update_param_data = NULL;
uint32_t param_size = sizeof(uint32_t) +
sizeof(struct adm_param_data_v5);
u8 *packed_params = NULL;
struct param_hdr_v3 param_hdr;
u32 packed_param_size = (sizeof(struct param_hdr_v3) +
sizeof(uint32_t));
int dir = ucontrol->value.integer.value[0] ? SESSION_TYPE_TX :
SESSION_TYPE_RX;
int app_type = ucontrol->value.integer.value[1];
@ -11535,15 +11536,17 @@ static int msm_routing_put_module_cfg_control(struct snd_kcontrol *kcontrol,
__func__, app_type, module_id,
instance_id, param_id, param_value);
param_data = kzalloc(param_size, GFP_KERNEL);
if (!param_data)
packed_params = kzalloc(packed_param_size, GFP_KERNEL);
if (!packed_params)
return -ENOMEM;
update_param_data = (uint32_t *)param_data;
*update_param_data++ = module_id;
*update_param_data++ = param_id;
*update_param_data++ = sizeof(uint32_t);
*update_param_data++ = param_value;
memset(&param_hdr, 0, sizeof(param_hdr));
param_hdr.module_id = module_id;
param_hdr.instance_id = instance_id;
param_hdr.param_id = param_id;
param_hdr.param_size = sizeof(uint32_t);
packed_param_size = 0;
mutex_lock(&routing_lock);
for (be_id = 0; be_id < MSM_BACKEND_DAI_MAX; be_id++) {
@ -11571,10 +11574,20 @@ static int msm_routing_put_module_cfg_control(struct snd_kcontrol *kcontrol,
if (!test_bit(copp_idx, &copp))
continue;
ret = adm_send_params_v5(bedai->port_id,
copp_idx,
param_data,
param_size);
ret = q6common_pack_pp_params(packed_params,
&param_hdr,
(u8 *) &param_value,
&packed_param_size);
if (ret) {
pr_err("%s: Failed to pack params, error %d\n",
__func__, ret);
goto done;
}
ret = adm_set_pp_params(bedai->port_id,
copp_idx, NULL,
packed_params,
packed_param_size);
if (ret) {
pr_err("%s: Setting param failed with err=%d\n",
__func__, ret);
@ -11586,7 +11599,7 @@ static int msm_routing_put_module_cfg_control(struct snd_kcontrol *kcontrol,
}
done:
mutex_unlock(&routing_lock);
kfree(param_data);
kfree(packed_params);
return ret;
}
@ -11662,22 +11675,24 @@ int msm_routing_get_rms_value_control(struct snd_kcontrol *kcontrol,
int be_idx = 0;
char *param_value;
int *update_param_value;
uint32_t param_length = sizeof(uint32_t);
uint32_t param_payload_len = RMS_PAYLOAD_LEN * sizeof(uint32_t);
uint32_t param_size = (RMS_PAYLOAD_LEN + 1) * sizeof(uint32_t);
struct param_hdr_v3 param_hdr;
param_value = kzalloc(param_length + param_payload_len, GFP_KERNEL);
param_value = kzalloc(param_size, GFP_KERNEL);
if (!param_value)
return -ENOMEM;
memset(&param_hdr, 0, sizeof(param_hdr));
for (be_idx = 0; be_idx < MSM_BACKEND_DAI_MAX; be_idx++)
if (msm_bedais[be_idx].port_id == SLIMBUS_0_TX)
break;
if ((be_idx < MSM_BACKEND_DAI_MAX) && msm_bedais[be_idx].active) {
rc = adm_get_params(SLIMBUS_0_TX, 0,
RMS_MODULEID_APPI_PASSTHRU,
RMS_PARAM_FIRST_SAMPLE,
param_length + param_payload_len,
param_value);
param_hdr.module_id = RMS_MODULEID_APPI_PASSTHRU;
param_hdr.instance_id = INSTANCE_ID_0;
param_hdr.param_id = RMS_PARAM_FIRST_SAMPLE;
param_hdr.param_size = param_size;
rc = adm_get_pp_params(SLIMBUS_0_TX, 0, ADM_CLIENT_ID_DEFAULT,
NULL, &param_hdr, (u8 *) param_value);
if (rc) {
pr_err("%s: get parameters failed:%d\n", __func__, rc);
kfree(param_value);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -21,6 +21,7 @@
#include <dsp/q6asm-v2.h>
#include <dsp/q6afe-v2.h>
#include <dsp/q6audio-v2.h>
#include <dsp/q6common.h>
#include "msm-qti-pp-config.h"
#include "msm-pcm-routing-v2.h"
@ -263,6 +264,11 @@ int msm_qti_pp_send_stereo_to_custom_stereo_cmd(int port_id, int copp_idx,
update_params_value32 = (int *)params_value;
if (avail_length < 2 * sizeof(uint32_t))
goto skip_send_cmd;
/*
* This module is internal to ADSP and cannot be configured with
* an instance id
*/
*update_params_value32++ = MTMX_MODULE_ID_DEFAULT_CHMIXER;
*update_params_value32++ = DEFAULT_CHMIXER_PARAM_ID_COEFF;
avail_length = avail_length - (2 * sizeof(uint32_t));
@ -329,14 +335,13 @@ static int msm_qti_pp_get_rms_value_control(struct snd_kcontrol *kcontrol,
int be_idx = 0, copp_idx;
char *param_value;
int *update_param_value;
uint32_t param_length = sizeof(uint32_t);
uint32_t param_payload_len = RMS_PAYLOAD_LEN * sizeof(uint32_t);
uint32_t param_size = (RMS_PAYLOAD_LEN + 1) * sizeof(uint32_t);
struct msm_pcm_routing_bdai_data msm_bedai;
struct param_hdr_v3 param_hdr;
param_value = kzalloc(param_length + param_payload_len, GFP_KERNEL);
param_value = kzalloc(param_size, GFP_KERNEL);
if (!param_value)
return -ENOMEM;
msm_pcm_routing_acquire_lock();
for (be_idx = 0; be_idx < MSM_BACKEND_DAI_MAX; be_idx++) {
msm_pcm_routing_get_bedai_info(be_idx, &msm_bedai);
@ -356,11 +361,13 @@ static int msm_qti_pp_get_rms_value_control(struct snd_kcontrol *kcontrol,
rc = -EINVAL;
goto get_rms_value_err;
}
rc = adm_get_params(SLIMBUS_0_TX, copp_idx,
RMS_MODULEID_APPI_PASSTHRU,
RMS_PARAM_FIRST_SAMPLE,
param_length + param_payload_len,
param_value);
memset(&param_hdr, 0, sizeof(param_hdr));
param_hdr.module_id = RMS_MODULEID_APPI_PASSTHRU;
param_hdr.instance_id = INSTANCE_ID_0;
param_hdr.param_id = RMS_PARAM_FIRST_SAMPLE;
param_hdr.param_size = param_size;
rc = adm_get_pp_params(SLIMBUS_0_TX, copp_idx, ADM_CLIENT_ID_DEFAULT,
NULL, &param_hdr, param_value);
if (rc) {
pr_err("%s: get parameters failed rc=%d\n", __func__, rc);
rc = -EINVAL;
@ -692,64 +699,83 @@ static void msm_qti_pp_asphere_init_state(void)
static int msm_qti_pp_asphere_send_params(int port_id, int copp_idx, bool force)
{
char *params_value = NULL;
uint32_t *update_params_value = NULL;
uint32_t param_size = sizeof(uint32_t) +
sizeof(struct adm_param_data_v5);
int params_length = 0, param_count = 0, ret = 0;
u8 *packed_params = NULL;
u32 packed_params_size = 0;
u32 param_size = 0;
struct param_hdr_v3 param_hdr;
bool set_enable = force ||
(asphere_state.enabled != asphere_state.enabled_prev);
bool set_strength = asphere_state.enabled == 1 && (set_enable ||
(asphere_state.strength != asphere_state.strength_prev));
int param_count = 0;
int ret = 0;
if (set_enable)
param_count++;
if (set_strength)
param_count++;
params_length = param_count * param_size;
if (param_count == 0) {
pr_debug("%s: Nothing to send, exiting\n", __func__);
return 0;
}
pr_debug("%s: port_id %d, copp_id %d, forced %d, param_count %d\n",
__func__, port_id, copp_idx, force, param_count);
__func__, port_id, copp_idx, force, param_count);
pr_debug("%s: enable prev:%u cur:%u, strength prev:%u cur:%u\n",
__func__, asphere_state.enabled_prev, asphere_state.enabled,
asphere_state.strength_prev, asphere_state.strength);
if (params_length > 0)
params_value = kzalloc(params_length, GFP_KERNEL);
if (!params_value) {
pr_err("%s, params memory alloc failed\n", __func__);
packed_params_size =
param_count * (sizeof(struct param_hdr_v3) + sizeof(uint32_t));
packed_params = kzalloc(packed_params_size, GFP_KERNEL);
if (!packed_params)
return -ENOMEM;
}
update_params_value = (uint32_t *)params_value;
params_length = 0;
memset(&param_hdr, 0, sizeof(param_hdr));
packed_params_size = 0;
param_hdr.module_id = AUDPROC_MODULE_ID_AUDIOSPHERE;
param_hdr.instance_id = INSTANCE_ID_0;
if (set_strength) {
/* add strength command */
*update_params_value++ = AUDPROC_MODULE_ID_AUDIOSPHERE;
*update_params_value++ = AUDPROC_PARAM_ID_AUDIOSPHERE_STRENGTH;
*update_params_value++ = sizeof(uint32_t);
*update_params_value++ = asphere_state.strength;
params_length += param_size;
param_hdr.param_id = AUDPROC_PARAM_ID_AUDIOSPHERE_STRENGTH;
param_hdr.param_size = sizeof(asphere_state.strength);
ret = q6common_pack_pp_params(packed_params +
packed_params_size,
&param_hdr,
(u8 *) &asphere_state.strength,
&param_size);
if (ret) {
pr_err("%s: Failed to pack params for audio sphere"
" strength, error %d\n", __func__, ret);
goto done;
}
packed_params_size += param_size;
}
if (set_enable) {
/* add enable command */
*update_params_value++ = AUDPROC_MODULE_ID_AUDIOSPHERE;
*update_params_value++ = AUDPROC_PARAM_ID_AUDIOSPHERE_ENABLE;
*update_params_value++ = sizeof(uint32_t);
*update_params_value++ = asphere_state.enabled;
params_length += param_size;
}
pr_debug("%s, param length: %d\n", __func__, params_length);
if (params_length) {
ret = adm_send_params_v5(port_id, copp_idx,
params_value, params_length);
param_hdr.param_id = AUDPROC_PARAM_ID_AUDIOSPHERE_ENABLE;
param_hdr.param_size = sizeof(asphere_state.enabled);
q6common_pack_pp_params(packed_params + packed_params_size,
&param_hdr,
(u8 *) &asphere_state.enabled,
&param_size);
if (ret) {
pr_err("%s: setting param failed with err=%d\n",
__func__, ret);
kfree(params_value);
return -EINVAL;
pr_err("%s: Failed to pack params for audio sphere"
" enable, error %d\n", __func__, ret);
goto done;
}
packed_params_size += param_size;
}
kfree(params_value);
pr_debug("%s: packed data size: %d\n", __func__, packed_params_size);
ret = adm_set_pp_params(port_id, copp_idx, NULL, packed_params,
packed_params_size);
if (ret)
pr_err("%s: set param failed with err=%d\n", __func__, ret);
done:
kfree(packed_params);
return 0;
}

File diff suppressed because it is too large Load diff

View file

@ -500,54 +500,38 @@ struct adm_cmd_device_open_v6 {
#define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
#define ADM_CMD_SET_PP_PARAMS_V6 0x0001035D
/* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
* If the data_payload_addr_lsw and data_payload_addr_msw element
* are NULL, a series of adm_param_datastructures immediately
* follows, whose total size is data_payload_size bytes.
/*
* Structure of the ADM Set PP Params command. Parameter data must be
* pre-packed with correct header for either V2 or V3 when sent in-band.
* Use q6core_pack_pp_params to pack the header and data correctly depending on
* Instance ID support.
*/
struct adm_cmd_set_pp_params_v5 {
struct apr_hdr hdr;
u32 payload_addr_lsw;
/* LSW of parameter data payload address. */
u32 payload_addr_msw;
/* MSW of parameter data payload address. */
struct adm_cmd_set_pp_params {
/* APR Header */
struct apr_hdr apr_hdr;
u32 mem_map_handle;
/* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
* command
*
* If mem_map_handle is zero implies the message is in
* the payload
*/
/* The memory mapping header to be used when sending out of band */
struct mem_mapping_hdr mem_hdr;
u32 payload_size;
/* Size in bytes of the variable payload accompanying this
* message or
* in shared memory. This is used for parsing the parameter
* payload.
*/
/*
* Size in bytes of the variable payload accompanying this
* message or
* in shared memory. This is used for parsing the parameter
* payload.
*/
u32 payload_size;
/*
* Parameter data for in band payload. This should be structured as the
* parameter header immediately followed by the parameter data. Multiple
* parameters can be set in one command by repeating the header followed
* by the data for as many parameters as need to be set.
* Use q6core_pack_pp_params to pack the header and data correctly
* depending on Instance ID support.
*/
u8 param_data[0];
} __packed;
/* Payload format for COPP parameter data.
* Immediately following this structure are param_size bytes
* of parameter
* data.
*/
struct adm_param_data_v5 {
u32 module_id;
/* Unique ID of the module. */
u32 param_id;
/* Unique ID of the parameter. */
u16 param_size;
/* Data size of the param_id/module_id combination.
* This value is a
* multiple of 4 bytes.
*/
u16 reserved;
/* Reserved for future enhancements.
* This field must be set to zero.
*/
} __packed;
#define ASM_STREAM_CMD_REGISTER_PP_EVENTS 0x00013213
#define ASM_STREAM_PP_EVENT 0x00013214
@ -591,25 +575,6 @@ struct adm_cmd_set_pspd_mtmx_strtr_params_v5 {
u16 reserved;
} __packed;
/* Defined specifically for in-band use, includes params */
struct adm_cmd_set_pp_params_inband_v5 {
struct apr_hdr hdr;
/* LSW of parameter data payload address.*/
u32 payload_addr_lsw;
/* MSW of parameter data payload address.*/
u32 payload_addr_msw;
/* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
/* command. If mem_map_handle is zero implies the message is in */
/* the payload */
u32 mem_map_handle;
/* Size in bytes of the variable payload accompanying this */
/* message or in shared memory. This is used for parsing the */
/* parameter payload. */
u32 payload_size;
/* Parameters passed for in band payload */
struct adm_param_data_v5 params;
} __packed;
/* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
*/
#define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329
@ -642,42 +607,19 @@ struct adm_cmd_rsp_device_open_v5 {
#define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
#define ADM_CMD_GET_PP_PARAMS_V6 0x0001035E
/* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command. */
struct adm_cmd_get_pp_params_v5 {
struct apr_hdr hdr;
u32 data_payload_addr_lsw;
/* LSW of parameter data payload address.*/
/*
* Structure of the ADM Get PP Params command. Parameter header must be
* packed correctly for either V2 or V3. Use q6core_pack_pp_params to pack the
* header correctly depending on Instance ID support.
*/
struct adm_cmd_get_pp_params {
struct apr_hdr apr_hdr;
u32 data_payload_addr_msw;
/* MSW of parameter data payload address.*/
/* The memory mapping header to be used when requesting outband */
struct mem_mapping_hdr mem_hdr;
/* If the mem_map_handle is non zero,
* on ACK, the ParamData payloads begin at
* the address specified (out-of-band).
*/
u32 mem_map_handle;
/* Memory map handle returned
* by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
* If the mem_map_handle is 0, it implies that
* the ACK's payload will contain the ParamData (in-band).
*/
u32 module_id;
/* Unique ID of the module. */
u32 param_id;
/* Unique ID of the parameter. */
u16 param_max_size;
/* Maximum data size of the parameter
*ID/module ID combination. This
* field is a multiple of 4 bytes.
*/
u16 reserved;
/* Reserved for future enhancements.
* This field must be set to zero.
*/
/* Parameter header for in band payload. */
union param_hdrs param_hdr;
} __packed;
/* Returns parameter values
@ -689,15 +631,49 @@ struct adm_cmd_get_pp_params_v5 {
* which returns parameter values in response
* to an #ADM_CMD_GET_PP_PARAMS_V5 command.
* Immediately following this
* structure is the adm_param_data_v5
* structure is the param_hdr_v1
* structure containing the pre/postprocessing
* parameter data. For an in-band
* scenario, the variable payload depends
* on the size of the parameter.
*/
struct adm_cmd_rsp_get_pp_params_v5 {
u32 status;
/* Status message (error code).*/
u32 status;
/* The header that identifies the subsequent parameter data */
struct param_hdr_v1 param_hdr;
/* The parameter data returned */
u32 param_data[0];
} __packed;
/*
* Returns parameter values in response to an #ADM_CMD_GET_PP_PARAMS_V5/6
* command.
*/
#define ADM_CMDRSP_GET_PP_PARAMS_V6 0x0001035F
/*
* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V6 message,
* which returns parameter values in response
* to an #ADM_CMD_GET_PP_PARAMS_V6 command.
* Immediately following this
* structure is the param_hdr_v3
* structure containing the pre/postprocessing
* parameter data. For an in-band
* scenario, the variable payload depends
* on the size of the parameter.
*/
struct adm_cmd_rsp_get_pp_params_v6 {
/* Status message (error code).*/
u32 status;
/* The header that identifies the subsequent parameter data */
struct param_hdr_v3 param_hdr;
/* The parameter data returned */
u32 param_data[0];
} __packed;
/* Structure for holding soft stepping volume parameters. */
@ -730,9 +706,40 @@ struct audproc_softvolume_params {
#define AUDPROC_CHMIXER_PARAM_ID_COEFF 0x00010342
struct adm_cmd_set_pp_params_v5 {
struct apr_hdr hdr;
u32 payload_addr_lsw;
/* LSW of parameter data payload address.*/
u32 payload_addr_msw;
/* MSW of parameter data payload address.*/
u32 mem_map_handle;
/*
* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
* command.
* If mem_map_handle is zero implies the message is in
* the payload
*/
u32 payload_size;
/*
* Size in bytes of the variable payload accompanying this
* message or
* in shared memory. This is used for parsing the parameter
* payload.
*/
} __packed;
struct audproc_mfc_output_media_fmt {
struct adm_cmd_set_pp_params_v5 params;
struct adm_param_data_v5 data;
struct param_hdr_v1 data;
uint32_t sampling_rate;
uint16_t bits_per_sample;
uint16_t num_channels;
uint16_t channel_type[8];
} __packed;
struct audproc_mfc_param_media_fmt {
uint32_t sampling_rate;
uint16_t bits_per_sample;
uint16_t num_channels;
@ -740,8 +747,6 @@ struct audproc_mfc_output_media_fmt {
} __packed;
struct audproc_volume_ctrl_master_gain {
struct adm_cmd_set_pp_params_v5 params;
struct adm_param_data_v5 data;
/* Linear gain in Q13 format. */
uint16_t master_gain;
/* Clients must set this field to zero. */
@ -749,8 +754,6 @@ struct audproc_volume_ctrl_master_gain {
} __packed;
struct audproc_soft_step_volume_params {
struct adm_cmd_set_pp_params_v5 params;
struct adm_param_data_v5 data;
/*
* Period in milliseconds.
* Supported values: 0 to 15000
@ -772,7 +775,6 @@ struct audproc_soft_step_volume_params {
} __packed;
struct audproc_enable_param_t {
struct adm_cmd_set_pp_params_inband_v5 pp_params;
/*
* Specifies whether the Audio processing module is enabled.
* This parameter is generic/common parameter to configure or
@ -7614,12 +7616,6 @@ struct admx_mic_gain {
/*< Clients must set this field to zero. */
} __packed;
struct adm_set_mic_gain_params {
struct adm_cmd_set_pp_params_v5 params;
struct adm_param_data_v5 data;
struct admx_mic_gain mic_gain_data;
} __packed;
/* end_addtogroup audio_pp_param_ids */
/* @ingroup audio_pp_module_ids
@ -7977,56 +7973,23 @@ struct adm_qensemble_param_set_new_angle {
#define ADM_CMD_GET_PP_TOPO_MODULE_LIST 0x00010349
#define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST 0x00010350
#define ADM_CMD_GET_PP_TOPO_MODULE_LIST_V2 0x00010360
#define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST_V2 0x00010361
#define AUDPROC_PARAM_ID_ENABLE 0x00010904
/*
* Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
*/
struct adm_cmd_get_pp_topo_module_list_t {
struct apr_hdr hdr;
/* Lower 32 bits of the 64-bit parameter data payload address. */
uint32_t data_payload_addr_lsw;
/*
* Upper 32 bits of the 64-bit parameter data payload address.
*
*
* The size of the shared memory, if specified, must be large enough to
* contain the entire parameter data payload, including the module ID,
* parameter ID, parameter size, and parameter values.
*/
uint32_t data_payload_addr_msw;
/*
* Unique identifier for an address.
*
* This memory map handle is returned by the aDSP through the
* #ADM_CMD_SHARED_MEM_MAP_REGIONS command.
*
* @values
* - Non-NULL -- On acknowledgment, the parameter data payloads begin at
* the address specified (out-of-band)
* - NULL -- The acknowledgment's payload contains the parameter data
* (in-band) @tablebulletend
*/
uint32_t mem_map_handle;
/*
* Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
*/
struct adm_cmd_get_pp_topo_module_list {
struct apr_hdr apr_hdr;
/* The memory mapping header to be used when requesting out of band */
struct mem_mapping_hdr mem_hdr;
/*
* Maximum data size of the list of modules. This
* field is a multiple of 4 bytes.
*/
uint16_t param_max_size;
/* This field must be set to zero. */
uint16_t reserved;
} __packed;
/*
* Payload of the ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST message, which returns
* module ids in response to an ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
* Immediately following this structure is the acknowledgment <b>module id
* data variable payload</b> containing the pre/postprocessing module id
* values. For an in-band scenario, the variable payload depends on the size
* of the parameter.
*/
struct adm_cmd_rsp_get_pp_topo_module_list_t {
/* Status message (error code). */
uint32_t status;
uint32_t param_max_size;
} __packed;
struct audproc_topology_module_id_info_t {
@ -10926,18 +10889,14 @@ enum {
#define AUDPROC_PARAM_ID_COMPRESSED_MUTE 0x00010771
struct adm_set_compressed_device_mute {
struct adm_cmd_set_pp_params_v5 command;
struct adm_param_data_v5 params;
u32 mute_on;
u32 mute_on;
} __packed;
#define AUDPROC_MODULE_ID_COMPRESSED_LATENCY 0x0001076E
#define AUDPROC_PARAM_ID_COMPRESSED_LATENCY 0x0001076F
struct adm_set_compressed_device_latency {
struct adm_cmd_set_pp_params_v5 command;
struct adm_param_data_v5 params;
u32 latency;
u32 latency;
} __packed;
#define VOICEPROC_MODULE_ID_GENERIC_TX 0x00010EF6
@ -10967,12 +10926,6 @@ struct adm_param_fluence_soundfocus_t {
uint16_t reserved;
} __packed;
struct adm_set_fluence_soundfocus_param {
struct adm_cmd_set_pp_params_v5 params;
struct adm_param_data_v5 data;
struct adm_param_fluence_soundfocus_t soundfocus_data;
} __packed;
struct adm_param_fluence_sourcetracking_t {
uint8_t vad[MAX_SECTORS];
uint16_t doa_speech;
@ -11002,10 +10955,4 @@ struct admx_sec_primary_mic_ch {
uint16_t reserved1;
} __packed;
struct adm_set_sec_primary_ch_params {
struct adm_cmd_set_pp_params_v5 params;
struct adm_param_data_v5 data;
struct admx_sec_primary_mic_ch sec_primary_mic_ch_data;
} __packed;
#endif /*_APR_AUDIO_V2_H_ */

View file

@ -25,6 +25,8 @@
#define MAX_MODULES_IN_TOPO 16
#define ADM_GET_TOPO_MODULE_LIST_LENGTH\
((MAX_MODULES_IN_TOPO + 1) * sizeof(uint32_t))
#define ADM_GET_TOPO_MODULE_INSTANCE_LIST_LENGTH \
((MAX_MODULES_IN_TOPO + 1) * 2 * sizeof(uint32_t))
#define AUD_PROC_BLOCK_SIZE 4096
#define AUD_VOL_BLOCK_SIZE 4096
#define AUDIO_RX_CALIBRATION_SIZE (AUD_PROC_BLOCK_SIZE + \
@ -94,12 +96,24 @@ void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate);
int adm_get_params(int port_id, int copp_idx, uint32_t module_id,
uint32_t param_id, uint32_t params_length, char *params);
int adm_get_pp_params(int port_id, int copp_idx, uint32_t client_id,
struct mem_mapping_hdr *mem_hdr,
struct param_hdr_v3 *param_hdr, u8 *returned_param_data);
int adm_send_params_v5(int port_id, int copp_idx, char *params,
uint32_t params_length);
int adm_dolby_dap_send_params(int port_id, int copp_idx, char *params,
uint32_t params_length);
int adm_set_pp_params(int port_id, int copp_idx,
struct mem_mapping_hdr *mem_hdr, u8 *param_data,
u32 params_size);
int adm_pack_and_set_one_pp_param(int port_id, int copp_idx,
struct param_hdr_v3 param_hdr,
u8 *param_data);
int adm_open(int port, int path, int rate, int mode, int topology,
int perf_mode, uint16_t bits_per_sample,
int app_type, int acdbdev_id);
@ -146,6 +160,10 @@ int adm_set_stereo_to_custom_stereo(int port_id, int copp_idx,
int adm_get_pp_topo_module_list(int port_id, int copp_idx, int32_t param_length,
char *params);
int adm_get_pp_topo_module_list_v2(int port_id, int copp_idx,
int32_t param_length,
int32_t *returned_params);
int adm_set_volume(int port_id, int copp_idx, int volume);
int adm_set_softvolume(int port_id, int copp_idx,
@ -158,6 +176,9 @@ int adm_send_set_multichannel_ec_primary_mic_ch(int port_id, int copp_idx,
int adm_param_enable(int port_id, int copp_idx, int module_id, int enable);
int adm_param_enable_v2(int port_id, int copp_idx,
struct module_instance_info mod_inst_info, int enable);
int adm_send_calibration(int port_id, int copp_idx, int path, int perf_mode,
int cal_type, char *params, int size);