@@ -262,6 +262,17 @@ static const struct sof_topology_token afe_tokens[] = {
262262 offsetof(struct sof_ipc_dai_mtk_afe_params , format )},
263263};
264264
265+
266+ /* ACPDMIC */
267+ static const struct sof_topology_token acpdmic_tokens [] = {
268+ {SOF_TKN_AMD_ACPDMIC_RATE ,
269+ SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
270+ offsetof(struct sof_ipc_dai_acpdmic_params , pdm_rate )},
271+ {SOF_TKN_AMD_ACPDMIC_CH ,
272+ SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
273+ offsetof(struct sof_ipc_dai_acpdmic_params , pdm_ch )},
274+ };
275+
265276/* Core tokens */
266277static const struct sof_topology_token core_tokens [] = {
267278 {SOF_TKN_COMP_CORE_ID , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
@@ -296,6 +307,7 @@ static const struct sof_token_info ipc3_token_list[SOF_TOKEN_COUNT] = {
296307 [SOF_ESAI_TOKENS ] = {"ESAI tokens" , esai_tokens , ARRAY_SIZE (esai_tokens )},
297308 [SOF_SAI_TOKENS ] = {"SAI tokens" , sai_tokens , ARRAY_SIZE (sai_tokens )},
298309 [SOF_AFE_TOKENS ] = {"AFE tokens" , afe_tokens , ARRAY_SIZE (afe_tokens )},
310+ [SOF_ACPDMIC_TOKENS ] = {"ACPDMIC tokens" , acpdmic_tokens , ARRAY_SIZE (acpdmic_tokens )},
299311};
300312
301313/**
@@ -1104,20 +1116,22 @@ static int sof_link_acp_dmic_load(struct snd_soc_component *scomp, struct snd_so
11041116 struct snd_soc_tplg_hw_config * hw_config = slink -> hw_configs ;
11051117 struct sof_dai_private_data * private = dai -> private ;
11061118 u32 size = sizeof (* config );
1119+ int ret ;
11071120
11081121 /* handle master/slave and inverted clocks */
11091122 sof_dai_set_format (hw_config , config );
11101123
1111- /* init IPC */
1112- memset (& config -> acpdmic , 0 , sizeof (config -> acpdmic ));
11131124 config -> hdr .size = size ;
11141125
1115- config -> acpdmic .fsync_rate = le32_to_cpu (hw_config -> fsync_rate );
1116- config -> acpdmic .tdm_slots = le32_to_cpu (hw_config -> tdm_slots );
1126+ /* parse the required set of ACPDMIC tokens based on num_hw_cfgs */
1127+ ret = sof_update_ipc_object (scomp , & config -> acpdmic , SOF_ACPDMIC_TOKENS , slink -> tuples ,
1128+ slink -> num_tuples , size , slink -> num_hw_configs );
1129+ if (ret < 0 )
1130+ return ret ;
11171131
11181132 dev_info (scomp -> dev , "ACP_DMIC config ACP%d channel %d rate %d\n" ,
1119- config -> dai_index , config -> acpdmic .tdm_slots ,
1120- config -> acpdmic .fsync_rate );
1133+ config -> dai_index , config -> acpdmic .pdm_ch ,
1134+ config -> acpdmic .pdm_rate );
11211135
11221136 dai -> number_configs = 1 ;
11231137 dai -> current_config = 0 ;
0 commit comments