@@ -1152,28 +1152,37 @@ int ipc4_find_dma_config_multiple(struct ipc_config_dai *dai, uint8_t *data_buff
11521152 return IPC4_INVALID_REQUEST ;
11531153}
11541154
1155- void ipc4_base_module_cfg_to_stream_params (const struct ipc4_base_module_cfg * base_cfg ,
1156- struct sof_ipc_stream_params * params )
1155+ void ipc4_audio_format_to_stream_params (const struct ipc4_audio_format * audio_fmt ,
1156+ struct sof_ipc_stream_params * params )
11571157{
11581158 enum sof_ipc_frame frame_fmt , valid_fmt ;
11591159 int i ;
11601160
11611161 memset (params , 0 , sizeof (struct sof_ipc_stream_params ));
1162- params -> channels = base_cfg -> audio_fmt .channels_count ;
1163- params -> rate = base_cfg -> audio_fmt .sampling_frequency ;
1164- params -> sample_container_bytes = base_cfg -> audio_fmt .depth / 8 ;
1165- params -> sample_valid_bytes = base_cfg -> audio_fmt .valid_bit_depth / 8 ;
1166- params -> buffer_fmt = base_cfg -> audio_fmt .interleaving_style ;
1167- params -> buffer .size = base_cfg -> obs * 2 ;
1168-
1169- audio_stream_fmt_conversion (base_cfg -> audio_fmt .depth ,
1170- base_cfg -> audio_fmt .valid_bit_depth ,
1162+ params -> channels = audio_fmt -> channels_count ;
1163+ params -> rate = audio_fmt -> sampling_frequency ;
1164+ params -> sample_container_bytes = audio_fmt -> depth / 8 ;
1165+ params -> sample_valid_bytes = audio_fmt -> valid_bit_depth / 8 ;
1166+ params -> buffer_fmt = audio_fmt -> interleaving_style ;
1167+
1168+ audio_stream_fmt_conversion (audio_fmt -> depth ,
1169+ audio_fmt -> valid_bit_depth ,
11711170 & frame_fmt , & valid_fmt ,
1172- base_cfg -> audio_fmt . s_type );
1171+ audio_fmt -> s_type );
11731172 params -> frame_fmt = frame_fmt ;
11741173
11751174 for (i = 0 ; i < SOF_IPC_MAX_CHANNELS ; i ++ )
1176- params -> chmap [i ] = (base_cfg -> audio_fmt .ch_map >> i * 4 ) & 0xf ;
1175+ params -> chmap [i ] = (audio_fmt -> ch_map >> i * 4 ) & 0xf ;
1176+ }
1177+ EXPORT_SYMBOL (ipc4_audio_format_to_stream_params );
1178+
1179+ void ipc4_base_module_cfg_to_stream_params (const struct ipc4_base_module_cfg * base_cfg ,
1180+ struct sof_ipc_stream_params * params )
1181+ {
1182+ memset (params , 0 , sizeof (struct sof_ipc_stream_params ));
1183+ params -> buffer .size = base_cfg -> obs * 2 ;
1184+
1185+ ipc4_audio_format_to_stream_params (& base_cfg -> audio_fmt , params );
11771186}
11781187EXPORT_SYMBOL (ipc4_base_module_cfg_to_stream_params );
11791188
0 commit comments