File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ int snd_soc_dai_prepare(struct snd_soc_dai *dai,
193193/* Digital Audio Interface mute */
194194int snd_soc_dai_digital_mute (struct snd_soc_dai * dai , int mute ,
195195 int direction );
196-
196+ int snd_soc_dai_mute_is_ctrled_at_trigger ( struct snd_soc_dai * dai );
197197
198198int snd_soc_dai_get_channel_map (const struct snd_soc_dai * dai ,
199199 unsigned int * tx_num , unsigned int * tx_slot ,
Original file line number Diff line number Diff line change @@ -364,6 +364,14 @@ int snd_soc_dai_prepare(struct snd_soc_dai *dai,
364364}
365365EXPORT_SYMBOL_GPL (snd_soc_dai_prepare );
366366
367+ int snd_soc_dai_mute_is_ctrled_at_trigger (struct snd_soc_dai * dai )
368+ {
369+ if (dai -> driver -> ops )
370+ return dai -> driver -> ops -> mute_unmute_on_trigger ;
371+
372+ return 0 ;
373+ }
374+
367375/**
368376 * snd_soc_dai_digital_mute - configure DAI system or master clock.
369377 * @dai: DAI
@@ -620,7 +628,7 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
620628 if (ret < 0 )
621629 break ;
622630
623- if (dai -> driver -> ops && dai -> driver -> ops -> mute_unmute_on_trigger )
631+ if (snd_soc_dai_mute_is_ctrled_at_trigger ( dai ) )
624632 snd_soc_dai_digital_mute (dai , 0 , substream -> stream );
625633
626634 soc_dai_mark_push (dai , substream , trigger );
@@ -633,7 +641,7 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
633641 if (rollback && !soc_dai_mark_match (dai , substream , trigger ))
634642 continue ;
635643
636- if (dai -> driver -> ops && dai -> driver -> ops -> mute_unmute_on_trigger )
644+ if (snd_soc_dai_mute_is_ctrled_at_trigger ( dai ) )
637645 snd_soc_dai_digital_mute (dai , 1 , substream -> stream );
638646
639647 r = soc_dai_trigger (dai , substream , cmd );
Original file line number Diff line number Diff line change @@ -949,7 +949,7 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd,
949949 SND_SOC_DAPM_STREAM_START );
950950
951951 for_each_rtd_dais (rtd , i , dai ) {
952- if (dai -> driver -> ops && ! dai -> driver -> ops -> mute_unmute_on_trigger )
952+ if (! snd_soc_dai_mute_is_ctrled_at_trigger ( dai ) )
953953 snd_soc_dai_digital_mute (dai , 0 , substream -> stream );
954954 }
955955
@@ -1007,7 +1007,7 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd,
10071007 soc_pcm_set_dai_params (dai , NULL );
10081008
10091009 if (snd_soc_dai_stream_active (dai , substream -> stream ) == 1 ) {
1010- if (dai -> driver -> ops && ! dai -> driver -> ops -> mute_unmute_on_trigger )
1010+ if (! snd_soc_dai_mute_is_ctrled_at_trigger ( dai ) )
10111011 snd_soc_dai_digital_mute (dai , 1 , substream -> stream );
10121012 }
10131013 }
You can’t perform that action at this time.
0 commit comments