[PATCH RFC 4/6] ASoC: meson: add support for AUDIN in gx-card

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Extend the gx-card module in order to support the audio input capabilities
provided by AUDIN driver.

Signed-off-by: Valerio Setti <vsetti@xxxxxxxxxxxx>
---
 sound/soc/meson/gx-card.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/soc/meson/gx-card.c b/sound/soc/meson/gx-card.c
index b408cc2bbc91..c59bb18b0951 100644
--- a/sound/soc/meson/gx-card.c
+++ b/sound/soc/meson/gx-card.c
@@ -67,7 +67,8 @@ 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)
 {
-	if (of_device_is_compatible(c->of_node, DT_PREFIX "aiu")) {
+	if ((of_device_is_compatible(c->of_node, DT_PREFIX "aiu")) ||
+	    (of_device_is_compatible(c->of_node, DT_PREFIX "audin"))) {
 		if (strstr(c->dai_name, match))
 			return 1;
 	}
@@ -96,6 +97,8 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
 
 	if (gx_card_cpu_identify(dai_link->cpus, "FIFO"))
 		return  meson_card_set_fe_link(card, dai_link, np, true);
+	else if (gx_card_cpu_identify(dai_link->cpus, "TODDR"))
+		return  meson_card_set_fe_link(card, dai_link, np, false);
 
 	ret = meson_card_set_be_link(card, dai_link, np);
 	if (ret)
@@ -107,8 +110,11 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
 		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"))
+		/* Check if the cpu is the i2s encoder|decoder and parse
+		 * i2s data
+		 */
+		if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder") ||
+		    gx_card_cpu_identify(dai_link->cpus, "I2S Decoder"))
 			ret = gx_card_parse_i2s(card, np, index);
 	}
 
-- 
2.39.5





[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux