Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Valerio Setti <vsetti@baylibre.com>
To: jbrunet@baylibre.com, neil.armstrong@linaro.org,
	khilman@baylibre.com, martin.blumenstingl@googlemail.com,
	linux-amlogic@lists.infradead.org, linux-sound@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Valerio Setti <vsetti@baylibre.com>
Subject: [PATCH RFC 4/6] ASoC: meson: add support for AUDIN in gx-card
Date: Mon, 10 Feb 2025 16:01:27 +0100	[thread overview]
Message-ID: <20250210150129.40248-5-vsetti@baylibre.com> (raw)
In-Reply-To: <20250210150129.40248-1-vsetti@baylibre.com>

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

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
---
 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


  parent reply	other threads:[~2025-02-10 15:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 15:01 [PATCH RFC 0/6] Add support for AUDIN driver in Amlogic GXBB Valerio Setti
2025-02-10 15:01 ` [PATCH RFC 1/6] ASoC: meson: [HACK] let AIU export its clocks through clk-regmap Valerio Setti
2025-02-10 15:01 ` [PATCH RFC 2/6] ASoC: meson: audin: add audio input dt-bindings Valerio Setti
2025-02-11  7:33   ` Krzysztof Kozlowski
2025-02-10 15:01 ` [PATCH RFC 3/6] ASoC: meson: add AUDIN driver Valerio Setti
2025-02-11  9:21   ` Jerome Brunet
2025-02-10 15:01 ` Valerio Setti [this message]
2025-02-10 15:01 ` [PATCH RFC 5/6] arm64: dts: meson-gx: add audin support Valerio Setti
2025-02-10 15:01 ` [PATCH RFC 6/6] arm64: dts: meson-gx: enable audin on odroidc2 platform Valerio Setti
2025-02-11  0:10 ` [PATCH RFC 0/6] Add support for AUDIN driver in Amlogic GXBB Rob Herring (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250210150129.40248-5-vsetti@baylibre.com \
    --to=vsetti@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox