Skip to content

Commit 0a8f111

Browse files
jbrun3tbroonie
authored andcommitted
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>
1 parent e35f5ad commit 0a8f111

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

sound/soc/meson/axg-card.c

+19
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ struct axg_dai_link_tdm_data {
2929
struct axg_dai_link_tdm_mask *codec_masks;
3030
};
3131

32+
/*
33+
* Base params for the codec to codec links
34+
* Those will be over-written by the CPU side of the link
35+
*/
36+
static const struct snd_soc_pcm_stream codec_params = {
37+
.formats = SNDRV_PCM_FMTBIT_S24_LE,
38+
.rate_min = 5525,
39+
.rate_max = 192000,
40+
.channels_min = 1,
41+
.channels_max = 8,
42+
};
43+
3244
#define PREFIX "amlogic,"
3345

3446
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)
517529
return of_device_is_compatible(np, PREFIX "axg-tdm-iface");
518530
}
519531

532+
static int axg_card_cpu_is_codec(struct device_node *np)
533+
{
534+
return of_device_is_compatible(np, PREFIX "g12a-tohdmitx");
535+
}
536+
520537
static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
521538
int *index)
522539
{
@@ -540,6 +557,8 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
540557

541558
if (axg_card_cpu_is_tdm_iface(dai_link->cpu_of_node))
542559
ret = axg_card_parse_tdm(card, np, index);
560+
else if (axg_card_cpu_is_codec(dai_link->cpu_of_node))
561+
dai_link->params = &codec_params;
543562

544563
return ret;
545564
}

0 commit comments

Comments
 (0)