@@ -668,6 +668,24 @@ static int intel_params_stream(struct sdw_intel *sdw,
668
668
* DAI routines
669
669
*/
670
670
671
+ static int intel_free_stream (struct sdw_intel * sdw ,
672
+ struct snd_pcm_substream * substream ,
673
+ struct snd_soc_dai * dai ,
674
+ int link_id )
675
+ {
676
+ struct sdw_intel_link_res * res = sdw -> link_res ;
677
+ struct sdw_intel_stream_free_data free_data ;
678
+
679
+ free_data .substream = substream ;
680
+ free_data .dai = dai ;
681
+ free_data .link_id = link_id ;
682
+
683
+ if (res -> ops && res -> ops -> free_stream && res -> dev )
684
+ return res -> ops -> free_stream (res -> dev , & free_data );
685
+
686
+ return 0 ;
687
+ }
688
+
671
689
static int intel_hw_params (struct snd_pcm_substream * substream ,
672
690
struct snd_pcm_hw_params * params ,
673
691
struct snd_soc_dai * dai )
@@ -799,6 +817,7 @@ static int
799
817
intel_hw_free (struct snd_pcm_substream * substream , struct snd_soc_dai * dai )
800
818
{
801
819
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
820
+ struct sdw_intel * sdw = cdns_to_intel (cdns );
802
821
struct sdw_cdns_dai_runtime * dai_runtime ;
803
822
int ret ;
804
823
@@ -819,6 +838,12 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
819
838
return ret ;
820
839
}
821
840
841
+ ret = intel_free_stream (sdw , substream , dai , sdw -> instance );
842
+ if (ret < 0 ) {
843
+ dev_err (dai -> dev , "intel_free_stream: failed %d\n" , ret );
844
+ return ret ;
845
+ }
846
+
822
847
dai_runtime -> pdi = NULL ;
823
848
824
849
return 0 ;
0 commit comments