Commit a4be4187 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc: use for_each_rtd_codecs/cpus_dai() macro

This patch switch to use plural form macro.

	- for_each_rtd_codec_dai()
	+ for_each_rtd_codec_dais()

	- for_each_rtd_codec_dai_rollback()
	+ for_each_rtd_codec_dais_rollback()

	- for_each_rtd_cpu_dai()
	+ for_each_rtd_cpu_dais()

	- for_each_rtd_cpu_dai_rollback()
	+ for_each_rtd_cpu_dais_rollback()
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v9negogr.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c998ee30
...@@ -547,7 +547,7 @@ int snd_soc_suspend(struct device *dev) ...@@ -547,7 +547,7 @@ int snd_soc_suspend(struct device *dev)
if (rtd->dai_link->ignore_suspend) if (rtd->dai_link->ignore_suspend)
continue; continue;
for_each_rtd_codec_dai(rtd, i, dai) { for_each_rtd_codec_dais(rtd, i, dai) {
if (dai->stream_active[playback]) if (dai->stream_active[playback])
snd_soc_dai_digital_mute(dai, 1, playback); snd_soc_dai_digital_mute(dai, 1, playback);
} }
...@@ -689,7 +689,7 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -689,7 +689,7 @@ static void soc_resume_deferred(struct work_struct *work)
if (rtd->dai_link->ignore_suspend) if (rtd->dai_link->ignore_suspend)
continue; continue;
for_each_rtd_codec_dai(rtd, i, dai) { for_each_rtd_codec_dais(rtd, i, dai) {
if (dai->stream_active[playback]) if (dai->stream_active[playback])
snd_soc_dai_digital_mute(dai, 0, playback); snd_soc_dai_digital_mute(dai, 0, playback);
} }
...@@ -1321,10 +1321,10 @@ static void soc_remove_link_dais(struct snd_soc_card *card) ...@@ -1321,10 +1321,10 @@ static void soc_remove_link_dais(struct snd_soc_card *card)
for_each_comp_order(order) { for_each_comp_order(order) {
for_each_card_rtds(card, rtd) { for_each_card_rtds(card, rtd) {
/* remove the CODEC DAI */ /* remove the CODEC DAI */
for_each_rtd_codec_dai(rtd, i, codec_dai) for_each_rtd_codec_dais(rtd, i, codec_dai)
soc_remove_dai(codec_dai, order); soc_remove_dai(codec_dai, order);
for_each_rtd_cpu_dai(rtd, i, cpu_dai) for_each_rtd_cpu_dais(rtd, i, cpu_dai)
soc_remove_dai(cpu_dai, order); soc_remove_dai(cpu_dai, order);
} }
} }
...@@ -1344,14 +1344,14 @@ static int soc_probe_link_dais(struct snd_soc_card *card) ...@@ -1344,14 +1344,14 @@ static int soc_probe_link_dais(struct snd_soc_card *card)
card->name, rtd->num, order); card->name, rtd->num, order);
/* probe the CPU DAI */ /* probe the CPU DAI */
for_each_rtd_cpu_dai(rtd, i, cpu_dai) { for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
ret = soc_probe_dai(cpu_dai, order); ret = soc_probe_dai(cpu_dai, order);
if (ret) if (ret)
return ret; return ret;
} }
/* probe the CODEC DAI */ /* probe the CODEC DAI */
for_each_rtd_codec_dai(rtd, i, codec_dai) { for_each_rtd_codec_dais(rtd, i, codec_dai) {
ret = soc_probe_dai(codec_dai, order); ret = soc_probe_dai(codec_dai, order);
if (ret) if (ret)
return ret; return ret;
...@@ -1486,7 +1486,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd, ...@@ -1486,7 +1486,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
unsigned int i; unsigned int i;
int ret; int ret;
for_each_rtd_codec_dai(rtd, i, codec_dai) { for_each_rtd_codec_dais(rtd, i, codec_dai) {
ret = snd_soc_dai_set_fmt(codec_dai, dai_fmt); ret = snd_soc_dai_set_fmt(codec_dai, dai_fmt);
if (ret != 0 && ret != -ENOTSUPP) { if (ret != 0 && ret != -ENOTSUPP) {
dev_warn(codec_dai->dev, dev_warn(codec_dai->dev,
...@@ -1514,7 +1514,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd, ...@@ -1514,7 +1514,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
inv_dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; inv_dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
break; break;
} }
for_each_rtd_cpu_dai(rtd, i, cpu_dai) { for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
unsigned int fmt = dai_fmt; unsigned int fmt = dai_fmt;
if (cpu_dai->component->driver->non_legacy_dai_naming) if (cpu_dai->component->driver->non_legacy_dai_naming)
......
...@@ -2437,7 +2437,7 @@ static ssize_t dapm_widget_show(struct device *dev, ...@@ -2437,7 +2437,7 @@ static ssize_t dapm_widget_show(struct device *dev,
mutex_lock(&rtd->card->dapm_mutex); mutex_lock(&rtd->card->dapm_mutex);
for_each_rtd_codec_dai(rtd, i, codec_dai) { for_each_rtd_codec_dais(rtd, i, codec_dai) {
struct snd_soc_component *cmpnt = codec_dai->component; struct snd_soc_component *cmpnt = codec_dai->component;
count += dapm_widget_show_component(cmpnt, buf + count); count += dapm_widget_show_component(cmpnt, buf + count);
...@@ -4362,11 +4362,11 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, ...@@ -4362,11 +4362,11 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
int i; int i;
if (rtd->num_cpus == 1) { if (rtd->num_cpus == 1) {
for_each_rtd_codec_dai(rtd, i, codec_dai) for_each_rtd_codec_dais(rtd, i, codec_dai)
dapm_add_valid_dai_widget(card, rtd, codec_dai, dapm_add_valid_dai_widget(card, rtd, codec_dai,
rtd->cpu_dais[0]); rtd->cpu_dais[0]);
} else if (rtd->num_codecs == rtd->num_cpus) { } else if (rtd->num_codecs == rtd->num_cpus) {
for_each_rtd_codec_dai(rtd, i, codec_dai) for_each_rtd_codec_dais(rtd, i, codec_dai)
dapm_add_valid_dai_widget(card, rtd, codec_dai, dapm_add_valid_dai_widget(card, rtd, codec_dai,
rtd->cpu_dais[i]); rtd->cpu_dais[i]);
} else { } else {
...@@ -4437,9 +4437,9 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, ...@@ -4437,9 +4437,9 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
struct snd_soc_dai *cpu_dai; struct snd_soc_dai *cpu_dai;
int i; int i;
for_each_rtd_cpu_dai(rtd, i, cpu_dai) for_each_rtd_cpu_dais(rtd, i, cpu_dai)
soc_dapm_dai_stream_event(cpu_dai, stream, event); soc_dapm_dai_stream_event(cpu_dai, stream, event);
for_each_rtd_codec_dai(rtd, i, codec_dai) for_each_rtd_codec_dais(rtd, i, codec_dai)
soc_dapm_dai_stream_event(codec_dai, stream, event); soc_dapm_dai_stream_event(codec_dai, stream, event);
dapm_power_widgets(rtd->card, event); dapm_power_widgets(rtd->card, event);
......
This diff is collapsed.
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