[alsa-devel] soc_pcm_trigger
ccku
ccku1025 at gmail.com
Thu Jul 2 05:35:24 CEST 2009
Hi,
in soc-core.c ,soc_pcm_trigger(),
The function only calls three sub-functions
codec_dai->ops->trigger
platform->pcm_ops->trigger
cpu_dai->ops->trigger
why not give machine a chance to run its trigger??
like machine->ops->trigger.
Thanks
static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_device *socdev = rtd->socdev;
struct snd_soc_dai_link *machine = rtd->dai;
struct snd_soc_card *card = socdev->card;
struct snd_soc_platform *platform = card->platform;
struct snd_soc_dai *cpu_dai = machine->cpu_dai;
struct snd_soc_dai *codec_dai = machine->codec_dai;
struct snd_soc_codec *codec = card->codec;
mutex_lock(&pcm_mutex);
/* apply codec digital mute */
if (!codec->active)
snd_soc_dai_digital_mute(codec_dai, 1);
/* free any machine hw params */
if (machine->ops && machine->ops->hw_free)
machine->ops->hw_free(substream);
/* free any DMA resources */
if (platform->pcm_ops->hw_free)
platform->pcm_ops->hw_free(substream);
/* now free hw params for the DAI's */
if (codec_dai->ops->hw_free)
codec_dai->ops->hw_free(substream, codec_dai);
if (cpu_dai->ops->hw_free)
cpu_dai->ops->hw_free(substream, cpu_dai);
mutex_unlock(&pcm_mutex);
return 0;
}
More information about the Alsa-devel
mailing list