@@ -276,6 +276,16 @@ static const struct sof_topology_token acpdmic_tokens[] = {
276
276
offsetof(struct sof_ipc_dai_acpdmic_params , pdm_ch )},
277
277
};
278
278
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
+
279
289
/* Core tokens */
280
290
static const struct sof_topology_token core_tokens [] = {
281
291
{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] = {
311
321
[SOF_SAI_TOKENS ] = {"SAI tokens" , sai_tokens , ARRAY_SIZE (sai_tokens )},
312
322
[SOF_AFE_TOKENS ] = {"AFE tokens" , afe_tokens , ARRAY_SIZE (afe_tokens )},
313
323
[SOF_ACPDMIC_TOKENS ] = {"ACPDMIC tokens" , acpdmic_tokens , ARRAY_SIZE (acpdmic_tokens )},
324
+ [SOF_ACPI2S_TOKENS ] = {"ACPI2S tokens" , acpi2s_tokens , ARRAY_SIZE (acpi2s_tokens )},
314
325
};
315
326
316
327
/**
@@ -1193,6 +1204,7 @@ static int sof_link_acp_sp_load(struct snd_soc_component *scomp, struct snd_sof_
1193
1204
struct snd_soc_tplg_hw_config * hw_config = slink -> hw_configs ;
1194
1205
struct sof_dai_private_data * private = dai -> private ;
1195
1206
u32 size = sizeof (* config );
1207
+ int ret ;
1196
1208
1197
1209
/* handle master/slave and inverted clocks */
1198
1210
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_
1201
1213
memset (& config -> acpsp , 0 , sizeof (config -> acpsp ));
1202
1214
config -> hdr .size = size ;
1203
1215
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 ;
1206
1220
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" ,
1208
1223
config -> dai_index , config -> acpsp .tdm_slots ,
1209
- config -> acpsp .fsync_rate );
1224
+ config -> acpsp .fsync_rate , config -> acpsp . tdm_mode );
1210
1225
1211
1226
dai -> number_configs = 1 ;
1212
1227
dai -> current_config = 0 ;
@@ -1223,6 +1238,7 @@ static int sof_link_acp_hs_load(struct snd_soc_component *scomp, struct snd_sof_
1223
1238
struct snd_soc_tplg_hw_config * hw_config = slink -> hw_configs ;
1224
1239
struct sof_dai_private_data * private = dai -> private ;
1225
1240
u32 size = sizeof (* config );
1241
+ int ret ;
1226
1242
1227
1243
/* Configures the DAI hardware format and inverted clocks */
1228
1244
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_
1231
1247
memset (& config -> acphs , 0 , sizeof (config -> acphs ));
1232
1248
config -> hdr .size = size ;
1233
1249
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 ;
1236
1254
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" ,
1238
1256
config -> dai_index , config -> acphs .tdm_slots ,
1239
- config -> acphs .fsync_rate );
1257
+ config -> acphs .fsync_rate , config -> acphs . tdm_mode );
1240
1258
1241
1259
dai -> number_configs = 1 ;
1242
1260
dai -> current_config = 0 ;
@@ -1545,9 +1563,11 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget)
1545
1563
ret = sof_link_acp_bt_load (scomp , slink , config , dai );
1546
1564
break ;
1547
1565
case SOF_DAI_AMD_SP :
1566
+ case SOF_DAI_AMD_SP_VIRTUAL :
1548
1567
ret = sof_link_acp_sp_load (scomp , slink , config , dai );
1549
1568
break ;
1550
1569
case SOF_DAI_AMD_HS :
1570
+ case SOF_DAI_AMD_HS_VIRTUAL :
1551
1571
ret = sof_link_acp_hs_load (scomp , slink , config , dai );
1552
1572
break ;
1553
1573
case SOF_DAI_AMD_DMIC :
0 commit comments