[PATCH 4/7] ASoC: soc-pcm: Merge for_each_rtd_cpu/codec_dais()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Mar 11 03:06:06 CET 2020


Hi Sridharan

Thank you for reviewing

>     @@ -1319,18 +1219,11 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int
>     cmd)
>      {
>             struct snd_soc_pcm_runtime *rtd = substream->private_data;
>             struct snd_soc_component *component;
>     -       struct snd_soc_dai *cpu_dai;
>     -       struct snd_soc_dai *codec_dai;
>     +       struct snd_soc_dai *dai;
>             int i, ret;
>    
>     -       for_each_rtd_codec_dais(rtd, i, codec_dai) {
>     -               ret = snd_soc_dai_trigger(codec_dai, substream, cmd);
>     -               if (ret < 0)
>     -                       return ret;
>     -       }
>     -
>     -       for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
>     -               ret = snd_soc_dai_trigger(cpu_dai, substream, cmd);
>     +       for_each_rtd_dais(rtd, i, dai) {
> 
> Morimoto-san,
> 
> We are switching the order in which the codec dais and cpu dais are stopped here with this new macro
> no. Does it make a difference? The same comment applies to some other changes as well.
> 
> If the trigger_start() started cpu dais first and then codec dais, do we need to stop in the reverse
> order?

I'm sorry but I didn't mention detail.
Yes, it exchanged the order.

But I'm thinking that the current order was
implemented by just a coincidence,
and I'm hoping hardware doesn't matter order of same layer (= DAI).

Maybe Mark answered already.
https://lore.kernel.org/alsa-devel/20200225014039.GA21366@sirena.org.uk/

But if the order was important for some platform,
we need/should consider "order", like for_each_comp_order().

	for_each_comp_order(order) {
		for_each_rtd_dais(rtd, i, dai, order) {
			...

Thank you for your help !!

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list