blob: 11499bcedde8a928c3c89de143fbf008d9b60664 [file] [log] [blame]
/* Copyright (c) 2012-2015, 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
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _APR_AUDIO_V2_H_
#define _APR_AUDIO_V2_H_
#include <linux/qdsp6v2/apr.h>
/* size of header needed for passing data out of band */
#define APR_CMD_OB_HDR_SZ 12
/* size of header needed for getting data */
#define APR_CMD_GET_HDR_SZ 16
struct param_outband {
size_t size;
void *kvaddr;
phys_addr_t paddr;
};
#define ADSP_ADM_VERSION 0x00070000
#define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
#define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323
#define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324
#define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325
#define ADM_CMD_STREAM_DEVICE_MAP_ROUTINGS_V5 0x0001033D
/* Enumeration for an audio Rx matrix ID.*/
#define ADM_MATRIX_ID_AUDIO_RX 0
#define ADM_MATRIX_ID_AUDIO_TX 1
#define ADM_MATRIX_ID_COMPRESSED_AUDIO_RX 2
/* Enumeration for an audio Tx matrix ID.*/
#define ADM_MATRIX_ID_AUDIOX 1
#define ADM_MAX_COPPS 5
/* make sure this matches with msm_audio_calibration */
#define SP_V2_NUM_MAX_SPKR 2
/* Session map node structure.
* Immediately following this structure are num_copps
* entries of COPP IDs. The COPP IDs are 16 bits, so
* there might be a padding 16-bit field if num_copps
* is odd.
*/
struct adm_session_map_node_v5 {
u16 session_id;
/* Handle of the ASM session to be routed. Supported values: 1
* to 8.
*/
u16 num_copps;
/* Number of COPPs to which this session is to be routed.
Supported values: 0 < num_copps <= ADM_MAX_COPPS.
*/
} __packed;
/* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command.
* Immediately following this structure are num_sessions of the session map
* node payload (adm_session_map_node_v5).
*/
struct adm_cmd_matrix_map_routings_v5 {
struct apr_hdr hdr;
u32 matrix_id;
/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx
* (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
* macros to set this field.
*/
u32 num_sessions;
/* Number of sessions being updated by this command (optional).*/
} __packed;
/* This command allows a client to open a COPP/Voice Proc. TX module
* and sets up the device session: Matrix -> COPP -> AFE on the RX
* and AFE -> COPP -> Matrix on the TX. This enables PCM data to
* be transferred to/from the endpoint (AFEPortID).
*
* @return
* #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and
* COPP ID.
*/
#define ADM_CMD_DEVICE_OPEN_V5 0x00010326
/* Definition for a low latency stream session. */
#define ADM_LOW_LATENCY_DEVICE_SESSION 0x2000
/* Definition for a ultra low latency stream session. */
#define ADM_ULTRA_LOW_LATENCY_DEVICE_SESSION 0x4000
/* Definition for a legacy device session. */
#define ADM_LEGACY_DEVICE_SESSION 0
/* Indicates that endpoint_id_2 is to be ignored.*/
#define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF
#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1
#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2
#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3
/* Indicates that an audio COPP is to send/receive a mono PCM
* stream to/from
* END_POINT_ID_1.
*/
#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1
/* Indicates that an audio COPP is to send/receive a
* stereo PCM stream to/from END_POINT_ID_1.
*/
#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2
/* Sample rate is 8000 Hz.*/
#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000
/* Sample rate is 16000 Hz.*/
#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000
/* Sample rate is 48000 Hz.*/
#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000
/* Definition for a COPP live input flag bitmask.*/
#define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U)
/* Definition for a COPP live shift value bitmask.*/
#define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0
/* Definition for the COPP ID bitmask.*/
#define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL)
/* Definition for the COPP ID shift value.*/
#define ADM_SHIFT_COPP_ID 0
/* Definition for the service ID bitmask.*/
#define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
/* Definition for the service ID shift value.*/
#define ADM_SHIFT_SERVICE_ID 16
/* Definition for the domain ID bitmask.*/
#define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
/* Definition for the domain ID shift value.*/
#define ADM_SHIFT_DOMAIN_ID 24
/* ADM device open command payload of the
#ADM_CMD_DEVICE_OPEN_V5 command.
*/
struct adm_cmd_device_open_v5 {
struct apr_hdr hdr;
u16 flags;
/* Reserved for future use. Clients must set this field
* to zero.
*/
u16 mode_of_operation;
/* Specifies whether the COPP must be opened on the Tx or Rx
* path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
* supported values and interpretation.
* Supported values:
* - 0x1 -- Rx path COPP
* - 0x2 -- Tx path live COPP
* - 0x3 -- Tx path nonlive COPP
* Live connections cause sample discarding in the Tx device
* matrix if the destination output ports do not pull them
* fast enough. Nonlive connections queue the samples
* indefinitely.
*/
u16 endpoint_id_1;
/* Logical and physical endpoint ID of the audio path.
* If the ID is a voice processor Tx block, it receives near
* samples. Supported values: Any pseudoport, AFE Rx port,
* or AFE Tx port For a list of valid IDs, refer to
* @xhyperref{Q4,[Q4]}.
* Q4 = Hexagon Multimedia: AFE Interface Specification
*/
u16 endpoint_id_2;
/* Logical and physical endpoint ID 2 for a voice processor
* Tx block.
* This is not applicable to audio COPP.
* Supported values:
* - AFE Rx port
* - 0xFFFF -- Endpoint 2 is unavailable and the voice
* processor Tx
* block ignores this endpoint
* When the voice processor Tx block is created on the audio
* record path,
* it can receive far-end samples from an AFE Rx port if the
* voice call
* is active. The ID of the AFE port is provided in this
* field.
* For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
*/
u32 topology_id;
/* Audio COPP topology ID; 32-bit GUID. */
u16 dev_num_channel;
/* Number of channels the audio COPP sends to/receives from
* the endpoint.
* Supported values: 1 to 8.
* The value is ignored for the voice processor Tx block,
* where channel
* configuration is derived from the topology ID.
*/
u16 bit_width;
/* Bit width (in bits) that the audio COPP sends to/receives
* from the
* endpoint. The value is ignored for the voice processing
* Tx block,
* where the PCM width is 16 bits.
*/
u32 sample_rate;
/* Sampling rate at which the audio COPP/voice processor
* Tx block
* interfaces with the endpoint.
* Supported values for voice processor Tx: 8000, 16000,
* 48000 Hz
* Supported values for audio COPP: >0 and <=192 kHz
*/
u8 dev_channel_mapping[8];
/* Array of channel mapping of buffers that the audio COPP
* sends to the endpoint. Channel[i] mapping describes channel
* I inside the buffer, where 0 < i < dev_num_channel.
* This value is relevent only for an audio Rx COPP.
* For the voice processor block and Tx audio block, this field
* is set to zero and is ignored.
*/
} __packed;
/*
* This command allows the client to close a COPP and disconnect
* the device session.
*/
#define ADM_CMD_DEVICE_CLOSE_V5 0x00010327
/* Sets one or more parameters to a COPP.
*/
#define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
/* 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.
*/
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;
/* 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;
/* set customized mixing on matrix mixer */
#define ADM_CMD_SET_PSPD_MTMX_STRTR_PARAMS_V5 0x00010344
struct adm_cmd_set_pspd_mtmx_strtr_params_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;
u16 direction;
u16 sessionid;
u16 deviceid;
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
/* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V5 message,
* which returns the
* status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
*/
struct adm_cmd_rsp_device_open_v5 {
u32 status;
/* Status message (error code).*/
u16 copp_id;
/* COPP ID: Supported values: 0 <= copp_id < ADM_MAX_COPPS*/
u16 reserved;
/* Reserved. This field must be set to zero.*/
} __packed;
/* This command allows a query of one COPP parameter.
*/
#define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
/* 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. */
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.
*/
} __packed;
/* Returns parameter values
* in response to an #ADM_CMD_GET_PP_PARAMS_V5 command.
*/
#define ADM_CMDRSP_GET_PP_PARAMS_V5 0x0001032B
/* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V5 message,
* 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 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).*/
} __packed;
/* Structure for holding soft stepping volume parameters. */
/*
* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
* parameters used by the Volume Control module.
*/
struct audproc_softvolume_params {
u32 period;
u32 step;
u32 rampingcurve;
} __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. */
uint16_t reserved;
} __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
*/
uint32_t period;
/*
* Step in microseconds.
* Supported values: 0 to 15000000
*/
uint32_t step;
/*
* Ramping curve type.
* Supported values:
* - #AUDPROC_PARAM_SVC_RAMPINGCURVE_LINEAR
* - #AUDPROC_PARAM_SVC_RAMPINGCURVE_EXP
* - #AUDPROC_PARAM_SVC_RAMPINGCURVE_LOG
*/
uint32_t ramping_curve;
} __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
* determine the state of any audio processing module.
* @values 0 : Disable 1: Enable
*/
uint32_t enable;
};
/*
* Allows a client to control the gains on various session-to-COPP paths.
*/
#define ADM_CMD_MATRIX_RAMP_GAINS_V5 0x0001032C
/* Indicates that the target gain in the
* current adm_session_copp_gain_v5
* structure is to be applied to all
* the session-to-COPP paths that exist for
* the specified session.
*/
#define ADM_CMD_MATRIX_RAMP_GAINS_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
/* Indicates that the target gain is
* to be immediately applied to the
* specified session-to-COPP path,
* without a ramping fashion.
*/
#define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE 0x0000
/* Enumeration for a linear ramping curve.*/
#define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR 0x0000
/* Payload of the #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
* Immediately following this structure are num_gains of the
* adm_session_copp_gain_v5structure.
*/
struct adm_cmd_matrix_ramp_gains_v5 {
u32 matrix_id;
/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
* Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
* macros to set this field.
*/
u16 num_gains;
/* Number of gains being applied. */
u16 reserved_for_align;
/* Reserved. This field must be set to zero.*/
} __packed;
/* Session-to-COPP path gain structure, used by the
* #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
* This structure specifies the target
* gain (per channel) that must be applied
* to a particular session-to-COPP path in
* the audio matrix. The structure can
* also be used to apply the gain globally
* to all session-to-COPP paths that
* exist for the given session.
* The aDSP uses device channel mapping to
* determine which channel gains to
* use from this command. For example,
* if the device is configured as stereo,
* the aDSP uses only target_gain_ch_1 and
* target_gain_ch_2, and it ignores
* the others.
*/
struct adm_session_copp_gain_v5 {
u16 session_id;
/* Handle of the ASM session.
* Supported values: 1 to 8.
*/
u16 copp_id;
/* Handle of the COPP. Gain will be applied on the Session ID
* COPP ID path.
*/
u16 ramp_duration;
/* Duration (in milliseconds) of the ramp over
* which target gains are
* to be applied. Use
* #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE
* to indicate that gain must be applied immediately.
*/
u16 step_duration;
/* Duration (in milliseconds) of each step in the ramp.
* This parameter is ignored if ramp_duration is equal to
* #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE.
* Supported value: 1
*/
u16 ramp_curve;
/* Type of ramping curve.
* Supported value: #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR
*/
u16 reserved_for_align;
/* Reserved. This field must be set to zero. */
u16 target_gain_ch_1;
/* Target linear gain for channel 1 in Q13 format; */
u16 target_gain_ch_2;
/* Target linear gain for channel 2 in Q13 format; */
u16 target_gain_ch_3;
/* Target linear gain for channel 3 in Q13 format; */
u16 target_gain_ch_4;
/* Target linear gain for channel 4 in Q13 format; */
u16 target_gain_ch_5;
/* Target linear gain for channel 5 in Q13 format; */
u16 target_gain_ch_6;
/* Target linear gain for channel 6 in Q13 format; */
u16 target_gain_ch_7;
/* Target linear gain for channel 7 in Q13 format; */
u16 target_gain_ch_8;
/* Target linear gain for channel 8 in Q13 format; */
} __packed;
/* Allows to set mute/unmute on various session-to-COPP paths.
* For every session-to-COPP path (stream-device interconnection),
* mute/unmute can be set individually on the output channels.
*/
#define ADM_CMD_MATRIX_MUTE_V5 0x0001032D
/* Indicates that mute/unmute in the
* current adm_session_copp_mute_v5structure
* is to be applied to all the session-to-COPP
* paths that exist for the specified session.
*/
#define ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
/* Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/
struct adm_cmd_matrix_mute_v5 {
u32 matrix_id;
/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
* Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
* macros to set this field.
*/
u16 session_id;
/* Handle of the ASM session.
* Supported values: 1 to 8.
*/
u16 copp_id;
/* Handle of the COPP.
* Use ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS
* to indicate that mute/unmute must be applied to
* all the COPPs connected to session_id.
* Supported values:
* - 0xFFFF -- Apply mute/unmute to all connected COPPs
* - Other values -- Valid COPP ID
*/
u8 mute_flag_ch_1;
/* Mute flag for channel 1 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_2;
/* Mute flag for channel 2 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_3;
/* Mute flag for channel 3 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_4;
/* Mute flag for channel 4 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_5;
/* Mute flag for channel 5 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_6;
/* Mute flag for channel 6 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_7;
/* Mute flag for channel 7 is set to unmute (0) or mute (1). */
u8 mute_flag_ch_8;
/* Mute flag for channel 8 is set to unmute (0) or mute (1). */
u16 ramp_duration;
/* Period (in milliseconds) over which the soft mute/unmute will be
* applied.
* Supported values: 0 (Default) to 0xFFFF
* The default of 0 means mute/unmute will be applied immediately.
*/
u16 reserved_for_align;
/* Clients must set this field to zero.*/
} __packed;
#define ASM_PARAM_ID_AAC_STEREO_MIX_COEFF_SELECTION_FLAG_V2 (0x00010DD8)
struct asm_aac_stereo_mix_coeff_selection_param_v2 {
struct apr_hdr hdr;
u32 param_id;
u32 param_size;
u32 aac_stereo_mix_coeff_flag;
} __packed;
/* Allows a client to connect the desired stream to
* the desired AFE port through the stream router
*
* This command allows the client to connect specified session to
* specified AFE port. This is used for compressed streams only
* opened using the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
* #ASM_STREAM_CMD_OPEN_READ_COMPRESSED command.
*
* @prerequisites
* Session ID and AFE Port ID must be valid.
* #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
* #ASM_STREAM_CMD_OPEN_READ_COMPRESSED
* must have been called on this session.
*/
#define ADM_CMD_CONNECT_AFE_PORT_V5 0x0001032E
#define ADM_CMD_DISCONNECT_AFE_PORT_V5 0x0001032F
/* Enumeration for the Rx stream router ID.*/
#define ADM_STRTR_ID_RX 0
/* Enumeration for the Tx stream router ID.*/
#define ADM_STRTR_IDX 1
/* Payload of the #ADM_CMD_CONNECT_AFE_PORT_V5 command.*/
struct adm_cmd_connect_afe_port_v5 {
struct apr_hdr hdr;
u8 mode;
/* ID of the stream router (RX/TX). Use the
* ADM_STRTR_ID_RX or ADM_STRTR_IDX macros
* to set this field.
*/
u8 session_id;
/* Session ID of the stream to connect */
u16 afe_port_id;
/* Port ID of the AFE port to connect to.*/
u32 num_channels;
/* Number of device channels
* Supported values: 2(Audio Sample Packet),
* 8 (HBR Audio Stream Sample Packet)
*/
u32 sampling_rate;
/* Device sampling rate
* Supported values: Any
*/
} __packed;
/* adsp_adm_api.h */
/* Port ID. Update afe_get_port_index
* when a new port is added here. */
#define PRIMARY_I2S_RX 0
#define PRIMARY_I2S_TX 1
#define SECONDARY_I2S_RX 4
#define SECONDARY_I2S_TX 5
#define MI2S_RX 6
#define MI2S_TX 7
#define HDMI_RX 8
#define RSVD_2 9
#define RSVD_3 10
#define DIGI_MIC_TX 11
#define VOICE2_PLAYBACK_TX 0x8002
#define VOICE_RECORD_RX 0x8003
#define VOICE_RECORD_TX 0x8004
#define VOICE_PLAYBACK_TX 0x8005
/* Slimbus Multi channel port id pool */
#define SLIMBUS_0_RX 0x4000
#define SLIMBUS_0_TX 0x4001
#define SLIMBUS_1_RX 0x4002
#define SLIMBUS_1_TX 0x4003
#define SLIMBUS_2_RX 0x4004
#define SLIMBUS_2_TX 0x4005
#define SLIMBUS_3_RX 0x4006
#define SLIMBUS_3_TX 0x4007
#define SLIMBUS_4_RX 0x4008
#define SLIMBUS_4_TX 0x4009
#define SLIMBUS_5_RX 0x400a
#define SLIMBUS_5_TX 0x400b
#define SLIMBUS_6_RX 0x400c
#define SLIMBUS_6_TX 0x400d
#define SLIMBUS_PORT_LAST SLIMBUS_6_TX
#define INT_BT_SCO_RX 0x3000
#define INT_BT_SCO_TX 0x3001
#define INT_BT_A2DP_RX 0x3002
#define INT_FM_RX 0x3004
#define INT_FM_TX 0x3005
#define RT_PROXY_PORT_001_RX 0x2000
#define RT_PROXY_PORT_001_TX 0x2001
#define AFE_PORT_INVALID 0xFFFF
#define SLIMBUS_INVALID AFE_PORT_INVALID
#define AFE_PORT_CMD_START 0x000100ca
#define AFE_EVENT_RTPORT_START 0
#define AFE_EVENT_RTPORT_STOP 1
#define AFE_EVENT_RTPORT_LOW_WM 2
#define AFE_EVENT_RTPORT_HI_WM 3
#define ADSP_AFE_VERSION 0x00200000
/* Size of the range of port IDs for the audio interface. */
#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE 0xF
/* Size of the range of port IDs for internal BT-FM ports. */
#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE 0x6
/* Size of the range of port IDs for SLIMbus<sup>&reg;
* </sup> multichannel
* ports.
*/
#define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA
/* Size of the range of port IDs for real-time proxy ports. */
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
/* Size of the range of port IDs for pseudoports. */
#define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
/* Start of the range of port IDs for the audio interface. */
#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START 0x1000
/* End of the range of port IDs for the audio interface. */
#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_END \
(AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START +\
AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE - 1)
/* Start of the range of port IDs for real-time proxy ports. */
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_START 0x2000
/* End of the range of port IDs for real-time proxy ports. */
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_END \
(AFE_PORT_ID_RT_PROXY_PORT_RANGE_START +\
AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE-1)
/* Start of the range of port IDs for internal BT-FM devices. */
#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START 0x3000
/* End of the range of port IDs for internal BT-FM devices. */
#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_END \
(AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START +\
AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE-1)
/* Start of the range of port IDs for SLIMbus devices. */
#define AFE_PORT_ID_SLIMBUS_RANGE_START 0x4000
/* End of the range of port IDs for SLIMbus devices. */
#define AFE_PORT_ID_SLIMBUS_RANGE_END \
(AFE_PORT_ID_SLIMBUS_RANGE_START +\
AFE_PORT_ID_SLIMBUS_RANGE_SIZE-1)
/* Start of the range of port IDs for pseudoports. */
#define AFE_PORT_ID_PSEUDOPORT_RANGE_START 0x8001
/* End of the range of port IDs for pseudoports. */
#define AFE_PORT_ID_PSEUDOPORT_RANGE_END \
(AFE_PORT_ID_PSEUDOPORT_RANGE_START +\
AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE-1)
#define AFE_PORT_ID_PRIMARY_MI2S_RX 0x1000
#define AFE_PORT_ID_PRIMARY_MI2S_TX 0x1001
#define AFE_PORT_ID_SECONDARY_MI2S_RX 0x1002
#define AFE_PORT_ID_SECONDARY_MI2S_TX 0x1003
#define AFE_PORT_ID_TERTIARY_MI2S_RX 0x1004
#define AFE_PORT_ID_TERTIARY_MI2S_TX 0x1005
#define AFE_PORT_ID_QUATERNARY_MI2S_RX 0x1006
#define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007
#define AUDIO_PORT_ID_I2S_RX 0x1008
#define AFE_PORT_ID_DIGITAL_MIC_TX 0x1009
#define AFE_PORT_ID_PRIMARY_PCM_RX 0x100A
#define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
#define AFE_PORT_ID_SECONDARY_PCM_RX 0x100C
#define AFE_PORT_ID_SECONDARY_PCM_TX 0x100D
#define AFE_PORT_ID_MULTICHAN_HDMI_RX 0x100E
#define AFE_PORT_ID_SECONDARY_MI2S_RX_SD1 0x1010
#define AFE_PORT_ID_SPDIF_RX 0x5000
#define AFE_PORT_ID_RT_PROXY_PORT_001_RX 0x2000
#define AFE_PORT_ID_RT_PROXY_PORT_001_TX 0x2001
#define AFE_PORT_ID_INTERNAL_BT_SCO_RX 0x3000
#define AFE_PORT_ID_INTERNAL_BT_SCO_TX 0x3001
#define AFE_PORT_ID_INTERNAL_BT_A2DP_RX 0x3002
#define AFE_PORT_ID_INTERNAL_FM_RX 0x3004
#define AFE_PORT_ID_INTERNAL_FM_TX 0x3005
/* SLIMbus Rx port on channel 0. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000
/* SLIMbus Tx port on channel 0. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001
/* SLIMbus Rx port on channel 1. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002
/* SLIMbus Tx port on channel 1. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003
/* SLIMbus Rx port on channel 2. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004
/* SLIMbus Tx port on channel 2. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005
/* SLIMbus Rx port on channel 3. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006
/* SLIMbus Tx port on channel 3. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007
/* SLIMbus Rx port on channel 4. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008
/* SLIMbus Tx port on channel 4. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009
/* SLIMbus Rx port on channel 5. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX 0x400a
/* SLIMbus Tx port on channel 5. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX 0x400b
/* SLIMbus Rx port on channel 6. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX 0x400c
/* SLIMbus Tx port on channel 6. */
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX 0x400d
/* Generic pseudoport 1. */
#define AFE_PORT_ID_PSEUDOPORT_01 0x8001
/* Generic pseudoport 2. */
#define AFE_PORT_ID_PSEUDOPORT_02 0x8002
/* @xreflabel{hdr:AfePortIdPrimaryAuxPcmTx}
Primary Aux PCM Tx port ID.
*/
#define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
/* Pseudoport that corresponds to the voice Rx path.
* For recording, the voice Rx path samples are written to this
* port and consumed by the audio path.
*/
#define AFE_PORT_ID_VOICE_RECORD_RX 0x8003
/* Pseudoport that corresponds to the voice Tx path.
* For recording, the voice Tx path samples are written to this
* port and consumed by the audio path.
*/
#define AFE_PORT_ID_VOICE_RECORD_TX 0x8004
/* Pseudoport that corresponds to in-call voice delivery samples.
* During in-call audio delivery, the audio path delivers samples
* to this port from where the voice path delivers them on the
* Rx path.
*/
#define AFE_PORT_ID_VOICE2_PLAYBACK_TX 0x8002
#define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
#define AFE_PORT_ID_INVALID 0xFFFF
#define AAC_ENC_MODE_AAC_LC 0x02
#define AAC_ENC_MODE_AAC_P 0x05
#define AAC_ENC_MODE_EAAC_P 0x1D
#define AFE_PSEUDOPORT_CMD_START 0x000100cf
struct afe_pseudoport_start_command {
struct apr_hdr hdr;
u16 port_id; /* Pseudo Port 1 = 0x8000 */
/* Pseudo Port 2 = 0x8001 */
/* Pseudo Port 3 = 0x8002 */
u16 timing; /* FTRT = 0 , AVTimer = 1, */
} __packed;
#define AFE_PSEUDOPORT_CMD_STOP 0x000100d0
struct afe_pseudoport_stop_command {
struct apr_hdr hdr;
u16 port_id; /* Pseudo Port 1 = 0x8000 */
/* Pseudo Port 2 = 0x8001 */
/* Pseudo Port 3 = 0x8002 */
u16 reserved;
} __packed;
#define AFE_MODULE_SIDETONE_IIR_FILTER 0x00010202
#define AFE_PARAM_ID_ENABLE 0x00010203
/* Payload of the #AFE_PARAM_ID_ENABLE
* parameter, which enables or
* disables any module.
* The fixed size of this structure is four bytes.
*/
struct afe_mod_enable_param {
u16 enable;
/* Enables (1) or disables (0) the module. */
u16 reserved;
/* This field must be set to zero.
*/
} __packed;
/* ID of the configuration parameter used by the
* #AFE_MODULE_SIDETONE_IIR_FILTER module.
*/
#define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204
struct afe_sidetone_iir_filter_config_params {
u16 num_biquad_stages;
/* Number of stages.
* Supported values: Minimum of 5 and maximum of 10
*/
u16 pregain;
/* Pregain for the compensating filter response.
* Supported values: Any number in Q13 format
*/
} __packed;
#define AFE_MODULE_LOOPBACK 0x00010205
#define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206
/* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
* which gets/sets loopback gain of a port to an Rx port.
* The Tx port ID of the loopback is part of the set_param command.
*/
/* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's
* configuration/calibration settings for the AFE port.
*/
struct afe_port_cmd_set_param_v2 {
u16 port_id;
/* Port interface and direction (Rx or Tx) to start.
*/
u16 payload_size;
/* Actual size of the payload in bytes.
* This is used for parsing the parameter payload.
* Supported values: > 0
*/
u32 payload_address_lsw;
/* LSW of 64 bit Payload address.
* Address should be 32-byte,
* 4kbyte aligned and must be contiguous memory.
*/
u32 payload_address_msw;
/* MSW of 64 bit Payload address.
* In case of 32-bit shared memory address,
* this field must be set to zero.
* In case of 36-bit shared memory address,
* bit-4 to bit-31 must be set to zero.
* Address should be 32-byte, 4kbyte aligned
* and must be contiguous memory.
*/
u32 mem_map_handle;
/* Memory map handle returned by
* AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
* Supported Values:
* - NULL -- Message. The parameter data is in-band.
* - Non-NULL -- The parameter data is Out-band.Pointer to
* the physical address
* in shared memory of the payload data.
* An optional field is available if parameter
* data is in-band:
* afe_param_data_v2 param_data[...].
* For detailed payload content, see the
* afe_port_param_data_v2 structure.
*/
} __packed;
#define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF
struct afe_port_param_data_v2 {
u32 module_id;
/* ID of the module to be configured.
* Supported values: Valid module ID
*/
u32 param_id;
/* ID of the parameter corresponding to the supported parameters
* for the module ID.
* Supported values: Valid parameter ID
*/
u16 param_size;
/* Actual size of the data for the
* module_id/param_id pair. The size is a
* multiple of four bytes.
* Supported values: > 0
*/
u16 reserved;
/* This field must be set to zero.
*/
} __packed;
struct afe_loopback_gain_per_path_param {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
struct afe_port_param_data_v2 pdata;
u16 rx_port_id;
/* Rx port of the loopback. */
u16 gain;
/* Loopback gain per path of the port.
* Supported values: Any number in Q13 format
*/
} __packed;
/* Parameter ID used to configure and enable/disable the
* loopback path. The difference with respect to the existing
* API, AFE_PORT_CMD_LOOPBACK, is that it allows Rx port to be
* configured as source port in loopback path. Port-id in
* AFE_PORT_CMD_SET_PARAM cmd is the source port whcih can be
* Tx or Rx port. In addition, we can configure the type of
* routing mode to handle different use cases.
*/
#define AFE_PARAM_ID_LOOPBACK_CONFIG 0x0001020B
#define AFE_API_VERSION_LOOPBACK_CONFIG 0x1
enum afe_loopback_routing_mode {
LB_MODE_DEFAULT = 1,
/* Regular loopback from source to destination port */
LB_MODE_SIDETONE,
/* Sidetone feed from Tx source to Rx destination port */
LB_MODE_EC_REF_VOICE_AUDIO,
/* Echo canceller reference, voice + audio + DTMF */
LB_MODE_EC_REF_VOICE
/* Echo canceller reference, voice alone */
} __packed;
/* Payload of the #AFE_PARAM_ID_LOOPBACK_CONFIG ,
* which enables/disables one AFE loopback.
*/
struct afe_loopback_cfg_v1 {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
struct afe_port_param_data_v2 pdata;
u32 loopback_cfg_minor_version;
/* Minor version used for tracking the version of the RMC module
* configuration interface.
* Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
*/
u16 dst_port_id;
/* Destination Port Id. */
u16 routing_mode;
/* Specifies data path type from src to dest port.
* Supported values:
* #LB_MODE_DEFAULT
* #LB_MODE_SIDETONE
* #LB_MODE_EC_REF_VOICE_AUDIO
* #LB_MODE_EC_REF_VOICE_A
* #LB_MODE_EC_REF_VOICE
*/
u16 enable;
/* Specifies whether to enable (1) or
* disable (0) an AFE loopback.
*/
u16 reserved;
/* Reserved for 32-bit alignment. This field must be set to 0.
*/
} __packed;
#define AFE_MODULE_SPEAKER_PROTECTION 0x00010209
#define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a
#define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1
#define AFE_SPKR_PROT_EXCURSIONF_LEN 512
struct afe_spkr_prot_cfg_param_v1 {
u32 spkr_prot_minor_version;
/*
* Minor version used for tracking the version of the
* speaker protection module configuration interface.
* Supported values: #AFE_API_VERSION_SPKR_PROT_CONFIG
*/
int16_t win_size;
/* Analysis and synthesis window size (nWinSize).
* Supported values: 1024, 512, 256 samples
*/
int16_t margin;
/* Allowable margin for excursion prediction,
* in L16Q15 format. This is a
* control parameter to allow
* for overestimation of peak excursion.
*/
int16_t spkr_exc_limit;
/* Speaker excursion limit, in L16Q15 format.*/
int16_t spkr_resonance_freq;
/* Resonance frequency of the speaker; used
* to define a frequency range
* for signal modification.
*
* Supported values: 0 to 2000 Hz */
int16_t limhresh;
/* Threshold of the hard limiter; used to
* prevent overshooting beyond a
* signal level that was set by the limiter
* prior to speaker protection.
* Supported values: 0 to 32767
*/
int16_t hpf_cut_off_freq;
/* High pass filter cutoff frequency.
* Supported values: 100, 200, 300 Hz
*/
int16_t hpf_enable;
/* Specifies whether the high pass filter
* is enabled (0) or disabled (1).
*/
int16_t reserved;
/* This field must be set to zero. */
int32_t amp_gain;
/* Amplifier gain in L32Q15 format.
* This is the RMS voltage at the
* loudspeaker when a 0dBFS tone
* is played in the digital domain.
*/
int16_t excursionf[AFE_SPKR_PROT_EXCURSIONF_LEN];
/* Array of the excursion transfer function.
* The peak excursion of the
* loudspeaker diaphragm is
* measured in millimeters for 1 Vrms Sine
* tone at all FFT bin frequencies.
* Supported values: Q15 format
*/
} __packed;
#define AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER 0x000100E0
/* Payload of the #AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER
* command, which registers a real-time port driver
* with the AFE service.
*/
struct afe_service_cmd_register_rt_port_driver {
struct apr_hdr hdr;
u16 port_id;
/* Port ID with which the real-time driver exchanges data
* (registers for events).
* Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
* #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
*/
u16 reserved;
/* This field must be set to zero. */
} __packed;
#define AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER 0x000100E1
/* Payload of the #AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER
* command, which unregisters a real-time port driver from
* the AFE service.
*/
struct afe_service_cmd_unregister_rt_port_driver {
struct apr_hdr hdr;
u16 port_id;
/* Port ID from which the real-time
* driver unregisters for events.
* Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
* #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
*/
u16 reserved;
/* This field must be set to zero. */
} __packed;
#define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
#define AFE_EVENTYPE_RT_PROXY_PORT_START 0
#define AFE_EVENTYPE_RT_PROXY_PORT_STOP 1
#define AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK 2
#define AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK 3
#define AFE_EVENTYPE_RT_PROXY_PORT_INVALID 0xFFFF
/* Payload of the #AFE_EVENT_RT_PROXY_PORT_STATUS
* message, which sends an event from the AFE service
* to a registered client.
*/
struct afe_event_rt_proxy_port_status {
u16 port_id;
/* Port ID to which the event is sent.
* Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
* #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
*/
u16 eventype;
/* Type of event.
* Supported values:
* - #AFE_EVENTYPE_RT_PROXY_PORT_START
* - #AFE_EVENTYPE_RT_PROXY_PORT_STOP
* - #AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK
* - #AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK
*/
} __packed;
#define AFE_PORT_DATA_CMD_RT_PROXY_PORT_WRITE_V2 0x000100ED
struct afe_port_data_cmd_rt_proxy_port_write_v2 {
struct apr_hdr hdr;
u16 port_id;
/* Tx (mic) proxy port ID with which the real-time
* driver exchanges data.
* Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
* #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
*/
u16 reserved;
/* This field must be set to zero. */
u32 buffer_address_lsw;
/* LSW Address of the buffer containing the
* data from the real-time source
* device on a client.
*/
u32 buffer_address_msw;
/* MSW Address of the buffer containing the
* data from the real-time source
* device on a client.
*/
u32 mem_map_handle;
/* A memory map handle encapsulating shared memory
* attributes is returned if
* AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS
* command is successful.
* Supported Values:
* - Any 32 bit value
*/
u32 available_bytes;
/* Number of valid bytes available
* in the buffer (including all
* channels: number of bytes per
* channel = availableBytesumChannels).
* Supported values: > 0
*
* This field must be equal to the frame
* size specified in the #AFE_PORT_AUDIO_IF_CONFIG
* command that was sent to configure this
* port.
*/
} __packed;
#define AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 0x000100EE
/* Payload of the
* #AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 command, which
* delivers an empty buffer to the AFE service. On
* acknowledgment, data is filled in the buffer.
*/
struct afe_port_data_cmd_rt_proxy_port_read_v2 {
struct apr_hdr hdr;
u16 port_id;
/* Rx proxy port ID with which the real-time
* driver exchanges data.
* Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
* #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
* (This must be an Rx (speaker) port.)
*/
u16 reserved;
/* This field must be set to zero. */
u32 buffer_address_lsw;
/* LSW Address of the buffer containing the data sent from the AFE
* service to a real-time sink device on the client.
*/
u32 buffer_address_msw;
/* MSW Address of the buffer containing the data sent from the AFE
* service to a real-time sink device on the client.
*/
u32 mem_map_handle;
/* A memory map handle encapsulating shared memory attributes is
* returned if AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
* successful.
* Supported Values:
* - Any 32 bit value
*/
u32 available_bytes;
/* Number of valid bytes available in the buffer (including all
* channels).
* Supported values: > 0
* This field must be equal to the frame size specified in the
* #AFE_PORT_AUDIO_IF_CONFIG command that was sent to configure
* this port.
*/
} __packed;
/* This module ID is related to device configuring like I2S,PCM,
* HDMI, SLIMBus etc. This module supports follwing parameter ids.
* - #AFE_PARAM_ID_I2S_CONFIG
* - #AFE_PARAM_ID_PCM_CONFIG
* - #AFE_PARAM_ID_DIGI_MIC_CONFIG
* - #AFE_PARAM_ID_HDMI_CONFIG
* - #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
* - #AFE_PARAM_ID_SLIMBUS_CONFIG
* - #AFE_PARAM_ID_RT_PROXY_CONFIG
*/
#define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C
#define AFE_PORT_SAMPLE_RATE_8K 8000
#define AFE_PORT_SAMPLE_RATE_16K 16000
#define AFE_PORT_SAMPLE_RATE_48K 48000
#define AFE_PORT_SAMPLE_RATE_96K 96000
#define AFE_PORT_SAMPLE_RATE_192K 192000
#define AFE_LINEAR_PCM_DATA 0x0
#define AFE_NON_LINEAR_DATA 0x1
#define AFE_LINEAR_PCM_DATA_PACKED_60958 0x2
#define AFE_NON_LINEAR_DATA_PACKED_60958 0x3
/* This param id is used to configure I2S interface */
#define AFE_PARAM_ID_I2S_CONFIG 0x0001020D
#define AFE_API_VERSION_I2S_CONFIG 0x1
/* Enumeration for setting the I2S configuration
* channel_mode parameter to
* serial data wire number 1-3 (SD3).
*/
#define AFE_PORT_I2S_SD0 0x1
#define AFE_PORT_I2S_SD1 0x2
#define AFE_PORT_I2S_SD2 0x3
#define AFE_PORT_I2S_SD3 0x4
#define AFE_PORT_I2S_QUAD01 0x5
#define AFE_PORT_I2S_QUAD23 0x6
#define AFE_PORT_I2S_6CHS 0x7
#define AFE_PORT_I2S_8CHS 0x8
#define AFE_PORT_I2S_MONO 0x0
#define AFE_PORT_I2S_STEREO 0x1
#define AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL 0x0
#define AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL 0x1
/* Payload of the #AFE_PARAM_ID_I2S_CONFIG
* command's (I2S configuration
* parameter).
*/
struct afe_param_id_i2s_cfg {
u32 i2s_cfg_minor_version;
/* Minor version used for tracking the version of the I2S
* configuration interface.
* Supported values: #AFE_API_VERSION_I2S_CONFIG
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16, 24
*/
u16 channel_mode;
/* I2S lines and multichannel operation.
* Supported values:
* - #AFE_PORT_I2S_SD0
* - #AFE_PORT_I2S_SD1
* - #AFE_PORT_I2S_SD2
* - #AFE_PORT_I2S_SD3
* - #AFE_PORT_I2S_QUAD01
* - #AFE_PORT_I2S_QUAD23
* - #AFE_PORT_I2S_6CHS
* - #AFE_PORT_I2S_8CHS
*/
u16 mono_stereo;
/* Specifies mono or stereo. This applies only when
* a single I2S line is used.
* Supported values:
* - #AFE_PORT_I2S_MONO
* - #AFE_PORT_I2S_STEREO
*/
u16 ws_src;
/* Word select source: internal or external.
* Supported values:
* - #AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL
* - #AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
* - #AFE_PORT_SAMPLE_RATE_48K
* - #AFE_PORT_SAMPLE_RATE_96K
* - #AFE_PORT_SAMPLE_RATE_192K
*/
u16 data_format;
/* data format
* Supported values:
* - #LINEAR_PCM_DATA
* - #NON_LINEAR_DATA
* - #LINEAR_PCM_DATA_PACKED_IN_60958
* - #NON_LINEAR_DATA_PACKED_IN_60958
*/
u16 reserved;
/* This field must be set to zero. */
} __packed;
/*
* This param id is used to configure PCM interface
*/
#define AFE_API_VERSION_SPDIF_CONFIG 0x1
#define AFE_API_VERSION_SPDIF_CH_STATUS_CONFIG 0x1
#define AFE_API_VERSION_SPDIF_CLK_CONFIG 0x1
#define AFE_CH_STATUS_A 1
#define AFE_CH_STATUS_B 2
#define AFE_PARAM_ID_SPDIF_CONFIG 0x00010244
#define AFE_PARAM_ID_CH_STATUS_CONFIG 0x00010245
#define AFE_PARAM_ID_SPDIF_CLK_CONFIG 0x00010246
#define AFE_PORT_CLK_ROOT_LPAPLL 0x3
#define AFE_PORT_CLK_ROOT_LPAQ6PLL 0x4
struct afe_param_id_spdif_cfg {
/* Minor version used for tracking the version of the SPDIF
* configuration interface.
* Supported values: #AFE_API_VERSION_SPDIF_CONFIG
*/
u32 spdif_cfg_minor_version;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_22_05K
* - #AFE_PORT_SAMPLE_RATE_32K
* - #AFE_PORT_SAMPLE_RATE_44_1K
* - #AFE_PORT_SAMPLE_RATE_48K
* - #AFE_PORT_SAMPLE_RATE_96K
* - #AFE_PORT_SAMPLE_RATE_176_4K
* - #AFE_PORT_SAMPLE_RATE_192K
*/
u32 sample_rate;
/* data format
* Supported values:
* - #AFE_LINEAR_PCM_DATA
* - #AFE_NON_LINEAR_DATA
*/
u16 data_format;
/* Number of channels supported by the port
* - PCM - 1, Compressed Case - 2
*/
u16 num_channels;
/* Bit width of the sample.
* Supported values: 16, 24
*/
u16 bit_width;
/* This field must be set to zero. */
u16 reserved;
} __packed;
struct afe_param_id_spdif_ch_status_cfg {
u32 ch_status_cfg_minor_version;
/* Minor version used for tracking the version of channel
* status configuration. Current supported version is 1
*/
u32 status_type;
/* Indicate if the channel status is for channel A or B
* Supported values:
* - #AFE_CH_STATUS_A
* - #AFE_CH_STATUS_B
*/
u8 status_bits[24];
/* Channel status - 192 bits for channel
* Byte ordering as defined by IEC60958-3
*/
u8 status_mask[24];
/* Channel status with mask bits 1 will be applied.
* Byte ordering as defined by IEC60958-3
*/
} __packed;
struct afe_param_id_spdif_clk_cfg {
u32 clk_cfg_minor_version;
/* Minor version used for tracking the version of SPDIF
* interface clock configuration. Current supported version
* is 1
*/
u32 clk_value;
/* Specifies the clock frequency in Hz to set
* Supported values:
* 0 - Disable the clock
* 2 (byphase) * 32 (60958 subframe size) * sampling rate * 2
* (channels A and B)
*/
u32 clk_root;
/* Specifies SPDIF root clk source
* Supported Values:
* - #AFE_PORT_CLK_ROOT_LPAPLL
* - #AFE_PORT_CLK_ROOT_LPAQ6PLL
*/
} __packed;
struct afe_spdif_clk_config_command {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
struct afe_port_param_data_v2 pdata;
struct afe_param_id_spdif_clk_cfg clk_cfg;
} __packed;
struct afe_spdif_chstatus_config_command {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
struct afe_port_param_data_v2 pdata;
struct afe_param_id_spdif_ch_status_cfg ch_status;
} __packed;
struct afe_spdif_port_config {
struct afe_param_id_spdif_cfg cfg;
struct afe_param_id_spdif_ch_status_cfg ch_status;
} __packed;
#define AFE_PARAM_ID_PCM_CONFIG 0x0001020E
#define AFE_API_VERSION_PCM_CONFIG 0x1
/* Enumeration for the auxiliary PCM synchronization signal
* provided by an external source.
*/
#define AFE_PORT_PCM_SYNC_SRC_EXTERNAL 0x0
/* Enumeration for the auxiliary PCM synchronization signal
* provided by an internal source.
*/
#define AFE_PORT_PCM_SYNC_SRC_INTERNAL 0x1
/* Enumeration for the PCM configuration aux_mode parameter,
* which configures the auxiliary PCM interface to use
* short synchronization.
*/
#define AFE_PORT_PCM_AUX_MODE_PCM 0x0
/*
* Enumeration for the PCM configuration aux_mode parameter,
* which configures the auxiliary PCM interface to use long
* synchronization.
*/
#define AFE_PORT_PCM_AUX_MODE_AUX 0x1
/*
* Enumeration for setting the PCM configuration frame to 8.
*/
#define AFE_PORT_PCM_BITS_PER_FRAME_8 0x0
/*
* Enumeration for setting the PCM configuration frame to 16.
*/
#define AFE_PORT_PCM_BITS_PER_FRAME_16 0x1
/* Enumeration for setting the PCM configuration frame to 32.*/
#define AFE_PORT_PCM_BITS_PER_FRAME_32 0x2
/* Enumeration for setting the PCM configuration frame to 64.*/
#define AFE_PORT_PCM_BITS_PER_FRAME_64 0x3
/* Enumeration for setting the PCM configuration frame to 128.*/
#define AFE_PORT_PCM_BITS_PER_FRAME_128 0x4
/* Enumeration for setting the PCM configuration frame to 256.*/
#define AFE_PORT_PCM_BITS_PER_FRAME_256 0x5
/* Enumeration for setting the PCM configuration
* quantype parameter to A-law with no padding.
*/
#define AFE_PORT_PCM_ALAW_NOPADDING 0x0
/* Enumeration for setting the PCM configuration quantype
* parameter to mu-law with no padding.
*/
#define AFE_PORT_PCM_MULAW_NOPADDING 0x1
/* Enumeration for setting the PCM configuration quantype
* parameter to linear with no padding.
*/
#define AFE_PORT_PCM_LINEAR_NOPADDING 0x2
/* Enumeration for setting the PCM configuration quantype
* parameter to A-law with padding.
*/
#define AFE_PORT_PCM_ALAW_PADDING 0x3
/* Enumeration for setting the PCM configuration quantype
* parameter to mu-law with padding.
*/
#define AFE_PORT_PCM_MULAW_PADDING 0x4
/* Enumeration for setting the PCM configuration quantype
* parameter to linear with padding.
*/
#define AFE_PORT_PCM_LINEAR_PADDING 0x5
/* Enumeration for disabling the PCM configuration
* ctrl_data_out_enable parameter.
* The PCM block is the only master.
*/
#define AFE_PORT_PCM_CTRL_DATA_OE_DISABLE 0x0
/*
* Enumeration for enabling the PCM configuration
* ctrl_data_out_enable parameter. The PCM block shares
* the signal with other masters.
*/
#define AFE_PORT_PCM_CTRL_DATA_OE_ENABLE 0x1
/* Payload of the #AFE_PARAM_ID_PCM_CONFIG command's
* (PCM configuration parameter).
*/
struct afe_param_id_pcm_cfg {
u32 pcm_cfg_minor_version;
/* Minor version used for tracking the version of the AUX PCM
* configuration interface.
* Supported values: #AFE_API_VERSION_PCM_CONFIG
*/
u16 aux_mode;
/* PCM synchronization setting.
* Supported values:
* - #AFE_PORT_PCM_AUX_MODE_PCM
* - #AFE_PORT_PCM_AUX_MODE_AUX
*/
u16 sync_src;
/* Synchronization source.
* Supported values:
* - #AFE_PORT_PCM_SYNC_SRC_EXTERNAL
* - #AFE_PORT_PCM_SYNC_SRC_INTERNAL
*/
u16 frame_setting;
/* Number of bits per frame.
* Supported values:
* - #AFE_PORT_PCM_BITS_PER_FRAME_8
* - #AFE_PORT_PCM_BITS_PER_FRAME_16
* - #AFE_PORT_PCM_BITS_PER_FRAME_32
* - #AFE_PORT_PCM_BITS_PER_FRAME_64
* - #AFE_PORT_PCM_BITS_PER_FRAME_128
* - #AFE_PORT_PCM_BITS_PER_FRAME_256
*/
u16 quantype;
/* PCM quantization type.
* Supported values:
* - #AFE_PORT_PCM_ALAW_NOPADDING
* - #AFE_PORT_PCM_MULAW_NOPADDING
* - #AFE_PORT_PCM_LINEAR_NOPADDING
* - #AFE_PORT_PCM_ALAW_PADDING
* - #AFE_PORT_PCM_MULAW_PADDING
* - #AFE_PORT_PCM_LINEAR_PADDING
*/
u16 ctrl_data_out_enable;
/* Specifies whether the PCM block shares the data-out
* signal to the drive with other masters.
* Supported values:
* - #AFE_PORT_PCM_CTRL_DATA_OE_DISABLE
* - #AFE_PORT_PCM_CTRL_DATA_OE_ENABLE
*/
u16 reserved;
/* This field must be set to zero. */
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16
*/
u16 num_channels;
/* Number of channels.
* Supported values: 1 to 4
*/
u16 slot_number_mapping[4];
/* Specifies the slot number for the each channel in
* multi channel scenario.
* Supported values: 1 to 32
*/
} __packed;
/*
* This param id is used to configure DIGI MIC interface
*/
#define AFE_PARAM_ID_DIGI_MIC_CONFIG 0x0001020F
/* This version information is used to handle the new
* additions to the config interface in future in backward
* compatible manner.
*/
#define AFE_API_VERSION_DIGI_MIC_CONFIG 0x1
/* Enumeration for setting the digital mic configuration
* channel_mode parameter to left 0.
*/
#define AFE_PORT_DIGI_MIC_MODE_LEFT0 0x1
/*Enumeration for setting the digital mic configuration
* channel_mode parameter to right 0.
*/
#define AFE_PORT_DIGI_MIC_MODE_RIGHT0 0x2
/* Enumeration for setting the digital mic configuration
* channel_mode parameter to left 1.
*/
#define AFE_PORT_DIGI_MIC_MODE_LEFT1 0x3
/* Enumeration for setting the digital mic configuration
* channel_mode parameter to right 1.
*/
#define AFE_PORT_DIGI_MIC_MODE_RIGHT1 0x4
/* Enumeration for setting the digital mic configuration
* channel_mode parameter to stereo 0.
*/
#define AFE_PORT_DIGI_MIC_MODE_STEREO0 0x5
/* Enumeration for setting the digital mic configuration
* channel_mode parameter to stereo 1.
*/
#define AFE_PORT_DIGI_MIC_MODE_STEREO1 0x6
/* Enumeration for setting the digital mic configuration
* channel_mode parameter to quad.
*/
#define AFE_PORT_DIGI_MIC_MODE_QUAD 0x7
/* Payload of the #AFE_PARAM_ID_DIGI_MIC_CONFIG command's
* (DIGI MIC configuration
* parameter).
*/
struct afe_param_id_digi_mic_cfg {
u32 digi_mic_cfg_minor_version;
/* Minor version used for tracking the version of the DIGI Mic
* configuration interface.
* Supported values: #AFE_API_VERSION_DIGI_MIC_CONFIG
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16
*/
u16 channel_mode;
/* Digital mic and multichannel operation.
* Supported values:
* - #AFE_PORT_DIGI_MIC_MODE_LEFT0
* - #AFE_PORT_DIGI_MIC_MODE_RIGHT0
* - #AFE_PORT_DIGI_MIC_MODE_LEFT1
* - #AFE_PORT_DIGI_MIC_MODE_RIGHT1
* - #AFE_PORT_DIGI_MIC_MODE_STEREO0
* - #AFE_PORT_DIGI_MIC_MODE_STEREO1
* - #AFE_PORT_DIGI_MIC_MODE_QUAD
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
* - #AFE_PORT_SAMPLE_RATE_48K
*/
} __packed;
/*
* This param id is used to configure HDMI interface
*/
#define AFE_PARAM_ID_HDMI_CONFIG 0x00010210
/* This version information is used to handle the new
* additions to the config interface in future in backward
* compatible manner.
*/
#define AFE_API_VERSION_HDMI_CONFIG 0x1
/* Payload of the #AFE_PARAM_ID_HDMI_CONFIG command,
* which configures a multichannel HDMI audio interface.
*/
struct afe_param_id_hdmi_multi_chan_audio_cfg {
u32 hdmi_cfg_minor_version;
/* Minor version used for tracking the version of the HDMI
* configuration interface.
* Supported values: #AFE_API_VERSION_HDMI_CONFIG
*/
u16 datatype;
/* data type
* Supported values:
* - #LINEAR_PCM_DATA
* - #NON_LINEAR_DATA
* - #LINEAR_PCM_DATA_PACKED_IN_60958
* - #NON_LINEAR_DATA_PACKED_IN_60958
*/
u16 channel_allocation;
/* HDMI channel allocation information for programming an HDMI
* frame. The default is 0 (Stereo).
*
* This information is defined in the HDMI standard, CEA 861-D
* (refer to @xhyperref{S1,[S1]}). The number of channels is also
* inferred from this parameter.
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
* - #AFE_PORT_SAMPLE_RATE_48K
* - #AFE_PORT_SAMPLE_RATE_96K
* - 22050, 44100, 176400 for compressed streams
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16, 24
*/
u16 reserved;
/* This field must be set to zero. */
} __packed;
/*
* This param id is used to configure BT or FM(RIVA) interface
*/
#define AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG 0x00010211
/* This version information is used to handle the new
* additions to the config interface in future in backward
* compatible manner.
*/
#define AFE_API_VERSION_INTERNAL_BT_FM_CONFIG 0x1
/* Payload of the #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
* command's BT voice/BT audio/FM configuration parameter.
*/
struct afe_param_id_internal_bt_fm_cfg {
u32 bt_fm_cfg_minor_version;
/* Minor version used for tracking the version of the BT and FM
* configuration interface.
* Supported values: #AFE_API_VERSION_INTERNAL_BT_FM_CONFIG
*/
u16 num_channels;
/* Number of channels.
* Supported values: 1 to 2
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K (only for BTSCO)
* - #AFE_PORT_SAMPLE_RATE_16K (only for BTSCO)
* - #AFE_PORT_SAMPLE_RATE_48K (FM and A2DP)
*/
} __packed;
/* This param id is used to configure SLIMBUS interface using
* shared channel approach.
*/
#define AFE_PARAM_ID_SLIMBUS_CONFIG 0x00010212
/* This version information is used to handle the new
* additions to the config interface in future in backward
* compatible manner.
*/
#define AFE_API_VERSION_SLIMBUS_CONFIG 0x1
/* Enumeration for setting SLIMbus device ID 1.
*/
#define AFE_SLIMBUS_DEVICE_1 0x0
/* Enumeration for setting SLIMbus device ID 2.
*/
#define AFE_SLIMBUS_DEVICE_2 0x1
/* Enumeration for setting the SLIMbus data formats.
*/
#define AFE_SB_DATA_FORMAT_NOT_INDICATED 0x0
/* Enumeration for setting the maximum number of streams per
* device.
*/
#define AFE_PORT_MAX_AUDIO_CHAN_CNT 0x8
/* Payload of the #AFE_PORT_CMD_SLIMBUS_CONFIG command's SLIMbus
* port configuration parameter.
*/
struct afe_param_id_slimbus_cfg {
u32 sb_cfg_minor_version;
/* Minor version used for tracking the version of the SLIMBUS
* configuration interface.
* Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG
*/
u16 slimbus_dev_id;
/* SLIMbus hardware device ID, which is required to handle
* multiple SLIMbus hardware blocks.
* Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16, 24
*/
u16 data_format;
/* Data format supported by the SLIMbus hardware. The default is
* 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the
* hardware does not perform any format conversions before the data
* transfer.
*/
u16 num_channels;
/* Number of channels.
* Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
*/
u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
/* Mapping of shared channel IDs (128 to 255) to which the
* master port is to be connected.
* Shared_channel_mapping[i] represents the shared channel assigned
* for audio channel i in multichannel audio data.
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
* - #AFE_PORT_SAMPLE_RATE_48K
* - #AFE_PORT_SAMPLE_RATE_96K
* - #AFE_PORT_SAMPLE_RATE_192K
*/
} __packed;
/*
* This param id is used to configure Real Time Proxy interface.
*/
#define AFE_PARAM_ID_RT_PROXY_CONFIG 0x00010213
/* This version information is used to handle the new
* additions to the config interface in future in backward
* compatible manner.
*/
#define AFE_API_VERSION_RT_PROXY_CONFIG 0x1
/* Payload of the #AFE_PARAM_ID_RT_PROXY_CONFIG
* command (real-time proxy port configuration parameter).
*/
struct afe_param_id_rt_proxy_port_cfg {
u32 rt_proxy_cfg_minor_version;
/* Minor version used for tracking the version of rt-proxy
* config interface.
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16
*/
u16 interleaved;
/* Specifies whether the data exchanged between the AFE
* interface and real-time port is interleaved.
* Supported values: - 0 -- Non-interleaved (samples from each
* channel are contiguous in the buffer) - 1 -- Interleaved
* (corresponding samples from each input channel are interleaved
* within the buffer)
*/
u16 frame_size;
/* Size of the frames that are used for PCM exchanges with this
* port.
* Supported values: > 0, in bytes
* For example, 5 ms buffers of 16 bits and 16 kHz stereo samples
* is 5 ms * 16 samples/ms * 2 bytes/sample * 2 channels = 320
* bytes.
*/
u16 jitter_allowance;
/* Configures the amount of jitter that the port will allow.
* Supported values: > 0
* For example, if +/-10 ms of jitter is anticipated in the timing
* of sending frames to the port, and the configuration is 16 kHz
* mono with 16-bit samples, this field is 10 ms * 16 samples/ms * 2
* bytes/sample = 320.
*/
u16 low_water_mark;
/* Low watermark in bytes (including all channels).
* Supported values:
* - 0 -- Do not send any low watermark events
* - > 0 -- Low watermark for triggering an event
* If the number of bytes in an internal circular buffer is lower
* than this low_water_mark parameter, a LOW_WATER_MARK event is
* sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
* event).
* Use of watermark events is optional for debugging purposes.
*/
u16 high_water_mark;
/* High watermark in bytes (including all channels).
* Supported values:
* - 0 -- Do not send any high watermark events
* - > 0 -- High watermark for triggering an event
* If the number of bytes in an internal circular buffer exceeds
* TOTAL_CIRC_BUF_SIZE minus high_water_mark, a high watermark event
* is sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
* event).
* The use of watermark events is optional and for debugging
* purposes.
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
* - #AFE_PORT_SAMPLE_RATE_48K
*/
u16 num_channels;
/* Number of channels.
* Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
*/
u16 reserved;
/* For 32 bit alignment. */
} __packed;
/* This param id is used to configure the Pseudoport interface */
#define AFE_PARAM_ID_PSEUDO_PORT_CONFIG 0x00010219
/* Version information used to handle future additions to the configuration
* interface (for backward compatibility).
*/
#define AFE_API_VERSION_PSEUDO_PORT_CONFIG 0x1
/* Enumeration for setting the timing_mode parameter to faster than real
* time.
*/
#define AFE_PSEUDOPORT_TIMING_MODE_FTRT 0x0
/* Enumeration for setting the timing_mode parameter to real time using
* timers.
*/
#define AFE_PSEUDOPORT_TIMING_MODE_TIMER 0x1
/* Payload of the AFE_PARAM_ID_PSEUDO_PORT_CONFIG parameter used by
AFE_MODULE_AUDIO_DEV_INTERFACE.
*/
struct afe_param_id_pseudo_port_cfg {
u32 pseud_port_cfg_minor_version;
/*
* Minor version used for tracking the version of the pseudoport
* configuration interface.
*/
u16 bit_width;
/* Bit width of the sample at values 16, 24 */
u16 num_channels;
/* Number of channels at values 1 to 8 */
u16 data_format;
/* Non-linear data format supported by the pseudoport (for future use).
* At values #AFE_LINEAR_PCM_DATA
*/
u16 timing_mode;
/* Indicates whether the pseudoport synchronizes to the clock or
* operates faster than real time.
* at values
* - #AFE_PSEUDOPORT_TIMING_MODE_FTRT
* - #AFE_PSEUDOPORT_TIMING_MODE_TIMER @tablebulletend
*/
u32 sample_rate;
/* Sample rate at which the pseudoport will run.
* at values
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_32K
* - #AFE_PORT_SAMPLE_RATE_48K
* - #AFE_PORT_SAMPLE_RATE_96K
* - #AFE_PORT_SAMPLE_RATE_192K @tablebulletend
*/
} __packed;
#define AFE_PARAM_ID_DEVICE_HW_DELAY 0x00010243
#define AFE_API_VERSION_DEVICE_HW_DELAY 0x1
struct afe_param_id_device_hw_delay_cfg {
uint32_t device_hw_delay_minor_version;
uint32_t delay_in_us;
} __packed;
#define AFE_PARAM_ID_SET_TOPOLOGY 0x0001025A
#define AFE_API_VERSION_TOPOLOGY_V1 0x1
struct afe_param_id_set_topology_cfg {
/*
* Minor version used for tracking afe topology id configuration.
* @values #AFE_API_VERSION_TOPOLOGY_V1
*/
u32 minor_version;
/*
* Id of the topology for the afe session.
* @values Any valid AFE topology ID
*/
u32 topology_id;
} __packed;
union afe_port_config {
struct afe_param_id_pcm_cfg pcm;
struct afe_param_id_i2s_cfg i2s;
struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
struct afe_param_id_slimbus_cfg slim_sch;
struct afe_param_id_rt_proxy_port_cfg rtproxy;
struct afe_param_id_internal_bt_fm_cfg int_bt_fm;
struct afe_param_id_pseudo_port_cfg pseudo_port;
struct afe_param_id_device_hw_delay_cfg hw_delay;
struct afe_param_id_spdif_cfg spdif;
struct afe_param_id_set_topology_cfg topology;
} __packed;
struct afe_audioif_config_command_no_payload {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
} __packed;
struct afe_audioif_config_command {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
struct afe_port_param_data_v2 pdata;
union afe_port_config port;
} __packed;
#define AFE_PORT_CMD_DEVICE_START 0x000100E5
/* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
struct afe_port_cmd_device_start {
struct apr_hdr hdr;
u16 port_id;
/* Port interface and direction (Rx or Tx) to start. An even
* number represents the Rx direction, and an odd number represents
* the Tx direction.
*/
u16 reserved;
/* Reserved for 32-bit alignment. This field must be set to 0.*/
} __packed;
#define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
/* Payload of the #AFE_PORT_CMD_DEVICE_STOP.
*/
struct afe_port_cmd_device_stop {
struct apr_hdr hdr;
u16 port_id;
/* Port interface and direction (Rx or Tx) to start. An even
* number represents the Rx direction, and an odd number represents
* the Tx direction.
*/
u16 reserved;
/* Reserved for 32-bit alignment. This field must be set to 0.*/
} __packed;
#define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
/* Memory map regions command payload used by the
* #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
* This structure allows clients to map multiple shared memory
* regions in a single command. Following this structure are
* num_regions of afe_service_shared_map_region_payload.
*/
struct afe_service_cmd_shared_mem_map_regions {
struct apr_hdr hdr;
u16 mem_pool_id;
/* Type of memory on which this memory region is mapped.
* Supported values:
* - #ADSP_MEMORY_MAP_EBI_POOL
* - #ADSP_MEMORY_MAP_SMI_POOL
* - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
* - Other values are reserved
*
* The memory pool ID implicitly defines the characteristics of the
* memory. Characteristics may include alignment type, permissions,
* etc.
*
* ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
* ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
* ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
* addressable, and 4 KB aligned.
*/
u16 num_regions;
/* Number of regions to map.
* Supported values:
* - Any value greater than zero
*/
u32 property_flag;
/* Configures one common property for all the regions in the
* payload.
*
* Supported values: - 0x00000000 to 0x00000001
*
* b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
* address provided in afe_service_shared_map_region_payloadis a
* physical address. The shared memory needs to be mapped( hardware
* TLB entry) and a software entry needs to be added for internal
* book keeping.
*
* 1 Shared memory address provided in
* afe_service_shared_map_region_payloadis a virtual address. The
* shared memory must not be mapped (since hardware TLB entry is
* already available) but a software entry needs to be added for
* internal book keeping. This can be useful if two services with in
* ADSP is communicating via APR. They can now directly communicate
* via the Virtual address instead of Physical address. The virtual
* regions must be contiguous. num_regions must be 1 in this case.
*
* b31-b1 - reserved bits. must be set to zero
*/
} __packed;
/* Map region payload used by the
* afe_service_shared_map_region_payloadstructure.
*/
struct afe_service_shared_map_region_payload {
u32 shm_addr_lsw;
/* least significant word of starting address in the memory
* region to map. It must be contiguous memory, and it must be 4 KB
* aligned.
* Supported values: - Any 32 bit value
*/
u32 shm_addr_msw;
/* most significant word of startng address in the memory region
* to map. For 32 bit shared memory address, this field must be set
* to zero. For 36 bit shared memory address, bit31 to bit 4 must be
* set to zero
*
* Supported values: - For 32 bit shared memory address, this field
* must be set to zero. - For 36 bit shared memory address, bit31 to
* bit 4 must be set to zero - For 64 bit shared memory address, any
* 32 bit value
*/
u32 mem_size_bytes;
/* Number of bytes in the region. The aDSP will always map the
* regions as virtual contiguous memory, but the memory size must be
* in multiples of 4 KB to avoid gaps in the virtually contiguous
* mapped memory.
*
* Supported values: - multiples of 4KB
*/
} __packed;
#define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
struct afe_service_cmdrsp_shared_mem_map_regions {
u32 mem_map_handle;
/* A memory map handle encapsulating shared memory attributes is
* returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
* successful. In the case of failure , a generic APR error response
* is returned to the client.
*
* Supported Values: - Any 32 bit value
*/
} __packed;
#define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
/* Memory unmap regions command payload used by the
* #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
*
* This structure allows clients to unmap multiple shared memory
* regions in a single command.
*/
struct afe_service_cmd_shared_mem_unmap_regions {
struct apr_hdr hdr;
u32 mem_map_handle;
/* memory map handle returned by
* AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
*
* Supported Values:
* - Any 32 bit value
*/
} __packed;
#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
* which queries for one post/preprocessing parameter of a
* stream.
*/
struct afe_port_cmd_get_param_v2 {
u16 port_id;
/* Port interface and direction (Rx or Tx) to start. */
u16 payload_size;
/* Maximum data size of the parameter ID/module ID combination.
* This is a multiple of four bytes
* Supported values: > 0
*/
u32 payload_address_lsw;
/* LSW of 64 bit Payload address. Address should be 32-byte,
* 4kbyte aligned and must be contig memory.
*/
u32 payload_address_msw;
/* MSW of 64 bit Payload address. In case of 32-bit shared
* memory address, this field must be set to zero. In case of 36-bit
* shared memory address, bit-4 to bit-31 must be set to zero.
* Address should be 32-byte, 4kbyte aligned and must be contiguous
* memory.
*/
u32 mem_map_handle;
/* Memory map handle returned by
* AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
* Supported Values: - NULL -- Message. The parameter data is
* in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
* - the physical address in shared memory of the payload data.
* For detailed payload content, see the afe_port_param_data_v2
* structure
*/
u32 module_id;
/* ID of the module to be queried.
* Supported values: Valid module ID
*/
u32 param_id;
/* ID of the parameter to be queried.
* Supported values: Valid parameter ID
*/
} __packed;
#define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
/* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
* responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
*
* Immediately following this structure is the parameters structure
* (afe_port_param_data) containing the response(acknowledgment)
* parameter payload. This payload is included for an in-band
* scenario. For an address/shared memory-based set parameter, this
* payload is not needed.
*/
struct afe_port_cmdrsp_get_param_v2 {
u32 status;
} __packed;
#define AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG 0x0001028C
#define AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG 0x1
/*
* Payload of the AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG parameter used by
* AFE_MODULE_AUDIO_DEV_INTERFACE.
*/
struct afe_param_id_lpass_core_shared_clk_cfg {
u32 lpass_core_shared_clk_cfg_minor_version;
/*
* Minor version used for lpass core shared clock configuration
* Supported value: AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG
*/
u32 enable;
/*
* Specifies whether the lpass core shared clock is
* enabled (1) or disabled (0).
*/
} __packed;
struct afe_lpass_core_shared_clk_config_command {
struct apr_hdr hdr;
struct afe_port_cmd_set_param_v2 param;
struct afe_port_param_data_v2 pdata;
struct afe_param_id_lpass_core_shared_clk_cfg clk_cfg;
} __packed;
/* adsp_afe_service_commands.h */
#define ADSP_MEMORY_MAP_EBI_POOL 0
#define ADSP_MEMORY_MAP_SMI_POOL 1
#define ADSP_MEMORY_MAP_IMEM_POOL 2
#define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
/*
* Definition of virtual memory flag
*/
#define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
/*
* Definition of physical memory flag
*/
#define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
#define NULL_POPP_TOPOLOGY 0x00010C68
#define NULL_COPP_TOPOLOGY 0x00010312
#define DEFAULT_COPP_TOPOLOGY 0x00010BE3
#define DEFAULT_POPP_TOPOLOGY 0x00010BE4
#define COMPRESSED_PASSTHROUGH_DEFAULT_TOPOLOGY 0x0001076B
#define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
#define VPM_TX_DM_RFECNS_COPP_TOPOLOGY 0x00010F86
#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX 0x10015002
/* Memory map regions command payload used by the
* #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
* commands.
*
* This structure allows clients to map multiple shared memory
* regions in a single command. Following this structure are
* num_regions of avs_shared_map_region_payload.
*/
struct avs_cmd_shared_mem_map_regions {
struct apr_hdr hdr;
u16 mem_pool_id;
/* Type of memory on which this memory region is mapped.
*
* Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
* #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
* (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
* are reserved
*
* The memory ID implicitly defines the characteristics of the
* memory. Characteristics may include alignment type, permissions,
* etc.
*
* SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
*/
u16 num_regions;
/* Number of regions to map.*/
u32 property_flag;
/* Configures one common property for all the regions in the
* payload. No two regions in the same memory map regions cmd can
* have differnt property. Supported values: - 0x00000000 to
* 0x00000001
*
* b0 - bit 0 indicates physical or virtual mapping 0 shared memory
* address provided in avs_shared_map_regions_payload is physical
* address. The shared memory needs to be mapped( hardware TLB
* entry)
*
* and a software entry needs to be added for internal book keeping.
*
* 1 Shared memory address provided in MayPayload[usRegions] is
* virtual address. The shared memory must not be mapped (since
* hardware TLB entry is already available) but a software entry
* needs to be added for internal book keeping. This can be useful
* if two services with in ADSP is communicating via APR. They can
* now directly communicate via the Virtual address instead of
* Physical address. The virtual regions must be contiguous.
*
* b31-b1 - reserved bits. must be set to zero
*/
} __packed;
struct avs_shared_map_region_payload {
u32 shm_addr_lsw;
/* least significant word of shared memory address of the memory
* region to map. It must be contiguous memory, and it must be 4 KB
* aligned.
*/
u32 shm_addr_msw;
/* most significant word of shared memory address of the memory
* region to map. For 32 bit shared memory address, this field must
* tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
* must be set to zero
*/
u32 mem_size_bytes;
/* Number of bytes in the region.
*
* The aDSP will always map the regions as virtual contiguous
* memory, but the memory size must be in multiples of 4 KB to avoid
* gaps in the virtually contiguous mapped memory.
*/
} __packed;
struct avs_cmd_shared_mem_unmap_regions {
struct apr_hdr hdr;
u32 mem_map_handle;
/* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
* , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
*/
} __packed;
/* Memory map command response payload used by the
* #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
* ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
*/
struct avs_cmdrsp_shared_mem_map_regions {
u32 mem_map_handle;
/* A memory map handle encapsulating shared memory attributes is
* returned
*/
} __packed;
/*adsp_audio_memmap_api.h*/
/* ASM related data structures */
struct asm_wma_cfg {
u16 format_tag;
u16 ch_cfg;
u32 sample_rate;
u32 avg_bytes_per_sec;
u16 block_align;
u16 valid_bits_per_sample;
u32 ch_mask;
u16 encode_opt;
u16 adv_encode_opt;
u32 adv_encode_opt2;
u32 drc_peak_ref;
u32 drc_peak_target;
u32 drc_ave_ref;
u32 drc_ave_target;
} __packed;
struct asm_wmapro_cfg {
u16 format_tag;
u16 ch_cfg;
u32 sample_rate;
u32 avg_bytes_per_sec;
u16 block_align;
u16 valid_bits_per_sample;
u32 ch_mask;
u16 encode_opt;
u16 adv_encode_opt;
u32 adv_encode_opt2;
u32 drc_peak_ref;
u32 drc_peak_target;
u32 drc_ave_ref;
u32 drc_ave_target;
} __packed;
struct asm_aac_cfg {
u16 format;
u16 aot;
u16 ep_config;
u16 section_data_resilience;
u16 scalefactor_data_resilience;
u16 spectral_data_resilience;
u16 ch_cfg;
u16 reserved;
u32 sample_rate;
} __packed;
struct asm_amrwbplus_cfg {
u32 size_bytes;
u32 version;
u32 num_channels;
u32 amr_band_mode;
u32 amr_dtx_mode;
u32 amr_frame_fmt;
u32 amr_lsf_idx;
} __packed;
struct asm_flac_cfg {
u32 sample_rate;
u32 ext_sample_rate;
u32 min_frame_size;
u32 max_frame_size;
u16 stream_info_present;
u16 min_blk_size;
u16 max_blk_size;
u16 ch_cfg;
u16 sample_size;
u16 md5_sum;
};
struct asm_softpause_params {
u32 enable;
u32 period;
u32 step;
u32 rampingcurve;
} __packed;
struct asm_softvolume_params {
u32 period;
u32 step;
u32 rampingcurve;
} __packed;
#define ASM_END_POINT_DEVICE_MATRIX 0
#define PCM_CHANNEL_NULL 0
/* Front left channel. */
#define PCM_CHANNEL_FL 1
/* Front right channel. */
#define PCM_CHANNEL_FR 2
/* Front center channel. */
#define PCM_CHANNEL_FC 3
/* Left surround channel.*/
#define PCM_CHANNEL_LS 4
/* Right surround channel.*/
#define PCM_CHANNEL_RS 5
/* Low frequency effect channel. */
#define PCM_CHANNEL_LFE 6
/* Center surround channel; Rear center channel. */
#define PCM_CHANNEL_CS 7
/* Left back channel; Rear left channel. */
#define PCM_CHANNEL_LB 8
/* Right back channel; Rear right channel. */
#define PCM_CHANNEL_RB 9
/* Top surround channel. */
#define PCM_CHANNELS 10
/* Center vertical height channel.*/
#define PCM_CHANNEL_CVH 11
/* Mono surround channel.*/
#define PCM_CHANNEL_MS 12
/* Front left of center. */
#define PCM_CHANNEL_FLC 13
/* Front right of center. */
#define PCM_CHANNEL_FRC 14
/* Rear left of center. */
#define PCM_CHANNEL_RLC 15
/* Rear right of center. */
#define PCM_CHANNEL_RRC 16
#define PCM_FORMAT_MAX_NUM_CHANNEL 8
#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
#define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
#define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
#define ASM_MAX_EQ_BANDS 12
#define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
struct asm_data_cmd_media_fmt_update_v2 {
u32 fmt_blk_size;
/* Media format block size in bytes.*/
} __packed;
struct asm_multi_channel_pcm_fmt_blk_v2 {
struct apr_hdr hdr;
struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
u16 num_channels;
/* Number of channels. Supported values: 1 to 8 */
u16 bits_per_sample;
/* Number of bits per sample per channel. * Supported values:
* 16, 24 * When used for playback, the client must send 24-bit
* samples packed in 32-bit words. The 24-bit samples must be placed
* in the most significant 24 bits of the 32-bit word. When used for
* recording, the aDSP sends 24-bit samples packed in 32-bit words.
* The 24-bit samples are placed in the most significant 24 bits of
* the 32-bit word.
*/
u32 sample_rate;
/* Number of samples per second (in Hertz).
* Supported values: 2000 to 48000
*/
u16 is_signed;
/* Flag that indicates the samples are signed (1). */
u16 reserved;
/* reserved field for 32 bit alignment. must be set to zero. */
u8 channel_mapping[8];
/* Channel array of size 8.
* Supported values:
* - #PCM_CHANNEL_L
* - #PCM_CHANNEL_R
* - #PCM_CHANNEL_C
* - #PCM_CHANNEL_LS
* - #PCM_CHANNEL_RS
* - #PCM_CHANNEL_LFE
* - #PCM_CHANNEL_CS
* - #PCM_CHANNEL_LB
* - #PCM_CHANNEL_RB
* - #PCM_CHANNELS
* - #PCM_CHANNEL_CVH
* - #PCM_CHANNEL_MS
* - #PCM_CHANNEL_FLC
* - #PCM_CHANNEL_FRC
* - #PCM_CHANNEL_RLC
* - #PCM_CHANNEL_RRC
*
* Channel[i] mapping describes channel I. Each element i of the
* array describes channel I inside the buffer where 0 @le I <
* num_channels. An unused channel is set to zero.
*/
} __packed;
struct asm_stream_cmd_set_encdec_param {
u32 param_id;
/* ID of the parameter. */
u32 param_size;
/* Data size of this parameter, in bytes. The size is a multiple
* of 4 bytes.
*/
} __packed;
struct asm_enc_cfg_blk_param_v2 {
u32 frames_per_buf;
/* Number of encoded frames to pack into each buffer.
*
* @note1hang This is only guidance information for the aDSP. The
* number of encoded frames put into each buffer (specified by the
* client) is less than or equal to this number.
*/
u32 enc_cfg_blk_size;
/* Size in bytes of the encoder configuration block that follows
* this member.
*/
} __packed;
/* @brief Dolby Digital Plus end point configuration structure
*/
struct asm_dec_ddp_endp_param_v2 {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
int endp_param_value;
} __packed;
/* @brief Multichannel PCM encoder configuration structure used
* in the #ASM_STREAM_CMD_OPEN_READ_V2 command.
*/
struct asm_multi_channel_pcm_enc_cfg_v2 {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
uint16_t num_channels;
/*< Number of PCM channels.
*
* Supported values: - 0 -- Native mode - 1 -- 8 Native mode
* indicates that encoding must be performed with the number of
* channels at the input.
*/
uint16_t bits_per_sample;
/*< Number of bits per sample per channel.
* Supported values: 16, 24
*/
uint32_t sample_rate;
/*< Number of samples per second (in Hertz).
*
* Supported values: 0, 8000 to 48000 A value of 0 indicates the
* native sampling rate. Encoding is performed at the input sampling
* rate.
*/
uint16_t is_signed;
/*< Specifies whether the samples are signed (1). Currently,
* only signed samples are supported.
*/
uint16_t reserved;
/*< reserved field for 32 bit alignment. must be set to zero.*/
uint8_t channel_mapping[8];
} __packed;
#define ASM_MEDIA_FMT_MP3 0x00010BE9
#define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
/* @xreflabel
* {hdr:AsmMediaFmtDolbyAac} Media format ID for the
* Dolby AAC decoder. This format ID is be used if the client wants
* to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
* contents.
*/
#define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
/* Enumeration for the audio data transport stream AAC format. */
#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
/* Enumeration for low overhead audio stream AAC format. */
#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
/* Enumeration for the audio data interchange format
* AAC format.
*/
#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
/* Enumeration for the raw AAC format. */
#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
#define ASM_MEDIA_FMT_AAC_AOT_LC 2
#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
#define ASM_MEDIA_FMT_AAC_AOT_PS 29
#define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
struct asm_aac_fmt_blk_v2 {
struct apr_hdr hdr;
struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
u16 aac_fmt_flag;
/* Bitstream format option.
* Supported values:
* - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
* - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
* - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
* - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
*/
u16 audio_objype;
/* Audio Object Type (AOT) present in the AAC stream.
* Supported values:
* - #ASM_MEDIA_FMT_AAC_AOT_LC
* - #ASM_MEDIA_FMT_AAC_AOT_SBR
* - #ASM_MEDIA_FMT_AAC_AOT_BSAC
* - #ASM_MEDIA_FMT_AAC_AOT_PS
* - Otherwise -- Not supported
*/
u16 channel_config;
/* Number of channels present in the AAC stream.
* Supported values:
* - 1 -- Mono
* - 2 -- Stereo
* - 6 -- 5.1 content
*/
u16 total_size_of_PCE_bits;
/* greater or equal to zero. * -In case of RAW formats and
* channel config = 0 (PCE), client can send * the bit stream
* containing PCE immediately following this structure * (in-band).
* -This number does not include bits included for 32 bit alignment.
* -If zero, then the PCE info is assumed to be available in the
* audio -bit stream & not in-band.
*/
u32 sample_rate;
/* Number of samples per second (in Hertz).
*
* Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
* 44100, 48000
*
* This field must be equal to the sample rate of the AAC-LC
* decoder's output. - For MP4 or 3GP containers, this is indicated
* by the samplingFrequencyIndex field in the AudioSpecificConfig
* element. - For ADTS format, this is indicated by the
* samplingFrequencyIndex in the ADTS fixed header. - For ADIF
* format, this is indicated by the samplingFrequencyIndex in the
* program_config_element present in the ADIF header.
*/
} __packed;
struct asm_aac_enc_cfg_v2 {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
u32 bit_rate;
/* Encoding rate in bits per second. */
u32 enc_mode;
/* Encoding mode.
* Supported values:
* - #ASM_MEDIA_FMT_AAC_AOT_LC
* - #ASM_MEDIA_FMT_AAC_AOT_SBR
* - #ASM_MEDIA_FMT_AAC_AOT_PS
*/
u16 aac_fmt_flag;
/* AAC format flag.
* Supported values:
* - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
* - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
*/
u16 channel_cfg;
/* Number of channels to encode.
* Supported values:
* - 0 -- Native mode
* - 1 -- Mono
* - 2 -- Stereo
* - Other values are not supported.
* @note1hang The eAAC+ encoder mode supports only stereo.
* Native mode indicates that encoding must be performed with the
* number of channels at the input.
* The number of channels must not change during encoding.
*/
u32 sample_rate;
/* Number of samples per second.
* Supported values: - 0 -- Native mode - For other values,
* Native mode indicates that encoding must be performed with the
* sampling rate at the input.
* The sampling rate must not change during encoding.
*/
} __packed;
struct asm_flac_fmt_blk_v2 {
struct apr_hdr hdr;
struct asm_data_cmd_media_fmt_update_v2 fmtblk;
u16 is_stream_info_present;
/* Specifies whether stream information is present in the FLAC format
* block.
*
* Supported values:
* - 0 -- Stream information is not present in this message
* - 1 -- Stream information is present in this message
*
* When set to 1, the FLAC bitstream was successfully parsed by the
* client, and other fields in the FLAC format block can be read by the
* decoder to get metadata stream information.
*/
u16 num_channels;
/* Number of channels for decoding.
* Supported values: 1 to 2
*/
u16 min_blk_size;
/* Minimum block size (in samples) used in the stream. It must be less
* than or equal to max_blk_size.
*/
u16 max_blk_size;
/* Maximum block size (in samples) used in the stream. If the
* minimum block size equals the maximum block size, a fixed block
* size stream is implied.
*/
u16 md5_sum[8];
/* MD5 signature array of the unencoded audio data. This allows the
* decoder to determine if an error exists in the audio data, even when
* the error does not result in an invalid bitstream.
*/
u32 sample_rate;
/* Number of samples per second.
* Supported values: 8000 to 48000 Hz
*/
u32 min_frame_size;
/* Minimum frame size used in the stream.
* Supported values:
* - > 0 bytes
* - 0 -- The value is unknown
*/
u32 max_frame_size;
/* Maximum frame size used in the stream.
* Supported values:
* -- > 0 bytes
* -- 0 . The value is unknown
*/
u16 sample_size;
/* Bits per sample.Supported values: 8, 16 */
u16 reserved;
/* Clients must set this field to zero
*/
} __packed;
#define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
/* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
/* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
/* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
/* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
/* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
/* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
/* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
/* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
/* Enumeration for AMR-NB Discontinuous Transmission mode off. */
#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
/* Enumeration for AMR-NB DTX mode VAD1. */
#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
/* Enumeration for AMR-NB DTX mode VAD2. */
#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
/* Enumeration for AMR-NB DTX mode auto.
*/
#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
struct asm_amrnb_enc_cfg {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
u16 enc_mode;
/* AMR-NB encoding rate.
* Supported values:
* Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
* macros
*/
u16 dtx_mode;
/* Specifies whether DTX mode is disabled or enabled.
* Supported values:
* - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
* - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
*/
} __packed;
#define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
/* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
/* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
/* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
/* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
/* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
/* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
/* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
/* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
/* Enumeration for 23.85 kbps AMR-WB Encoding mode.
*/
#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
struct asm_amrwb_enc_cfg {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
u16 enc_mode;
/* AMR-WB encoding rate.
* Suupported values:
* Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
* macros
*/
u16 dtx_mode;
/* Specifies whether DTX mode is disabled or enabled.
* Supported values:
* - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
* - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
*/
} __packed;
#define ASM_MEDIA_FMT_V13K_FS 0x00010BED
/* Enumeration for 14.4 kbps V13K Encoding mode. */
#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
/* Enumeration for 12.2 kbps V13K Encoding mode. */
#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
/* Enumeration for 11.2 kbps V13K Encoding mode. */
#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
/* Enumeration for 9.0 kbps V13K Encoding mode. */
#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
/* Enumeration for 7.2 kbps V13K eEncoding mode. */
#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
/* Enumeration for 1/8 vocoder rate.*/
#define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
/* Enumeration for 1/4 vocoder rate. */
#define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
/* Enumeration for 1/2 vocoder rate. */
#define ASM_MEDIA_FMT_VOC_HALF_RATE 3
/* Enumeration for full vocoder rate.
*/
#define ASM_MEDIA_FMT_VOC_FULL_RATE 4
struct asm_v13k_enc_cfg {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
u16 max_rate;
/* Maximum allowed encoder frame rate.
* Supported values:
* - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
* - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
* - #ASM_MEDIA_FMT_VOC_HALF_RATE
* - #ASM_MEDIA_FMT_VOC_FULL_RATE
*/
u16 min_rate;
/* Minimum allowed encoder frame rate.
* Supported values:
* - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
* - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
* - #ASM_MEDIA_FMT_VOC_HALF_RATE
* - #ASM_MEDIA_FMT_VOC_FULL_RATE
*/
u16 reduced_rate_cmd;
/* Reduced rate command, used to change
* the average bitrate of the V13K
* vocoder.
* Supported values:
* - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
* - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
* - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
* - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
* - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
*/
u16 rate_mod_cmd;
/* Rate modulation command. Default = 0.
*- If bit 0=1, rate control is enabled.
*- If bit 1=1, the maximum number of consecutive full rate
* frames is limited with numbers supplied in
* bits 2 to 10.
*- If bit 1=0, the minimum number of non-full rate frames
* in between two full rate frames is forced to
* the number supplied in bits 2 to 10. In both cases, if necessary,
* half rate is used to substitute full rate. - Bits 15 to 10 are
* reserved and must all be set to zero.
*/
} __packed;
#define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
/* EVRC encoder configuration structure used in the
* #ASM_STREAM_CMD_OPEN_READ_V2 command.
*/
struct asm_evrc_enc_cfg {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
u16 max_rate;
/* Maximum allowed encoder frame rate.
* Supported values:
* - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
* - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
* - #ASM_MEDIA_FMT_VOC_HALF_RATE
* - #ASM_MEDIA_FMT_VOC_FULL_RATE
*/
u16 min_rate;
/* Minimum allowed encoder frame rate.
* Supported values:
* - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
* - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
* - #ASM_MEDIA_FMT_VOC_HALF_RATE
* - #ASM_MEDIA_FMT_VOC_FULL_RATE
*/
u16 rate_mod_cmd;
/* Rate modulation command. Default: 0.
* - If bit 0=1, rate control is enabled.
* - If bit 1=1, the maximum number of consecutive full rate frames
* is limited with numbers supplied in bits 2 to 10.
*
* - If bit 1=0, the minimum number of non-full rate frames in
* between two full rate frames is forced to the number supplied in
* bits 2 to 10. In both cases, if necessary, half rate is used to
* substitute full rate.
*
* - Bits 15 to 10 are reserved and must all be set to zero.
*/
u16 reserved;
/* Reserved. Clients must set this field to zero. */
} __packed;
#define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
struct asm_wmaprov10_fmt_blk_v2 {
struct apr_hdr hdr;
struct asm_data_cmd_media_fmt_update_v2 fmtblk;
u16 fmtag;
/* WMA format type.
* Supported values:
* - 0x162 -- WMA 9 Pro
* - 0x163 -- WMA 9 Pro Lossless
* - 0x166 -- WMA 10 Pro
* - 0x167 -- WMA 10 Pro Lossless
*/
u16 num_channels;
/* Number of channels encoded in the input stream.
* Supported values: 1 to 8
*/
u32 sample_rate;
/* Number of samples per second (in Hertz).
* Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
* 88200, 96000
*/
u32 avg_bytes_per_sec;
/* Bitrate expressed as the average bytes per second.
* Supported values: 2000 to 96000
*/
u16 blk_align;
/* Size of the bitstream packet size in bytes. WMA Pro files
* have a payload of one block per bitstream packet.
* Supported values: @le 13376
*/
u16 bits_per_sample;
/* Number of bits per sample in the encoded WMA stream.
* Supported values: 16, 24
*/
u32 channel_mask;
/* Bit-packed double word (32-bits) that indicates the
* recommended speaker positions for each source channel.
*/
u16 enc_options;
/* Bit-packed word with values that indicate whether certain
* features of the bitstream are used.
* Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
* ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
* ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
* ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
*/
u16 usAdvancedEncodeOpt;
/* Advanced encoding option. */
u32 advanced_enc_options2;
/* Advanced encoding option 2. */
} __packed;
#define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
struct asm_wmastdv9_fmt_blk_v2 {
struct apr_hdr hdr;
struct asm_data_cmd_media_fmt_update_v2 fmtblk;
u16 fmtag;
/* WMA format tag.
* Supported values: 0x161 (WMA 9 standard)
*/
u16 num_channels;
/* Number of channels in the stream.
* Supported values: 1, 2
*/
u32 sample_rate;
/* Number of samples per second (in Hertz).
* Supported values: 48000
*/
u32 avg_bytes_per_sec;
/* Bitrate expressed as the average bytes per second. */
u16 blk_align;
/* Block align. All WMA files with a maximum packet size of
* 13376 are supported.
*/
u16 bits_per_sample;
/* Number of bits per sample in the output.
* Supported values: 16
*/
u32 channel_mask;
/* Channel mask.
* Supported values:
* - 3 -- Stereo (front left/front right)
* - 4 -- Mono (center)
*/
u16 enc_options;
/* Options used during encoding. */
u16 reserved;
} __packed;
#define ASM_MEDIA_FMT_WMA_V8 0x00010D91
struct asm_wmastdv8_enc_cfg {
struct apr_hdr hdr;
struct asm_stream_cmd_set_encdec_param encdec;
struct asm_enc_cfg_blk_param_v2 encblk;
u32 bit_rate;
/* Encoding rate in bits per second. */
u32 sample_rate;
/* Number of samples per second.
*
* Supported values:
* - 0 -- Native mode
* - Other Supported values are 22050, 32000, 44100, and 48000.
*
* Native mode indicates that encoding must be performed with the
* sampling rate at the input.
* The sampling rate must not change during encoding.
*/
u16 channel_cfg;
/* Number of channels to encode.
* Supported values:
* - 0 -- Native mode
* - 1 -- Mono
* - 2 -- Stereo
* - Other values are not supported.
*
* Native mode indicates that encoding must be performed with the
* number of channels at the input.
* The number of channels must not change during encoding.
*/
u16 reserved;
/* Reserved. Clients must set this field to zero.*/
} __packed;
#define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
struct asm_amrwbplus_fmt_blk_v2 {
struct apr_hdr hdr;
struct asm_data_cmd_media_fmt_update_v2 fmtblk;
u32 amr_frame_fmt;
/* AMR frame format.
* Supported values:
* - 6 -- Transport Interface Format (TIF)
* - Any other value -- File storage format (FSF)
*
* TIF stream contains 2-byte header for each frame within the
* superframe. FSF stream contains one 2-byte header per superframe.
*/
} __packed;
#define ASM_MEDIA_FMT_AC3_DEC 0x00010BF6
#define ASM_MEDIA_FMT_EAC3_DEC 0x00010C3C
#define ASM_MEDIA_FMT_DTS 0x00010D88
#define ASM_MEDIA_FMT_MP2 0x00010DE9
#define ASM_MEDIA_FMT_FLAC 0x00010C16
/* Media format ID for adaptive transform acoustic coding. This
* ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
* only.
*/
#define ASM_MEDIA_FMT_ATRAC 0x00010D89
/* Media format ID for metadata-enhanced audio transmission.
* This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
* command only.
*/
#define ASM_MEDIA_FMT_MAT 0x00010D8A
/* adsp_media_fmt.h */
#define ASM_DATA_CMD_WRITE_V2 0x00010DAB
struct asm_data_cmd_write_v2 {
struct apr_hdr hdr;
u32 buf_addr_lsw;
/* The 64 bit address msw-lsw should be a valid, mapped address.
* 64 bit address should be a multiple of 32 bytes
*/
u32 buf_addr_msw;
/* The 64 bit address msw-lsw should be a valid, mapped address.
* 64 bit address should be a multiple of 32 bytes.
* -Address of the buffer containing the data to be decoded.
* The buffer should be aligned to a 32 byte boundary.
* -In the case of 32 bit Shared memory address, msw field must
* -be set to zero.
* -In the case of 36 bit shared memory address, bit 31 to bit 4
* -of msw must be set to zero.
*/
u32 mem_map_handle;
/* memory map handle returned by DSP through
* ASM_CMD_SHARED_MEM_MAP_REGIONS command
*/
u32 buf_size;
/* Number of valid bytes available in the buffer for decoding. The
* first byte starts at buf_addr.
*/
u32 seq_id;
/* Optional buffer sequence ID. */
u32 timestamp_lsw;
/* Lower 32 bits of the 64-bit session time in microseconds of the
* first buffer sample.
*/
u32 timestamp_msw;
/* Upper 32 bits of the 64-bit session time in microseconds of the
* first buffer sample.
*/
u32 flags;
/* Bitfield of flags.
* Supported values for bit 31:
* - 1 -- Valid timestamp.
* - 0 -- Invalid timestamp.
* - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
* #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
* Supported values for bit 30:
* - 1 -- Last buffer.
* - 0 -- Not the last buffer.
*
* Supported values for bit 29:
* - 1 -- Continue the timestamp from the previous buffer.
* - 0 -- Timestamp of the current buffer is not related
* to the timestamp of the previous buffer.
* - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
* to set this bit.
*
* Supported values for bit 4:
* - 1 -- End of the frame.
* - 0 -- Not the end of frame, or this information is not known.
* - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
* as the shift value to set this bit.
*
* All other bits are reserved and must be set to 0.
*
* If bit 31=0 and bit 29=1: The timestamp of the first sample in