@@ -209,7 +209,7 @@ static bool is_any_ppl_active(void)
209209 * ERROR Stop EOS |______\ SAVE
210210 * /
211211 */
212- static int set_pipeline_state (uint32_t id , uint32_t cmd , bool * delayed , uint32_t * ppl_status )
212+ static int set_pipeline_state (uint32_t id , uint32_t cmd , bool * delayed )
213213{
214214 struct ipc_comp_dev * pcm_dev ;
215215 struct ipc_comp_dev * host = NULL ;
@@ -227,7 +227,6 @@ static int set_pipeline_state(uint32_t id, uint32_t cmd, bool *delayed, uint32_t
227227 }
228228
229229 status = pcm_dev -> pipeline -> status ;
230- * ppl_status = status ;
231230 /* source & sink components are set when pipeline is set to COMP_STATE_INIT */
232231 if (status != COMP_STATE_INIT ) {
233232 int host_id ;
@@ -277,7 +276,6 @@ static int set_pipeline_state(uint32_t id, uint32_t cmd, bool *delayed, uint32_t
277276 if (ret < 0 )
278277 ret = IPC4_INVALID_REQUEST ;
279278
280- * ppl_status = COMP_STATE_READY ;
281279 return ret ;
282280 case COMP_STATE_READY :
283281 /* initialized -> pause -> reset */
@@ -313,7 +311,6 @@ static int set_pipeline_state(uint32_t id, uint32_t cmd, bool *delayed, uint32_t
313311 if (ret < 0 )
314312 ret = IPC4_INVALID_REQUEST ;
315313
316- * ppl_status = COMP_STATE_READY ;
317314 return ret ;
318315 case COMP_STATE_READY :
319316 case COMP_STATE_PAUSED :
@@ -344,7 +341,6 @@ static int set_pipeline_state(uint32_t id, uint32_t cmd, bool *delayed, uint32_t
344341 ret = 0 ;
345342 }
346343
347- * ppl_status = host -> cd -> pipeline -> status ;
348344 return ret ;
349345}
350346
@@ -405,75 +401,10 @@ static int ipc_wait_for_compound_msg(void)
405401 return IPC4_SUCCESS ;
406402}
407403
408- /* In ipc3 path, host driver sends pcm_hw_param message to fw and
409- * direction is included. The direction is set to each component
410- * after pipeline is complete. In ipc4 path, direction is figured out and
411- * set it to each component after connected pipeline are complete.
412- */
413- static int update_dir_to_pipeline_component (const uint32_t * ppl_id , uint32_t count )
414- {
415- struct ipc_comp_dev * icd ;
416- struct ipc_comp_dev * pipe ;
417- struct comp_dev * dir_src = NULL ;
418- struct list_item * clist ;
419- struct ipc * ipc ;
420- uint32_t i ;
421-
422- ipc = ipc_get ();
423-
424- for (i = 0 ; i < count ; i ++ ) {
425- pipe = ipc_get_comp_by_ppl_id (ipc , COMP_TYPE_PIPELINE , ppl_id [i ]);
426- if (!pipe ) {
427- tr_info (& ipc_tr , "ppl_id %u: no pipeline is found" , ppl_id [i ]);
428- continue ;
429- }
430-
431- if (pipe -> pipeline -> source_comp -> direction_set ) {
432- dir_src = pipe -> pipeline -> source_comp ;
433- break ;
434- } else if (pipe -> pipeline -> sink_comp -> direction_set ) {
435- dir_src = pipe -> pipeline -> sink_comp ;
436- break ;
437- }
438- }
439- if (!dir_src ) {
440- tr_err (& ipc_tr , "no direction source in pipeline" );
441- return IPC4_INVALID_RESOURCE_STATE ;
442- }
443-
444- /* set direction to the component in the pipeline array */
445- list_for_item (clist , & ipc -> comp_list ) {
446- icd = container_of (clist , struct ipc_comp_dev , list );
447- if (icd -> type != COMP_TYPE_COMPONENT )
448- continue ;
449-
450- for (i = 0 ; i < count ; i ++ ) {
451- if (ipc_comp_pipe_id (icd ) == ppl_id [i ]) {
452- struct comp_dev * dev = icd -> cd ;
453-
454- /* don't update direction for host & dai since they
455- * have direction. Especially in dai copier to dai copier
456- * case the direction can't be modified to single value
457- * since one of them is for playback and the other one
458- * is for capture
459- */
460- if (dev -> direction_set )
461- break ;
462-
463- icd -> cd -> direction = dir_src -> direction ;
464- break ;
465- }
466- }
467- }
468-
469- return 0 ;
470- }
471-
472404static int ipc4_set_pipeline_state (struct ipc4_message_request * ipc4 )
473405{
474406 const struct ipc4_pipeline_set_state_data * ppl_data ;
475407 struct ipc4_pipeline_set_state state ;
476- uint32_t status = COMP_STATE_INIT ;
477408 uint32_t cmd , ppl_count , id ;
478409 const uint32_t * ppl_id ;
479410 int ret = 0 ;
@@ -501,17 +432,13 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4)
501432 bool delayed = false;
502433
503434 ipc_compound_pre_start (state .primary .r .type );
504- ret = set_pipeline_state (ppl_id [i ], cmd , & delayed , & status );
435+ ret = set_pipeline_state (ppl_id [i ], cmd , & delayed );
505436 ipc_compound_post_start (state .primary .r .type , ret , delayed );
506437
507438 if (ret != 0 )
508439 return ret ;
509440 }
510441
511- /* update direction after all connected pipelines are complete */
512- if (status == COMP_STATE_READY )
513- ret = update_dir_to_pipeline_component (ppl_id , ppl_count );
514-
515442 return ret ;
516443}
517444
0 commit comments