@@ -276,6 +276,16 @@ static const struct sof_topology_token acpdmic_tokens[] = {
276276 offsetof(struct sof_ipc_dai_acpdmic_params , pdm_ch )},
277277};
278278
279+ /* ACPI2S */
280+ static const struct sof_topology_token acpi2s_tokens [] = {
281+ {SOF_TKN_AMD_ACPI2S_RATE , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
282+ offsetof(struct sof_ipc_dai_acp_params , fsync_rate )},
283+ {SOF_TKN_AMD_ACPI2S_CH , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
284+ offsetof(struct sof_ipc_dai_acp_params , tdm_slots )},
285+ {SOF_TKN_AMD_ACPI2S_TDM_MODE , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
286+ offsetof(struct sof_ipc_dai_acp_params , tdm_mode )},
287+ };
288+
279289/* Core tokens */
280290static const struct sof_topology_token core_tokens [] = {
281291 {SOF_TKN_COMP_CORE_ID , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
@@ -311,6 +321,7 @@ static const struct sof_token_info ipc3_token_list[SOF_TOKEN_COUNT] = {
311321 [SOF_SAI_TOKENS ] = {"SAI tokens" , sai_tokens , ARRAY_SIZE (sai_tokens )},
312322 [SOF_AFE_TOKENS ] = {"AFE tokens" , afe_tokens , ARRAY_SIZE (afe_tokens )},
313323 [SOF_ACPDMIC_TOKENS ] = {"ACPDMIC tokens" , acpdmic_tokens , ARRAY_SIZE (acpdmic_tokens )},
324+ [SOF_ACPI2S_TOKENS ] = {"ACPI2S tokens" , acpi2s_tokens , ARRAY_SIZE (acpi2s_tokens )},
314325};
315326
316327/**
@@ -1193,6 +1204,7 @@ static int sof_link_acp_sp_load(struct snd_soc_component *scomp, struct snd_sof_
11931204 struct snd_soc_tplg_hw_config * hw_config = slink -> hw_configs ;
11941205 struct sof_dai_private_data * private = dai -> private ;
11951206 u32 size = sizeof (* config );
1207+ int ret ;
11961208
11971209 /* handle master/slave and inverted clocks */
11981210 sof_dai_set_format (hw_config , config );
@@ -1201,12 +1213,15 @@ static int sof_link_acp_sp_load(struct snd_soc_component *scomp, struct snd_sof_
12011213 memset (& config -> acpsp , 0 , sizeof (config -> acpsp ));
12021214 config -> hdr .size = size ;
12031215
1204- config -> acpsp .fsync_rate = le32_to_cpu (hw_config -> fsync_rate );
1205- config -> acpsp .tdm_slots = le32_to_cpu (hw_config -> tdm_slots );
1216+ ret = sof_update_ipc_object (scomp , & config -> acpsp , SOF_ACPI2S_TOKENS , slink -> tuples ,
1217+ slink -> num_tuples , size , slink -> num_hw_configs );
1218+ if (ret < 0 )
1219+ return ret ;
12061220
1207- dev_info (scomp -> dev , "ACP_SP config ACP%d channel %d rate %d\n" ,
1221+
1222+ dev_info (scomp -> dev , "ACP_SP config ACP%d channel %d rate %d tdm_mode %d\n" ,
12081223 config -> dai_index , config -> acpsp .tdm_slots ,
1209- config -> acpsp .fsync_rate );
1224+ config -> acpsp .fsync_rate , config -> acpsp . tdm_mode );
12101225
12111226 dai -> number_configs = 1 ;
12121227 dai -> current_config = 0 ;
@@ -1223,6 +1238,7 @@ static int sof_link_acp_hs_load(struct snd_soc_component *scomp, struct snd_sof_
12231238 struct snd_soc_tplg_hw_config * hw_config = slink -> hw_configs ;
12241239 struct sof_dai_private_data * private = dai -> private ;
12251240 u32 size = sizeof (* config );
1241+ int ret ;
12261242
12271243 /* Configures the DAI hardware format and inverted clocks */
12281244 sof_dai_set_format (hw_config , config );
@@ -1231,12 +1247,14 @@ static int sof_link_acp_hs_load(struct snd_soc_component *scomp, struct snd_sof_
12311247 memset (& config -> acphs , 0 , sizeof (config -> acphs ));
12321248 config -> hdr .size = size ;
12331249
1234- config -> acphs .fsync_rate = le32_to_cpu (hw_config -> fsync_rate );
1235- config -> acphs .tdm_slots = le32_to_cpu (hw_config -> tdm_slots );
1250+ ret = sof_update_ipc_object (scomp , & config -> acphs , SOF_ACPI2S_TOKENS , slink -> tuples ,
1251+ slink -> num_tuples , size , slink -> num_hw_configs );
1252+ if (ret < 0 )
1253+ return ret ;
12361254
1237- dev_info (scomp -> dev , "ACP_HS config ACP%d channel %d rate %d\n" ,
1255+ dev_info (scomp -> dev , "ACP_HS config ACP%d channel %d rate %d tdm_mode %d \n" ,
12381256 config -> dai_index , config -> acphs .tdm_slots ,
1239- config -> acphs .fsync_rate );
1257+ config -> acphs .fsync_rate , config -> acphs . tdm_mode );
12401258
12411259 dai -> number_configs = 1 ;
12421260 dai -> current_config = 0 ;
@@ -1545,9 +1563,11 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget)
15451563 ret = sof_link_acp_bt_load (scomp , slink , config , dai );
15461564 break ;
15471565 case SOF_DAI_AMD_SP :
1566+ case SOF_DAI_AMD_SP_VIRTUAL :
15481567 ret = sof_link_acp_sp_load (scomp , slink , config , dai );
15491568 break ;
15501569 case SOF_DAI_AMD_HS :
1570+ case SOF_DAI_AMD_HS_VIRTUAL :
15511571 ret = sof_link_acp_hs_load (scomp , slink , config , dai );
15521572 break ;
15531573 case SOF_DAI_AMD_DMIC :
0 commit comments