Skip to contentSkip to conversation

soc_pcm_trigger

DISCUSSION ccku 2 participants 2 messages Jul 2, 2009 – Jul 4, 2009

lore
Share & tools
lore

ccku

author
#0 lore raw

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;
}
#1 lore raw
Quoted 2 lines · ccku

why not give machine a chance to run its trigger?? like machine->ops->trigger.

No great reason, mostly there's just never been any use for one.