dsp: Add support for META MI2S ports
QCS405 can group data lines of several MI2S interfaces. This feature is used with new META MI2S ports. Change-Id: I0d8c2de742e04d7348e40e1026b1640c3f987479 Signed-off-by: Ralf Herz <rherz@codeaurora.org>
此提交包含在:
18
dsp/q6afe.c
18
dsp/q6afe.c
@@ -915,6 +915,10 @@ int afe_sizeof_cfg_cmd(u16 port_id)
|
|||||||
case AFE_PORT_ID_SENARY_MI2S_TX:
|
case AFE_PORT_ID_SENARY_MI2S_TX:
|
||||||
ret_size = SIZEOF_CFG_CMD(afe_param_id_i2s_cfg);
|
ret_size = SIZEOF_CFG_CMD(afe_param_id_i2s_cfg);
|
||||||
break;
|
break;
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
|
ret_size = SIZEOF_CFG_CMD(afe_param_id_meta_i2s_cfg);
|
||||||
|
break;
|
||||||
case HDMI_RX:
|
case HDMI_RX:
|
||||||
case DISPLAY_PORT_RX:
|
case DISPLAY_PORT_RX:
|
||||||
ret_size =
|
ret_size =
|
||||||
@@ -4556,6 +4560,10 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config,
|
|||||||
case AFE_PORT_ID_INT6_MI2S_TX:
|
case AFE_PORT_ID_INT6_MI2S_TX:
|
||||||
cfg_type = AFE_PARAM_ID_I2S_CONFIG;
|
cfg_type = AFE_PARAM_ID_I2S_CONFIG;
|
||||||
break;
|
break;
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
|
cfg_type = AFE_PARAM_ID_META_I2S_CONFIG;
|
||||||
|
break;
|
||||||
case HDMI_RX:
|
case HDMI_RX:
|
||||||
case DISPLAY_PORT_RX:
|
case DISPLAY_PORT_RX:
|
||||||
cfg_type = AFE_PARAM_ID_HDMI_CONFIG;
|
cfg_type = AFE_PARAM_ID_HDMI_CONFIG;
|
||||||
@@ -5091,6 +5099,10 @@ int afe_get_port_index(u16 port_id)
|
|||||||
return IDX_AFE_PORT_ID_INT6_MI2S_RX;
|
return IDX_AFE_PORT_ID_INT6_MI2S_RX;
|
||||||
case AFE_PORT_ID_INT6_MI2S_TX:
|
case AFE_PORT_ID_INT6_MI2S_TX:
|
||||||
return IDX_AFE_PORT_ID_INT6_MI2S_TX;
|
return IDX_AFE_PORT_ID_INT6_MI2S_TX;
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
return IDX_AFE_PORT_ID_PRIMARY_META_MI2S_RX;
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
|
return IDX_AFE_PORT_ID_SECONDARY_META_MI2S_RX;
|
||||||
case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
|
case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
|
||||||
return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_0;
|
return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_0;
|
||||||
case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
|
case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
|
||||||
@@ -5254,6 +5266,10 @@ int afe_open(u16 port_id,
|
|||||||
case AFE_PORT_ID_SENARY_MI2S_TX:
|
case AFE_PORT_ID_SENARY_MI2S_TX:
|
||||||
cfg_type = AFE_PARAM_ID_I2S_CONFIG;
|
cfg_type = AFE_PARAM_ID_I2S_CONFIG;
|
||||||
break;
|
break;
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
|
cfg_type = AFE_PARAM_ID_META_I2S_CONFIG;
|
||||||
|
break;
|
||||||
case HDMI_RX:
|
case HDMI_RX:
|
||||||
case DISPLAY_PORT_RX:
|
case DISPLAY_PORT_RX:
|
||||||
cfg_type = AFE_PARAM_ID_HDMI_CONFIG;
|
cfg_type = AFE_PARAM_ID_HDMI_CONFIG;
|
||||||
@@ -7231,6 +7247,8 @@ int afe_validate_port(u16 port_id)
|
|||||||
case AFE_PORT_ID_QUINARY_MI2S_TX:
|
case AFE_PORT_ID_QUINARY_MI2S_TX:
|
||||||
case AFE_PORT_ID_SENARY_MI2S_RX:
|
case AFE_PORT_ID_SENARY_MI2S_RX:
|
||||||
case AFE_PORT_ID_SENARY_MI2S_TX:
|
case AFE_PORT_ID_SENARY_MI2S_TX:
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
||||||
|
@@ -337,6 +337,10 @@ int q6audio_get_port_index(u16 port_id)
|
|||||||
return IDX_AFE_PORT_ID_INT6_MI2S_RX;
|
return IDX_AFE_PORT_ID_INT6_MI2S_RX;
|
||||||
case AFE_PORT_ID_INT6_MI2S_TX:
|
case AFE_PORT_ID_INT6_MI2S_TX:
|
||||||
return IDX_AFE_PORT_ID_INT6_MI2S_TX;
|
return IDX_AFE_PORT_ID_INT6_MI2S_TX;
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
return IDX_AFE_PORT_ID_PRIMARY_META_MI2S_RX;
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
|
return IDX_AFE_PORT_ID_SECONDARY_META_MI2S_RX;
|
||||||
case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
|
case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
|
||||||
return IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_0;
|
return IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_0;
|
||||||
case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
|
case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
|
||||||
@@ -487,6 +491,10 @@ int q6audio_get_port_id(u16 port_id)
|
|||||||
return AUDIO_PORT_ID_I2S_RX;
|
return AUDIO_PORT_ID_I2S_RX;
|
||||||
case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
||||||
return AFE_PORT_ID_SECONDARY_MI2S_RX_SD1;
|
return AFE_PORT_ID_SECONDARY_MI2S_RX_SD1;
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
return AFE_PORT_ID_PRIMARY_META_MI2S_RX;
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
|
return AFE_PORT_ID_SECONDARY_META_MI2S_RX;
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
||||||
return AFE_PORT_ID_PRIMARY_TDM_RX;
|
return AFE_PORT_ID_PRIMARY_TDM_RX;
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
||||||
@@ -820,6 +828,8 @@ int q6audio_is_digital_pcm_interface(u16 port_id)
|
|||||||
case AFE_PORT_ID_SECONDARY_MI2S_TX:
|
case AFE_PORT_ID_SECONDARY_MI2S_TX:
|
||||||
case AUDIO_PORT_ID_I2S_RX:
|
case AUDIO_PORT_ID_I2S_RX:
|
||||||
case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
||||||
@@ -1048,6 +1058,8 @@ int q6audio_validate_port(u16 port_id)
|
|||||||
case AFE_PORT_ID_QUINARY_MI2S_RX:
|
case AFE_PORT_ID_QUINARY_MI2S_RX:
|
||||||
case AFE_PORT_ID_QUINARY_MI2S_TX:
|
case AFE_PORT_ID_QUINARY_MI2S_TX:
|
||||||
case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
||||||
|
case AFE_PORT_ID_PRIMARY_META_MI2S_RX:
|
||||||
|
case AFE_PORT_ID_SECONDARY_META_MI2S_RX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
case AFE_PORT_ID_PRIMARY_TDM_RX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
case AFE_PORT_ID_PRIMARY_TDM_TX:
|
||||||
case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
||||||
|
@@ -1505,6 +1505,9 @@ struct adm_cmd_connect_afe_port_v5 {
|
|||||||
/* ID of the senary auxiliary PCM Tx port. */
|
/* ID of the senary auxiliary PCM Tx port. */
|
||||||
#define AFE_PORT_ID_SENARY_PCM_TX 0x103F
|
#define AFE_PORT_ID_SENARY_PCM_TX 0x103F
|
||||||
|
|
||||||
|
#define AFE_PORT_ID_PRIMARY_META_MI2S_RX 0x1300
|
||||||
|
#define AFE_PORT_ID_SECONDARY_META_MI2S_RX 0x1302
|
||||||
|
|
||||||
#define AFE_PORT_ID_PRIMARY_SPDIF_RX 0x5000
|
#define AFE_PORT_ID_PRIMARY_SPDIF_RX 0x5000
|
||||||
#define AFE_PORT_ID_PRIMARY_SPDIF_TX 0x5001
|
#define AFE_PORT_ID_PRIMARY_SPDIF_TX 0x5001
|
||||||
#define AFE_PORT_ID_SECONDARY_SPDIF_RX 0x5002
|
#define AFE_PORT_ID_SECONDARY_SPDIF_RX 0x5002
|
||||||
@@ -2650,6 +2653,98 @@ struct afe_param_id_i2s_cfg {
|
|||||||
/* This field must be set to zero. */
|
/* This field must be set to zero. */
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
/* This param id is used to configure META I2S interface */
|
||||||
|
#define AFE_PARAM_ID_META_I2S_CONFIG 0x000102C5
|
||||||
|
#define AFE_API_VERSION_META_I2S_CONFIG 0x1
|
||||||
|
#define MAX_NUM_I2S_META_PORT_MEMBER_PORTS 4
|
||||||
|
|
||||||
|
/* Payload of the #AFE_PARAM_ID_META_I2S_CONFIG
|
||||||
|
* command's (I2S configuration
|
||||||
|
* parameter).
|
||||||
|
*/
|
||||||
|
struct afe_param_id_meta_i2s_cfg {
|
||||||
|
u32 minor_version;
|
||||||
|
/* Minor version used for tracking the version of the I2S
|
||||||
|
* configuration interface.
|
||||||
|
* Supported values: #AFE_API_VERSION_META_I2S_CONFIG
|
||||||
|
*/
|
||||||
|
|
||||||
|
u16 bit_width;
|
||||||
|
/* Bit width of the sample.
|
||||||
|
* Supported values: 16, 24
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 member_port_id[MAX_NUM_I2S_META_PORT_MEMBER_PORTS];
|
||||||
|
/* Array of member port IDs in this meta device.
|
||||||
|
* Supported values:
|
||||||
|
* - #AFE_PORT_ID_PRIMARY_MI2S_RX
|
||||||
|
* - #AFE_PORT_ID_SECONDARY_MI2S_RX
|
||||||
|
* - #AFE_PORT_ID_TERTIARY_MI2S_RX
|
||||||
|
* - #AFE_PORT_ID_QUATERNY_MI2S_RX
|
||||||
|
* - #AFE_PORT_ID_INVALID
|
||||||
|
*
|
||||||
|
* Fill these values from index 0. Set unused index to AFE_PORT_ID_INVALID.
|
||||||
|
*
|
||||||
|
* Note:
|
||||||
|
* the first member port will act as WS master in case
|
||||||
|
* meta port ws_src is configured as AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL.
|
||||||
|
* In all other cases member ports will act as slave.
|
||||||
|
* This must be considered when HLOS enables the interface clocks
|
||||||
|
*/
|
||||||
|
|
||||||
|
u16 member_port_channel_mode[MAX_NUM_I2S_META_PORT_MEMBER_PORTS];
|
||||||
|
/* I2S lines and multichannel operation per member port.
|
||||||
|
* The sequence matches the sequence in member_port_id,
|
||||||
|
* value will be ignored if member port is set to AFE_PORT_ID_INVALID
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* - #AFE_PORT_I2S_10CHS
|
||||||
|
* - #AFE_PORT_I2S_12CHS
|
||||||
|
* - #AFE_PORT_I2S_14CHS
|
||||||
|
* - #AFE_PORT_I2S_16CHS
|
||||||
|
* - #AFE_PORT_I2S_SD4
|
||||||
|
* - #AFE_PORT_I2S_SD5
|
||||||
|
* - #AFE_PORT_I2S_SD6
|
||||||
|
* - #AFE_PORT_I2S_SD7
|
||||||
|
* - #AFE_PORT_I2S_QUAD45
|
||||||
|
* - #AFE_PORT_I2S_QUAD67
|
||||||
|
* - #AFE_PORT_I2S_8CHS_2
|
||||||
|
*/
|
||||||
|
|
||||||
|
u16 data_format;
|
||||||
|
/* data format
|
||||||
|
* Supported values:
|
||||||
|
* - #LINEAR_PCM_DATA
|
||||||
|
*/
|
||||||
|
u16 reserved;
|
||||||
|
/* This field must be set to zero. */
|
||||||
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This param id is used to configure PCM interface
|
* This param id is used to configure PCM interface
|
||||||
*/
|
*/
|
||||||
@@ -4846,6 +4941,7 @@ struct afe_param_id_cdc_dma_cfg_t {
|
|||||||
union afe_port_config {
|
union afe_port_config {
|
||||||
struct afe_param_id_pcm_cfg pcm;
|
struct afe_param_id_pcm_cfg pcm;
|
||||||
struct afe_param_id_i2s_cfg i2s;
|
struct afe_param_id_i2s_cfg i2s;
|
||||||
|
struct afe_param_id_meta_i2s_cfg meta_i2s;
|
||||||
struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
|
struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
|
||||||
struct afe_param_id_slimbus_cfg slim_sch;
|
struct afe_param_id_slimbus_cfg slim_sch;
|
||||||
struct afe_param_id_rt_proxy_port_cfg rtproxy;
|
struct afe_param_id_rt_proxy_port_cfg rtproxy;
|
||||||
@@ -5663,9 +5759,7 @@ struct asm_softvolume_params {
|
|||||||
/* Left side direct channel. */
|
/* Left side direct channel. */
|
||||||
#define PCM_CHANNEL_LSD 33
|
#define PCM_CHANNEL_LSD 33
|
||||||
|
|
||||||
/* Right side direct channel. Update PCM_MAX_CHMAP_ID when
|
/* Right side direct channel. */
|
||||||
* this list is extended.
|
|
||||||
*/
|
|
||||||
#define PCM_CHANNEL_RSD 34
|
#define PCM_CHANNEL_RSD 34
|
||||||
|
|
||||||
/* Mark unused channel. */
|
/* Mark unused channel. */
|
||||||
@@ -5690,7 +5784,7 @@ struct asm_softvolume_params {
|
|||||||
#define PCM_MAX_CHANNEL_MAP 63
|
#define PCM_MAX_CHANNEL_MAP 63
|
||||||
|
|
||||||
/* Max valid channel map index */
|
/* Max valid channel map index */
|
||||||
#define PCM_MAX_CHMAP_ID PCM_CHANNEL_RSD
|
#define PCM_MAX_CHMAP_ID PCM_MAX_CHANNEL_MAP
|
||||||
|
|
||||||
#define PCM_FORMAT_MAX_NUM_CHANNEL 8
|
#define PCM_FORMAT_MAX_NUM_CHANNEL 8
|
||||||
#define PCM_FORMAT_MAX_CHANNELS_9 9
|
#define PCM_FORMAT_MAX_CHANNELS_9 9
|
||||||
|
@@ -281,6 +281,9 @@ enum {
|
|||||||
IDX_AFE_PORT_ID_SENARY_TDM_TX_6,
|
IDX_AFE_PORT_ID_SENARY_TDM_TX_6,
|
||||||
IDX_AFE_PORT_ID_SENARY_TDM_RX_7,
|
IDX_AFE_PORT_ID_SENARY_TDM_RX_7,
|
||||||
IDX_AFE_PORT_ID_SENARY_TDM_TX_7,
|
IDX_AFE_PORT_ID_SENARY_TDM_TX_7,
|
||||||
|
/* IDX 208-> 209 */
|
||||||
|
IDX_AFE_PORT_ID_PRIMARY_META_MI2S_RX,
|
||||||
|
IDX_AFE_PORT_ID_SECONDARY_META_MI2S_RX,
|
||||||
AFE_MAX_PORTS
|
AFE_MAX_PORTS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
新增問題並參考
封鎖使用者