summaryrefslogtreecommitdiff
path: root/sound/soc/meson
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2019-05-15 15:18:57 +0200
committerMark Brown <broonie@kernel.org>2019-05-16 12:13:30 +0100
commit0a8f1117a6803398d361e7bd76fef59c636f143b (patch)
treeb316b96aa78e9079f26e575bcdc17412e32e7a29 /sound/soc/meson
parente35f5ad6a965de5d301ca5957a1c48c53fe366fb (diff)
ASoC: meson: axg-card: add basic codec-to-codec link support
Add basic support for codec-to-codec link in the axg sound card. The cpu side of these links is expected to properly set the hw_params and format of the link. ATM, only the tohdmitx glue is supported but others (like the internal DAC glue) should follow. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Tested-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/meson')
-rw-r--r--sound/soc/meson/axg-card.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 5c8deee8d512..db0a7fc18928 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -29,6 +29,18 @@ struct axg_dai_link_tdm_data {
struct axg_dai_link_tdm_mask *codec_masks;
};
+/*
+ * Base params for the codec to codec links
+ * Those will be over-written by the CPU side of the link
+ */
+static const struct snd_soc_pcm_stream codec_params = {
+ .formats = SNDRV_PCM_FMTBIT_S24_LE,
+ .rate_min = 5525,
+ .rate_max = 192000,
+ .channels_min = 1,
+ .channels_max = 8,
+};
+
#define PREFIX "amlogic,"
static int axg_card_reallocate_links(struct axg_card *priv,
@@ -517,6 +529,11 @@ static int axg_card_cpu_is_tdm_iface(struct device_node *np)
return of_device_is_compatible(np, PREFIX "axg-tdm-iface");
}
+static int axg_card_cpu_is_codec(struct device_node *np)
+{
+ return of_device_is_compatible(np, PREFIX "g12a-tohdmitx");
+}
+
static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
int *index)
{
@@ -540,6 +557,8 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
if (axg_card_cpu_is_tdm_iface(dai_link->cpu_of_node))
ret = axg_card_parse_tdm(card, np, index);
+ else if (axg_card_cpu_is_codec(dai_link->cpu_of_node))
+ dai_link->params = &codec_params;
return ret;
}