@@ -643,15 +643,15 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi)
643643}
644644
645645static int intel_params_stream (struct sdw_intel * sdw ,
646- int stream ,
646+ struct snd_pcm_substream * substream ,
647647 struct snd_soc_dai * dai ,
648648 struct snd_pcm_hw_params * hw_params ,
649649 int link_id , int alh_stream_id )
650650{
651651 struct sdw_intel_link_res * res = sdw -> link_res ;
652652 struct sdw_intel_stream_params_data params_data ;
653653
654- params_data .stream = stream ; /* direction */
654+ params_data .substream = substream ;
655655 params_data .dai = dai ;
656656 params_data .hw_params = hw_params ;
657657 params_data .link_id = link_id ;
@@ -663,25 +663,6 @@ static int intel_params_stream(struct sdw_intel *sdw,
663663 return - EIO ;
664664}
665665
666- static int intel_free_stream (struct sdw_intel * sdw ,
667- int stream ,
668- struct snd_soc_dai * dai ,
669- int link_id )
670- {
671- struct sdw_intel_link_res * res = sdw -> link_res ;
672- struct sdw_intel_stream_free_data free_data ;
673-
674- free_data .stream = stream ; /* direction */
675- free_data .dai = dai ;
676- free_data .link_id = link_id ;
677-
678- if (res -> ops && res -> ops -> free_stream && res -> dev )
679- return res -> ops -> free_stream (res -> dev ,
680- & free_data );
681-
682- return 0 ;
683- }
684-
685666/*
686667 * DAI routines
687668 */
@@ -728,7 +709,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
728709 dai_runtime -> hw_params = params ;
729710
730711 /* Inform DSP about PDI stream number */
731- ret = intel_params_stream (sdw , substream -> stream , dai , params ,
712+ ret = intel_params_stream (sdw , substream , dai , params ,
732713 sdw -> instance ,
733714 pdi -> intel_alh_id );
734715 if (ret )
@@ -800,7 +781,7 @@ static int intel_prepare(struct snd_pcm_substream *substream,
800781 sdw_cdns_config_stream (cdns , ch , dir , dai_runtime -> pdi );
801782
802783 /* Inform DSP about PDI stream number */
803- ret = intel_params_stream (sdw , substream -> stream , dai ,
784+ ret = intel_params_stream (sdw , substream , dai ,
804785 dai_runtime -> hw_params ,
805786 sdw -> instance ,
806787 dai_runtime -> pdi -> intel_alh_id );
@@ -813,7 +794,6 @@ static int
813794intel_hw_free (struct snd_pcm_substream * substream , struct snd_soc_dai * dai )
814795{
815796 struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
816- struct sdw_intel * sdw = cdns_to_intel (cdns );
817797 struct sdw_cdns_dai_runtime * dai_runtime ;
818798 int ret ;
819799
@@ -834,12 +814,6 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
834814 return ret ;
835815 }
836816
837- ret = intel_free_stream (sdw , substream -> stream , dai , sdw -> instance );
838- if (ret < 0 ) {
839- dev_err (dai -> dev , "intel_free_stream: failed %d\n" , ret );
840- return ret ;
841- }
842-
843817 dai_runtime -> hw_params = NULL ;
844818 dai_runtime -> pdi = NULL ;
845819
@@ -868,19 +842,9 @@ static void *intel_get_sdw_stream(struct snd_soc_dai *dai,
868842static int intel_trigger (struct snd_pcm_substream * substream , int cmd , struct snd_soc_dai * dai )
869843{
870844 struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
871- struct sdw_intel * sdw = cdns_to_intel (cdns );
872- struct sdw_intel_link_res * res = sdw -> link_res ;
873845 struct sdw_cdns_dai_runtime * dai_runtime ;
874846 int ret = 0 ;
875847
876- /*
877- * The .trigger callback is used to send required IPC to audio
878- * firmware. The .free_stream callback will still be called
879- * by intel_free_stream() in the TRIGGER_SUSPEND case.
880- */
881- if (res -> ops && res -> ops -> trigger )
882- res -> ops -> trigger (dai , cmd , substream -> stream );
883-
884848 dai_runtime = cdns -> dai_runtime_array [dai -> id ];
885849 if (!dai_runtime ) {
886850 dev_err (dai -> dev , "failed to get dai runtime in %s\n" ,
@@ -900,7 +864,6 @@ static int intel_trigger(struct snd_pcm_substream *substream, int cmd, struct sn
900864
901865 dai_runtime -> suspended = true;
902866
903- ret = intel_free_stream (sdw , substream -> stream , dai , sdw -> instance );
904867 break ;
905868
906869 case SNDRV_PCM_TRIGGER_PAUSE_PUSH :
@@ -946,9 +909,7 @@ static int intel_component_dais_suspend(struct snd_soc_component *component)
946909 */
947910 for_each_component_dais (component , dai ) {
948911 struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
949- struct sdw_intel * sdw = cdns_to_intel (cdns );
950912 struct sdw_cdns_dai_runtime * dai_runtime ;
951- int ret ;
952913
953914 dai_runtime = cdns -> dai_runtime_array [dai -> id ];
954915
@@ -958,13 +919,8 @@ static int intel_component_dais_suspend(struct snd_soc_component *component)
958919 if (dai_runtime -> suspended )
959920 continue ;
960921
961- if (dai_runtime -> paused ) {
922+ if (dai_runtime -> paused )
962923 dai_runtime -> suspended = true;
963-
964- ret = intel_free_stream (sdw , dai_runtime -> direction , dai , sdw -> instance );
965- if (ret < 0 )
966- return ret ;
967- }
968924 }
969925
970926 return 0 ;
0 commit comments