summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sound/apr_audio-v2.h304
-rw-r--r--include/sound/q6adm-v2.h21
2 files changed, 135 insertions, 190 deletions
diff --git a/include/sound/apr_audio-v2.h b/include/sound/apr_audio-v2.h
index 608f58e8cca3..540d6339041f 100644
--- a/include/sound/apr_audio-v2.h
+++ b/include/sound/apr_audio-v2.h
@@ -503,69 +503,34 @@ 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.*/
-
- 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 */
+struct adm_cmd_set_pp_params {
+ /* APR Header */
+ struct apr_hdr apr_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.
- */
-} __packed;
+ /* The memory mapping header to be used when sending out of band */
+ struct mem_mapping_hdr mem_hdr;
-/* 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.
+ /* Size in bytes of the variable payload accompanying this
+ * message or
+ * in shared memory. This is used for parsing the parameter
+ * payload.
*/
-} __packed;
-
+ u32 payload_size;
-struct param_data_v6 {
- /* Unique ID of the module. */
- u32 module_id;
- /* Unique ID of the instance. */
- u16 instance_id;
- /* Reserved for future enhancements.
- * This field must be set to zero.
- */
- u16 reserved;
- /* Unique ID of the parameter. */
- u32 param_id;
- /* Data size of the param_id/module_id combination.
- * This value is a
- * multiple of 4 bytes.
+ /* 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.
*/
- u32 param_size;
+ u8 param_data[0];
} __packed;
/* ADM_CMD_SET_MTMX_STRTR_DEV_PARAMS_V1 command is used to set
@@ -583,7 +548,7 @@ struct param_data_v6 {
/* Payload of the #define ADM_CMD_SET_MTMX_STRTR_DEV_PARAMS_V1 command.
* If the data_payload_addr_lsw and data_payload_addr_msw element
- * are NULL, a series of struct param_data_v6 structures immediately
+ * are NULL, a series of struct param_hdr_v3 structures immediately
* follows, whose total size is payload_size bytes.
*/
struct adm_cmd_set_mtmx_params_v1 {
@@ -620,7 +585,7 @@ struct enable_param_v6 {
* This parameter is generic/common parameter to configure or
* determine the state of any audio processing module.
*/
- struct param_data_v6 param;
+ struct param_hdr_v3 param;
/* @values 0 : Disable 1: Enable */
uint32_t enable;
@@ -673,25 +638,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
@@ -726,43 +672,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.*/
-
- u32 data_payload_addr_msw;
- /* MSW of parameter data payload address.*/
-
- /* 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. */
+/*
+ * 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 param_id;
- /* Unique ID of the parameter. */
+ /* The memory mapping header to be used when requesting outband */
+ struct mem_mapping_hdr mem_hdr;
- 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
@@ -774,15 +696,48 @@ 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. */
@@ -835,9 +790,38 @@ struct adm_pspd_param_data_t {
uint16_t reserved;
} __packed;
+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;
@@ -845,8 +829,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. */
@@ -854,8 +836,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
@@ -877,7 +857,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
@@ -7545,12 +7524,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
@@ -7906,56 +7879,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 acknowledgement <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 {
@@ -10859,18 +10799,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
@@ -10900,12 +10836,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;
@@ -10935,10 +10865,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_ */
diff --git a/include/sound/q6adm-v2.h b/include/sound/q6adm-v2.h
index 65c42ee18914..84087de3d4d8 100644
--- a/include/sound/q6adm-v2.h
+++ b/include/sound/q6adm-v2.h
@@ -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 + \
@@ -101,12 +103,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);
@@ -157,6 +171,10 @@ int adm_set_downmix_params(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,
@@ -169,6 +187,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);