Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: soc-dai: add snd_soc_dai_mute_is_ctrled_at_trigger()

Adds snd_soc_dai_mute_is_ctrled_at_trigger() to judge
dai->driver->ops->mute_unmute_on_trigger flags

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/871pva6hs2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
5d5eceb9 7a2ff051

+13 -5
+1 -1
include/sound/soc-dai.h
··· 193 193 /* Digital Audio Interface mute */ 194 194 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, 195 195 int direction); 196 - 196 + int snd_soc_dai_mute_is_ctrled_at_trigger(struct snd_soc_dai *dai); 197 197 198 198 int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai, 199 199 unsigned int *tx_num, unsigned int *tx_slot,
+10 -2
sound/soc/soc-dai.c
··· 364 364 } 365 365 EXPORT_SYMBOL_GPL(snd_soc_dai_prepare); 366 366 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 + 367 375 /** 368 376 * snd_soc_dai_digital_mute - configure DAI system or master clock. 369 377 * @dai: DAI ··· 628 620 if (ret < 0) 629 621 break; 630 622 631 - if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) 623 + if (snd_soc_dai_mute_is_ctrled_at_trigger(dai)) 632 624 snd_soc_dai_digital_mute(dai, 0, substream->stream); 633 625 634 626 soc_dai_mark_push(dai, substream, trigger); ··· 641 633 if (rollback && !soc_dai_mark_match(dai, substream, trigger)) 642 634 continue; 643 635 644 - if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) 636 + if (snd_soc_dai_mute_is_ctrled_at_trigger(dai)) 645 637 snd_soc_dai_digital_mute(dai, 1, substream->stream); 646 638 647 639 r = soc_dai_trigger(dai, substream, cmd);
+2 -2
sound/soc/soc-pcm.c
··· 949 949 SND_SOC_DAPM_STREAM_START); 950 950 951 951 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)) 953 953 snd_soc_dai_digital_mute(dai, 0, substream->stream); 954 954 } 955 955 ··· 1007 1007 soc_pcm_set_dai_params(dai, NULL); 1008 1008 1009 1009 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)) 1011 1011 snd_soc_dai_digital_mute(dai, 1, substream->stream); 1012 1012 } 1013 1013 }