Commit 385a5c60 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: meson: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87mu87ir6j.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c8ac8212
...@@ -26,7 +26,7 @@ static struct snd_soc_dai *aiu_fifo_dai(struct snd_pcm_substream *ss) ...@@ -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; 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, snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component,
......
...@@ -72,10 +72,10 @@ static int axg_card_tdm_dai_init(struct snd_soc_pcm_runtime *rtd) ...@@ -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); be->slots, be->slot_width);
if (ret) { 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; return ret;
} }
...@@ -90,10 +90,10 @@ static int axg_card_tdm_dai_lb_init(struct snd_soc_pcm_runtime *rtd) ...@@ -90,10 +90,10 @@ static int axg_card_tdm_dai_lb_init(struct snd_soc_pcm_runtime *rtd)
int ret; int ret;
/* The loopback rx_mask is the pad tx_mask */ /* 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); be->slots, be->slot_width);
if (ret) { 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; return ret;
} }
......
...@@ -47,7 +47,7 @@ static struct snd_soc_dai *axg_fifo_dai(struct snd_pcm_substream *ss) ...@@ -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; 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) static struct axg_fifo *axg_fifo_data(struct snd_pcm_substream *ss)
......
...@@ -30,7 +30,7 @@ int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream, ...@@ -30,7 +30,7 @@ int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream,
return ret; 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); SND_SOC_CLOCK_OUT);
if (ret && ret != -ENOTSUPP) if (ret && ret != -ENOTSUPP)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment