[PATCH v2 5/6] ASoC: meson: gx-card: add support for audin FIFO
Valerio Setti
vsetti at baylibre.com
Thu Sep 17 14:02:35 PDT 2026
Slightly modify "gx_card_cpu_identify()" by making the compatible matching
string an input parameter. This allows to easily support also AUDIN's FIFO
with minimal changes.
Signed-off-by: Valerio Setti <vsetti at baylibre.com>
---
sound/soc/meson/gx-card.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/sound/soc/meson/gx-card.c b/sound/soc/meson/gx-card.c
index 932be0a09306..35bc47254752 100644
--- a/sound/soc/meson/gx-card.c
+++ b/sound/soc/meson/gx-card.c
@@ -66,10 +66,10 @@ static int gx_card_parse_i2s(struct snd_soc_card *card,
}
static int gx_card_cpu_identify(struct snd_soc_dai_link_component *c,
- char *match)
+ const char *compatible_match, const char *dai_match)
{
- if (of_device_is_compatible(c->of_node, DT_PREFIX "aiu")) {
- if (strstr(c->dai_name, match))
+ if (of_device_is_compatible(c->of_node, compatible_match)) {
+ if (strstr(c->dai_name, dai_match))
return 1;
}
@@ -96,21 +96,23 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
if (ret)
return ret;
- if (gx_card_cpu_identify(dai_link->cpus, "FIFO"))
- return meson_card_set_fe_link(card, dai_link, np, true);
+ if (gx_card_cpu_identify(dai_link->cpus, DT_PREFIX "aiu", "FIFO"))
+ return meson_card_set_fe_link(card, dai_link, np, true);
+ if (gx_card_cpu_identify(dai_link->cpus, DT_PREFIX "gx-audin", "FIFO"))
+ return meson_card_set_fe_link(card, dai_link, np, false);
ret = meson_card_set_be_link(card, dai_link, np);
if (ret)
return ret;
/* Or apply codec to codec params if necessary */
- if (gx_card_cpu_identify(dai_link->cpus, "CODEC CTRL")) {
+ if (gx_card_cpu_identify(dai_link->cpus, DT_PREFIX "aiu", "CODEC CTRL")) {
dai_link->c2c_params = &codec_params;
dai_link->num_c2c_params = 1;
} else {
dai_link->no_pcm = 1;
/* Check if the cpu is the i2s encoder and parse i2s data */
- if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder"))
+ if (gx_card_cpu_identify(dai_link->cpus, DT_PREFIX "aiu", "I2S Encoder"))
ret = gx_card_parse_i2s(card, np, index);
}
--
2.47.3
More information about the linux-amlogic
mailing list