|
@@ -575,183 +575,17 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv)
|
|
|
*
|
|
|
* @port_id: AFE Port ID number
|
|
|
*
|
|
|
- * Returns RX/TX type on success or -EINVAL on failure.
|
|
|
+ * Returns RX/TX type.
|
|
|
*/
|
|
|
int afe_get_port_type(u16 port_id)
|
|
|
{
|
|
|
- int ret;
|
|
|
+ int ret = MSM_AFE_PORT_TYPE_RX;
|
|
|
|
|
|
- switch (port_id) {
|
|
|
- case PRIMARY_I2S_RX:
|
|
|
- case SECONDARY_I2S_RX:
|
|
|
- case MI2S_RX:
|
|
|
- case HDMI_RX:
|
|
|
- case DISPLAY_PORT_RX:
|
|
|
- case AFE_PORT_ID_SPDIF_RX:
|
|
|
- case SLIMBUS_0_RX:
|
|
|
- case SLIMBUS_1_RX:
|
|
|
- case SLIMBUS_2_RX:
|
|
|
- case SLIMBUS_3_RX:
|
|
|
- case SLIMBUS_4_RX:
|
|
|
- case SLIMBUS_5_RX:
|
|
|
- case SLIMBUS_6_RX:
|
|
|
- case SLIMBUS_7_RX:
|
|
|
- case SLIMBUS_8_RX:
|
|
|
- case INT_BT_SCO_RX:
|
|
|
- case INT_BT_A2DP_RX:
|
|
|
- case INT_FM_RX:
|
|
|
- case VOICE_PLAYBACK_TX:
|
|
|
- case VOICE2_PLAYBACK_TX:
|
|
|
- case RT_PROXY_PORT_001_RX:
|
|
|
- case AUDIO_PORT_ID_I2S_RX:
|
|
|
- case AFE_PORT_ID_PRIMARY_MI2S_RX:
|
|
|
- case AFE_PORT_ID_SECONDARY_MI2S_RX:
|
|
|
- case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
|
|
|
- case AFE_PORT_ID_TERTIARY_MI2S_RX:
|
|
|
- case AFE_PORT_ID_QUATERNARY_MI2S_RX:
|
|
|
- case AFE_PORT_ID_QUINARY_MI2S_RX:
|
|
|
- case AFE_PORT_ID_PRIMARY_PCM_RX:
|
|
|
- case AFE_PORT_ID_SECONDARY_PCM_RX:
|
|
|
- case AFE_PORT_ID_TERTIARY_PCM_RX:
|
|
|
- case AFE_PORT_ID_QUATERNARY_PCM_RX:
|
|
|
- case AFE_PORT_ID_QUINARY_PCM_RX:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_1:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_2:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_3:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_4:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_5:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_6:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_RX_7:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_1:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_2:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_3:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_4:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_5:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_6:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_RX_7:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_1:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_2:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_3:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_4:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_5:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_6:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_RX_7:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_1:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_2:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_3:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_4:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_5:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_6:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_RX_7:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_1:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_2:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_3:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_4:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_5:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_6:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_RX_7:
|
|
|
- case AFE_PORT_ID_USB_RX:
|
|
|
- case AFE_PORT_ID_INT0_MI2S_RX:
|
|
|
- case AFE_PORT_ID_INT1_MI2S_RX:
|
|
|
- case AFE_PORT_ID_INT2_MI2S_RX:
|
|
|
- case AFE_PORT_ID_INT3_MI2S_RX:
|
|
|
- case AFE_PORT_ID_INT4_MI2S_RX:
|
|
|
- case AFE_PORT_ID_INT5_MI2S_RX:
|
|
|
- case AFE_PORT_ID_INT6_MI2S_RX:
|
|
|
- ret = MSM_AFE_PORT_TYPE_RX;
|
|
|
- break;
|
|
|
-
|
|
|
- case PRIMARY_I2S_TX:
|
|
|
- case SECONDARY_I2S_TX:
|
|
|
- case MI2S_TX:
|
|
|
- case DIGI_MIC_TX:
|
|
|
- case VOICE_RECORD_TX:
|
|
|
- case SLIMBUS_0_TX:
|
|
|
- case SLIMBUS_1_TX:
|
|
|
- case SLIMBUS_2_TX:
|
|
|
- case SLIMBUS_3_TX:
|
|
|
- case SLIMBUS_4_TX:
|
|
|
- case SLIMBUS_5_TX:
|
|
|
- case SLIMBUS_6_TX:
|
|
|
- case SLIMBUS_7_TX:
|
|
|
- case SLIMBUS_8_TX:
|
|
|
- case INT_FM_TX:
|
|
|
- case VOICE_RECORD_RX:
|
|
|
- case INT_BT_SCO_TX:
|
|
|
- case RT_PROXY_PORT_001_TX:
|
|
|
- case AFE_PORT_ID_PRIMARY_MI2S_TX:
|
|
|
- case AFE_PORT_ID_SECONDARY_MI2S_TX:
|
|
|
- case AFE_PORT_ID_TERTIARY_MI2S_TX:
|
|
|
- case AFE_PORT_ID_QUATERNARY_MI2S_TX:
|
|
|
- case AFE_PORT_ID_QUINARY_MI2S_TX:
|
|
|
- case AFE_PORT_ID_SENARY_MI2S_TX:
|
|
|
- case AFE_PORT_ID_PRIMARY_PCM_TX:
|
|
|
- case AFE_PORT_ID_SECONDARY_PCM_TX:
|
|
|
- case AFE_PORT_ID_TERTIARY_PCM_TX:
|
|
|
- case AFE_PORT_ID_QUATERNARY_PCM_TX:
|
|
|
- case AFE_PORT_ID_QUINARY_PCM_TX:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_1:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_2:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_3:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_4:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_5:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_6:
|
|
|
- case AFE_PORT_ID_PRIMARY_TDM_TX_7:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_1:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_2:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_3:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_4:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_5:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_6:
|
|
|
- case AFE_PORT_ID_SECONDARY_TDM_TX_7:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_1:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_2:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_3:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_4:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_5:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_6:
|
|
|
- case AFE_PORT_ID_TERTIARY_TDM_TX_7:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_1:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_2:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_3:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_4:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_5:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_6:
|
|
|
- case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_1:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_2:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_3:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_4:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_5:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_6:
|
|
|
- case AFE_PORT_ID_QUINARY_TDM_TX_7:
|
|
|
- case AFE_PORT_ID_USB_TX:
|
|
|
- case AFE_PORT_ID_INT0_MI2S_TX:
|
|
|
- case AFE_PORT_ID_INT1_MI2S_TX:
|
|
|
- case AFE_PORT_ID_INT2_MI2S_TX:
|
|
|
- case AFE_PORT_ID_INT3_MI2S_TX:
|
|
|
- case AFE_PORT_ID_INT4_MI2S_TX:
|
|
|
- case AFE_PORT_ID_INT5_MI2S_TX:
|
|
|
- case AFE_PORT_ID_INT6_MI2S_TX:
|
|
|
+ /* Odd numbered ports are TX and Rx are Even numbered */
|
|
|
+ if (port_id & 0x1)
|
|
|
ret = MSM_AFE_PORT_TYPE_TX;
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- WARN_ON(1);
|
|
|
- pr_err("%s: Invalid port id = 0x%x\n",
|
|
|
- __func__, port_id);
|
|
|
- ret = -EINVAL;
|
|
|
- }
|
|
|
+ else
|
|
|
+ ret = MSM_AFE_PORT_TYPE_RX;
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
@@ -815,6 +649,15 @@ int afe_sizeof_cfg_cmd(u16 port_id)
|
|
|
case AFE_PORT_ID_USB_TX:
|
|
|
ret_size = SIZEOF_CFG_CMD(afe_param_id_usb_audio_cfg);
|
|
|
break;
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
|
|
|
+ case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
|
|
|
+ case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
|
|
|
+ ret_size = SIZEOF_CFG_CMD(afe_param_id_cdc_dma_cfg_t);
|
|
|
+ break;
|
|
|
case AFE_PORT_ID_PRIMARY_PCM_RX:
|
|
|
case AFE_PORT_ID_PRIMARY_PCM_TX:
|
|
|
case AFE_PORT_ID_SECONDARY_PCM_RX:
|
|
@@ -3554,6 +3397,15 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config,
|
|
|
case INT_FM_TX:
|
|
|
cfg_type = AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG;
|
|
|
break;
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
|
|
|
+ case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
|
|
|
+ case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
|
|
|
+ cfg_type = AFE_PARAM_ID_CODEC_DMA_CONFIG;
|
|
|
+ break;
|
|
|
default:
|
|
|
pr_err("%s: Invalid port id 0x%x\n", __func__, port_id);
|
|
|
ret = -EINVAL;
|
|
@@ -4113,6 +3965,15 @@ int afe_open(u16 port_id,
|
|
|
case AFE_PORT_ID_USB_TX:
|
|
|
cfg_type = AFE_PARAM_ID_USB_AUDIO_CONFIG;
|
|
|
break;
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
|
|
|
+ case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
|
|
|
+ case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
|
|
|
+ case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
|
|
|
+ cfg_type = AFE_PARAM_ID_CODEC_DMA_CONFIG;
|
|
|
+ break;
|
|
|
default:
|
|
|
pr_err("%s: Invalid port id 0x%x\n",
|
|
|
__func__, port_id);
|