ASoC: meson: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 23 Mar 2020 05:19:32 +0000 (14:19 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 27 Mar 2020 14:44:41 +0000 (14:44 +0000)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87mu87ir6j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/meson/aiu-fifo.c
sound/soc/meson/axg-card.c
sound/soc/meson/axg-fifo.c
sound/soc/meson/meson-card-utils.c

index da8c098e875029ecfe6c6f3a522ba402446eb6a1..d9cede4c33ffc692d07ceceb44e885e9b3545463 100644 (file)
@@ -26,7 +26,7 @@ static struct snd_soc_dai *aiu_fifo_dai(struct snd_pcm_substream *ss)
 {
        struct snd_soc_pcm_runtime *rtd = ss->private_data;
 
-       return rtd->cpu_dai;
+       return asoc_rtd_to_cpu(rtd, 0);
 }
 
 snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component,
index 77a7d5f36ebf6134726b48ebf3d78304cdcaa98d..af46845f4ef2ba184f1d85318cf1a3b17015dce1 100644 (file)
@@ -72,10 +72,10 @@ static int axg_card_tdm_dai_init(struct snd_soc_pcm_runtime *rtd)
                }
        }
 
-       ret = axg_tdm_set_tdm_slots(rtd->cpu_dai, be->tx_mask, be->rx_mask,
+       ret = axg_tdm_set_tdm_slots(asoc_rtd_to_cpu(rtd, 0), be->tx_mask, be->rx_mask,
                                    be->slots, be->slot_width);
        if (ret) {
-               dev_err(rtd->cpu_dai->dev, "setting tdm link slots failed\n");
+               dev_err(asoc_rtd_to_cpu(rtd, 0)->dev, "setting tdm link slots failed\n");
                return ret;
        }
 
@@ -90,10 +90,10 @@ static int axg_card_tdm_dai_lb_init(struct snd_soc_pcm_runtime *rtd)
        int ret;
 
        /* The loopback rx_mask is the pad tx_mask */
-       ret = axg_tdm_set_tdm_slots(rtd->cpu_dai, NULL, be->tx_mask,
+       ret = axg_tdm_set_tdm_slots(asoc_rtd_to_cpu(rtd, 0), NULL, be->tx_mask,
                                    be->slots, be->slot_width);
        if (ret) {
-               dev_err(rtd->cpu_dai->dev, "setting tdm link slots failed\n");
+               dev_err(asoc_rtd_to_cpu(rtd, 0)->dev, "setting tdm link slots failed\n");
                return ret;
        }
 
index c12b0d5e8ebf3ac75b2ec35542ef8a1efd2b207e..2e9b56b29d313103d61a0a4efb4ba5414e409cae 100644 (file)
@@ -47,7 +47,7 @@ static struct snd_soc_dai *axg_fifo_dai(struct snd_pcm_substream *ss)
 {
        struct snd_soc_pcm_runtime *rtd = ss->private_data;
 
-       return rtd->cpu_dai;
+       return asoc_rtd_to_cpu(rtd, 0);
 }
 
 static struct axg_fifo *axg_fifo_data(struct snd_pcm_substream *ss)
index b5d3c9f56bac0bdeeb20e331684b125c302391a0..2ca8c98e204f2bdf5f0d726647d814dce1f20877 100644 (file)
@@ -30,7 +30,7 @@ int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream,
                        return ret;
        }
 
-       ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, 0, mclk,
+       ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), 0, mclk,
                                     SND_SOC_CLOCK_OUT);
        if (ret && ret != -ENOTSUPP)
                return ret;