dsp: add quinary interface support in q6afe

Add support for quinary interfaces in q6afe. Also,
fix routing for quinary tdm rx port.

Change-Id: I5db68da1cc8bc17bc5e7b743282abf83fb100bbc
Signed-off-by: Rohit Kumar <rohitkr@codeaurora.org>
This commit is contained in:
Rohit Kumar 2017-10-06 10:52:17 +05:30
parent caa1b4241c
commit c08b14f78c
3 changed files with 103 additions and 4 deletions

View file

@ -16533,7 +16533,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUIN_TDM_RX_0 Port Mixer", "QUIN_TDM_TX_1", "QUIN_TDM_TX_1"},
{"QUIN_TDM_RX_0 Port Mixer", "QUIN_TDM_TX_2", "QUIN_TDM_TX_2"},
{"QUIN_TDM_RX_0 Port Mixer", "QUIN_TDM_TX_3", "QUIN_TDM_TX_3"},
{"QUIN_TDM_RX_0", NULL, "QUAT_TDM_RX_0 Port Mixer"},
{"QUIN_TDM_RX_0", NULL, "QUIN_TDM_RX_0 Port Mixer"},
{"QUIN_TDM_RX_1 Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"QUIN_TDM_RX_1 Port Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
@ -16555,7 +16555,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUIN_TDM_RX_1 Port Mixer", "QUIN_TDM_TX_1", "QUIN_TDM_TX_1"},
{"QUIN_TDM_RX_1 Port Mixer", "QUIN_TDM_TX_2", "QUIN_TDM_TX_2"},
{"QUIN_TDM_RX_1 Port Mixer", "QUIN_TDM_TX_3", "QUIN_TDM_TX_3"},
{"QUIN_TDM_RX_1", NULL, "QUAT_TDM_RX_1 Port Mixer"},
{"QUIN_TDM_RX_1", NULL, "QUIN_TDM_RX_1 Port Mixer"},
{"QUIN_TDM_RX_2 Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"QUIN_TDM_RX_2 Port Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
@ -16577,7 +16577,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUIN_TDM_RX_2 Port Mixer", "QUIN_TDM_TX_1", "QUIN_TDM_TX_1"},
{"QUIN_TDM_RX_2 Port Mixer", "QUIN_TDM_TX_2", "QUIN_TDM_TX_2"},
{"QUIN_TDM_RX_2 Port Mixer", "QUIN_TDM_TX_3", "QUIN_TDM_TX_3"},
{"QUIN_TDM_RX_2", NULL, "QUAT_TDM_RX_2 Port Mixer"},
{"QUIN_TDM_RX_2", NULL, "QUIN_TDM_RX_2 Port Mixer"},
{"QUIN_TDM_RX_3 Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"QUIN_TDM_RX_3 Port Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
@ -16599,7 +16599,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUIN_TDM_RX_3 Port Mixer", "QUIN_TDM_TX_1", "QUIN_TDM_TX_1"},
{"QUIN_TDM_RX_3 Port Mixer", "QUIN_TDM_TX_2", "QUIN_TDM_TX_2"},
{"QUIN_TDM_RX_3 Port Mixer", "QUIN_TDM_TX_3", "QUIN_TDM_TX_3"},
{"QUIN_TDM_RX_3", NULL, "QUAT_TDM_RX_3 Port Mixer"},
{"QUIN_TDM_RX_3", NULL, "QUIN_TDM_RX_3 Port Mixer"},
{"INT0_MI2S_RX Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"INT0_MI2S_RX Port Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},

View file

@ -495,6 +495,7 @@ int afe_get_port_type(u16 port_id)
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:
@ -527,6 +528,14 @@ int afe_get_port_type(u16 port_id)
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:
@ -566,6 +575,7 @@ int afe_get_port_type(u16 port_id)
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:
@ -598,6 +608,14 @@ int afe_get_port_type(u16 port_id)
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:
@ -685,6 +703,8 @@ int afe_sizeof_cfg_cmd(u16 port_id)
case AFE_PORT_ID_TERTIARY_PCM_TX:
case AFE_PORT_ID_QUATERNARY_PCM_RX:
case AFE_PORT_ID_QUATERNARY_PCM_TX:
case AFE_PORT_ID_QUINARY_PCM_RX:
case AFE_PORT_ID_QUINARY_PCM_TX:
default:
pr_debug("%s: default case 0x%x\n", __func__, port_id);
ret_size = SIZEOF_CFG_CMD(afe_param_id_pcm_cfg);
@ -3071,6 +3091,8 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config,
case AFE_PORT_ID_TERTIARY_PCM_TX:
case AFE_PORT_ID_QUATERNARY_PCM_RX:
case AFE_PORT_ID_QUATERNARY_PCM_TX:
case AFE_PORT_ID_QUINARY_PCM_RX:
case AFE_PORT_ID_QUINARY_PCM_TX:
cfg_type = AFE_PARAM_ID_PCM_CONFIG;
break;
case PRIMARY_I2S_RX:
@ -3288,6 +3310,10 @@ int afe_get_port_index(u16 port_id)
return IDX_AFE_PORT_ID_QUATERNARY_PCM_RX;
case AFE_PORT_ID_QUATERNARY_PCM_TX:
return IDX_AFE_PORT_ID_QUATERNARY_PCM_TX;
case AFE_PORT_ID_QUINARY_PCM_RX:
return IDX_AFE_PORT_ID_QUINARY_PCM_RX;
case AFE_PORT_ID_QUINARY_PCM_TX:
return IDX_AFE_PORT_ID_QUINARY_PCM_TX;
case SECONDARY_I2S_RX: return IDX_SECONDARY_I2S_RX;
case SECONDARY_I2S_TX: return IDX_SECONDARY_I2S_TX;
case MI2S_RX: return IDX_MI2S_RX;
@ -3481,6 +3507,38 @@ int afe_get_port_index(u16 port_id)
return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_7;
case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_7;
case AFE_PORT_ID_QUINARY_TDM_RX:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_0;
case AFE_PORT_ID_QUINARY_TDM_TX:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_0;
case AFE_PORT_ID_QUINARY_TDM_RX_1:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_1;
case AFE_PORT_ID_QUINARY_TDM_TX_1:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_1;
case AFE_PORT_ID_QUINARY_TDM_RX_2:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_2;
case AFE_PORT_ID_QUINARY_TDM_TX_2:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_2;
case AFE_PORT_ID_QUINARY_TDM_RX_3:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_3;
case AFE_PORT_ID_QUINARY_TDM_TX_3:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_3;
case AFE_PORT_ID_QUINARY_TDM_RX_4:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_4;
case AFE_PORT_ID_QUINARY_TDM_TX_4:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_4;
case AFE_PORT_ID_QUINARY_TDM_RX_5:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_5;
case AFE_PORT_ID_QUINARY_TDM_TX_5:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_5;
case AFE_PORT_ID_QUINARY_TDM_RX_6:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_6;
case AFE_PORT_ID_QUINARY_TDM_TX_6:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_6;
case AFE_PORT_ID_QUINARY_TDM_RX_7:
return IDX_AFE_PORT_ID_QUINARY_TDM_RX_7;
case AFE_PORT_ID_QUINARY_TDM_TX_7:
return IDX_AFE_PORT_ID_QUINARY_TDM_TX_7;
case AFE_PORT_ID_INT0_MI2S_RX:
return IDX_AFE_PORT_ID_INT0_MI2S_RX;
case AFE_PORT_ID_INT0_MI2S_TX:
@ -3597,6 +3655,8 @@ int afe_open(u16 port_id,
case AFE_PORT_ID_TERTIARY_PCM_TX:
case AFE_PORT_ID_QUATERNARY_PCM_RX:
case AFE_PORT_ID_QUATERNARY_PCM_TX:
case AFE_PORT_ID_QUINARY_PCM_RX:
case AFE_PORT_ID_QUINARY_PCM_TX:
cfg_type = AFE_PARAM_ID_PCM_CONFIG;
break;
case SECONDARY_I2S_RX:
@ -3980,6 +4040,8 @@ int afe_port_group_set_param(u16 group_id,
case AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX:
case AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX:
case AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX:
case AFE_GROUP_DEVICE_ID_QUINARY_TDM_RX:
case AFE_GROUP_DEVICE_ID_QUINARY_TDM_TX:
cfg_type = AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG;
break;
default:
@ -5262,6 +5324,8 @@ int afe_validate_port(u16 port_id)
case AFE_PORT_ID_TERTIARY_PCM_TX:
case AFE_PORT_ID_QUATERNARY_PCM_RX:
case AFE_PORT_ID_QUATERNARY_PCM_TX:
case AFE_PORT_ID_QUINARY_PCM_RX:
case AFE_PORT_ID_QUINARY_PCM_TX:
case SECONDARY_I2S_RX:
case SECONDARY_I2S_TX:
case MI2S_RX:
@ -5376,6 +5440,22 @@ int afe_validate_port(u16 port_id)
case AFE_PORT_ID_QUATERNARY_TDM_TX_6:
case AFE_PORT_ID_QUATERNARY_TDM_RX_7:
case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
case AFE_PORT_ID_QUINARY_TDM_RX:
case AFE_PORT_ID_QUINARY_TDM_TX:
case AFE_PORT_ID_QUINARY_TDM_RX_1:
case AFE_PORT_ID_QUINARY_TDM_TX_1:
case AFE_PORT_ID_QUINARY_TDM_RX_2:
case AFE_PORT_ID_QUINARY_TDM_TX_2:
case AFE_PORT_ID_QUINARY_TDM_RX_3:
case AFE_PORT_ID_QUINARY_TDM_TX_3:
case AFE_PORT_ID_QUINARY_TDM_RX_4:
case AFE_PORT_ID_QUINARY_TDM_TX_4:
case AFE_PORT_ID_QUINARY_TDM_RX_5:
case AFE_PORT_ID_QUINARY_TDM_TX_5:
case AFE_PORT_ID_QUINARY_TDM_RX_6:
case AFE_PORT_ID_QUINARY_TDM_TX_6:
case AFE_PORT_ID_QUINARY_TDM_RX_7:
case AFE_PORT_ID_QUINARY_TDM_TX_7:
case AFE_PORT_ID_INT0_MI2S_RX:
case AFE_PORT_ID_INT1_MI2S_RX:
case AFE_PORT_ID_INT2_MI2S_RX:

View file

@ -205,6 +205,25 @@ enum {
IDX_AFE_PORT_ID_INT5_MI2S_TX,
IDX_AFE_PORT_ID_INT6_MI2S_RX,
IDX_AFE_PORT_ID_INT6_MI2S_TX,
/* IDX 143-> 160 */
IDX_AFE_PORT_ID_QUINARY_PCM_RX,
IDX_AFE_PORT_ID_QUINARY_PCM_TX,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_0,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_0,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_1,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_1,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_2,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_2,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_3,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_3,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_4,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_4,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_5,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_5,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_6,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_6,
IDX_AFE_PORT_ID_QUINARY_TDM_RX_7,
IDX_AFE_PORT_ID_QUINARY_TDM_TX_7,
AFE_MAX_PORTS
};