Commit 0a8f1117 authored by Jerome Brunet's avatar Jerome Brunet Committed by Mark Brown

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: default avatarJerome Brunet <jbrunet@baylibre.com>
Tested-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Tested-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e35f5ad6
...@@ -29,6 +29,18 @@ struct axg_dai_link_tdm_data { ...@@ -29,6 +29,18 @@ struct axg_dai_link_tdm_data {
struct axg_dai_link_tdm_mask *codec_masks; 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," #define PREFIX "amlogic,"
static int axg_card_reallocate_links(struct axg_card *priv, 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) ...@@ -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"); 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, static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
int *index) int *index)
{ {
...@@ -540,6 +557,8 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, ...@@ -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)) if (axg_card_cpu_is_tdm_iface(dai_link->cpu_of_node))
ret = axg_card_parse_tdm(card, np, index); 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; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment