/* * Base params for the codec to codec links * Those will be over-written by the CPU side of the link
*/ staticconststruct snd_soc_pcm_stream codec_params = {
.formats = SNDRV_PCM_FMTBIT_S24_LE,
.rate_min = 5525,
.rate_max = 192000,
.channels_min = 1,
.channels_max = 8,
};
staticint 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 (strstr(c->dai_name, match)) return 1;
}
/* dai not matched */ return 0;
}
staticint gx_card_add_link(struct snd_soc_card *card, struct device_node *np, int *index)
{ struct snd_soc_dai_link *dai_link = &card->dai_link[*index]; struct snd_soc_dai_link_component *cpu; int ret;
cpu = devm_kzalloc(card->dev, sizeof(*cpu), GFP_KERNEL); if (!cpu) return -ENOMEM;
dai_link->cpus = cpu;
dai_link->num_cpus = 1;
ret = meson_card_parse_dai(card, np, dai_link->cpus); if (ret) return ret;
if (gx_card_cpu_identify(dai_link->cpus, "FIFO")) return meson_card_set_fe_link(card, dai_link, np, true);
ret = meson_card_set_be_link(card, dai_link, np); if (ret) return ret;
/* Or apply codec to codec params if necessary */ if (gx_card_cpu_identify(dai_link->cpus, "CODEC CTRL")) {
dai_link->c2c_params = &codec_params;
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"))
ret = gx_card_parse_i2s(card, np, index);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.