@@ -101,20 +101,29 @@ static int plug_aif_in_out(snd_sof_plug_t *plug, int dir)
101101 if (ret < 0 )
102102 return ret ;
103103
104- comp_info -> ipc_payload = calloc (sizeof (struct ipc4_base_module_cfg ), 1 );
104+ comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg ) + sizeof (struct sof_uuid );
105+ comp_info -> ipc_payload = calloc (comp_info -> ipc_size , 1 );
105106 if (!comp_info -> ipc_payload )
106107 return - ENOMEM ;
107108
108- comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg );
109-
110109 if (dir == SOF_IPC_STREAM_PLAYBACK ) {
110+ struct sof_uuid uuid = {.a = 0xe2b6031c , .b = 0x47e8 , .c = 0x11ed ,
111+ .d = { 0x07 , 0xa9 , 0x7f , 0x80 , 0x1b , 0x6e , 0xfa , 0x6c }};
111112 comp_info -> module_id = 0x96 ;
112113 plug_setup_widget_ipc_msg (comp_info );
114+ comp_info -> uuid = uuid ;
113115 } else {
116+ struct sof_uuid uuid = {.a = 0xdabe8814 , .b = 0x47e8 , .c = 0x11ed ,
117+ .d = { 0xa5 , 0x8b , 0xb3 , 0x09 , 0x97 , 0x4f , 0xec , 0xce }};
114118 comp_info -> module_id = 0x98 ;
115119 plug_setup_widget_ipc_msg (comp_info );
120+ comp_info -> uuid = uuid ;
116121 }
117122
123+ /* copy uuid to the end of the payload */
124+ memcpy (comp_info -> ipc_payload + sizeof (struct ipc4_base_module_cfg ), & comp_info -> uuid ,
125+ sizeof (struct sof_uuid ));
126+
118127 return 0 ;
119128}
120129
@@ -128,20 +137,31 @@ static int plug_dai_in_out(snd_sof_plug_t *plug, int dir)
128137 if (ret < 0 )
129138 return ret ;
130139
131- comp_info -> ipc_payload = calloc (sizeof (struct ipc4_base_module_cfg ), 1 );
140+ comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg ) + sizeof (struct sof_uuid );
141+ comp_info -> ipc_payload = calloc (comp_info -> ipc_size , 1 );
132142 if (!comp_info -> ipc_payload )
133143 return - ENOMEM ;
134144
135- comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg );
136-
137145 if (dir == SOF_IPC_STREAM_PLAYBACK ) {
146+ struct sof_uuid uuid = {.a = 0x72cee996 , .b = 0x39f2 , .c = 0x11ed ,
147+ .d = { 0xa0 , 0x8f , 0x97 , 0xfc , 0xc4 , 0x2e , 0xaa , 0xeb }};
148+
138149 comp_info -> module_id = 0x97 ;
139150 plug_setup_widget_ipc_msg (comp_info );
151+ comp_info -> uuid = uuid ;
140152 } else {
153+ struct sof_uuid uuid = {.a = 0x66def9f0 , .b = 0x39f2 , .c = 0x11ed ,
154+ .d = { 0xf7 , 0x89 , 0xaf , 0x98 , 0xa6 , 0x44 , 0x0c , 0xc4 }};
155+
141156 comp_info -> module_id = 0x99 ;
142157 plug_setup_widget_ipc_msg (comp_info );
158+ comp_info -> uuid = uuid ;
143159 }
144160
161+ /* copy uuid to the end of the payload */
162+ memcpy (comp_info -> ipc_payload + sizeof (struct ipc4_base_module_cfg ), & comp_info -> uuid ,
163+ sizeof (struct sof_uuid ));
164+
145165 return 0 ;
146166}
147167
@@ -210,7 +230,7 @@ static int plug_new_mixer(snd_sof_plug_t *plug)
210230 return - ENOMEM ;
211231
212232 comp_info -> instance_id = plug -> instance_ids [SND_SOC_TPLG_DAPM_MIXER ]++ ;
213- comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg );
233+ comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg ) + sizeof ( struct sof_uuid ) ;
214234 comp_info -> ipc_payload = calloc (comp_info -> ipc_size , 1 );
215235 if (!comp_info -> ipc_payload )
216236 return - ENOMEM ;
@@ -229,6 +249,10 @@ static int plug_new_mixer(snd_sof_plug_t *plug)
229249 comp_info -> module_id = 0x3 ;
230250 plug_setup_widget_ipc_msg (comp_info );
231251 }
252+
253+ /* copy uuid to the end of the payload */
254+ memcpy (comp_info -> ipc_payload + sizeof (struct ipc4_base_module_cfg ), & comp_info -> uuid ,
255+ sizeof (struct sof_uuid ));
232256out :
233257 free (tplg_ctl );
234258 return ret ;
@@ -240,10 +264,13 @@ static int plug_new_pga(snd_sof_plug_t *plug)
240264 struct tplg_comp_info * comp_info = ctx -> current_comp_info ;
241265 struct ipc4_peak_volume_config volume ;
242266 struct snd_soc_tplg_ctl_hdr * tplg_ctl ;
267+ uint32_t uuid_offset ;
243268 int ret ;
244269
245- comp_info -> ipc_size =
246- sizeof (struct ipc4_peak_volume_config ) + sizeof (struct ipc4_base_module_cfg );
270+ comp_info -> ipc_size = sizeof (struct ipc4_peak_volume_config );
271+ comp_info -> ipc_size += sizeof (struct ipc4_base_module_cfg );
272+ uuid_offset = comp_info -> ipc_size ;
273+ comp_info -> ipc_size += sizeof (struct sof_uuid );
247274 comp_info -> ipc_payload = calloc (comp_info -> ipc_size , 1 );
248275 if (!comp_info -> ipc_payload )
249276 return - ENOMEM ;
@@ -269,6 +296,9 @@ static int plug_new_pga(snd_sof_plug_t *plug)
269296 memcpy (comp_info -> ipc_payload + sizeof (struct ipc4_base_module_cfg ),
270297 & volume , sizeof (struct ipc4_peak_volume_config ));
271298
299+ /* copy uuid to the end of the payload */
300+ memcpy (comp_info -> ipc_payload + uuid_offset , & comp_info -> uuid , sizeof (struct sof_uuid ));
301+
272302 /* skip kcontrols for now */
273303 if (tplg_create_controls (ctx , ctx -> widget -> num_kcontrols ,
274304 tplg_ctl , ctx -> hdr -> payload_size , comp_info ) < 0 ) {
@@ -302,7 +332,7 @@ static int plug_new_process(snd_sof_plug_t *plug)
302332 return ret ;
303333
304334 /* only base config supported for now. extn support will be added later */
305- comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg );
335+ comp_info -> ipc_size = sizeof (struct ipc4_base_module_cfg ) + sizeof ( struct sof_uuid ) ;
306336 comp_info -> ipc_payload = calloc (comp_info -> ipc_size , 1 );
307337 if (!comp_info -> ipc_payload )
308338 return - ENOMEM ;
@@ -319,6 +349,10 @@ static int plug_new_process(snd_sof_plug_t *plug)
319349 return - ENOMEM ;
320350 }
321351
352+ /* copy uuid to the end of the payload */
353+ memcpy (comp_info -> ipc_payload + sizeof (struct ipc4_base_module_cfg ), & comp_info -> uuid ,
354+ sizeof (struct sof_uuid ));
355+
322356 /* set up kcontrols */
323357 ret = tplg_create_controls (ctx , ctx -> widget -> num_kcontrols ,
324358 tplg_ctl , ctx -> hdr -> payload_size , comp_info );
0 commit comments