u32 link_mask;
const char *codec_name;
const char *name_prefix;
+ bool include_sidecar;
struct sof_sdw_codec_info *codec_info;
const struct sof_sdw_dai_info *dai_info;
static int parse_sdw_endpoints(struct snd_soc_card *card,
struct sof_sdw_dailink *sof_dais,
- struct sof_sdw_endpoint *sof_ends)
+ struct sof_sdw_endpoint *sof_ends,
+ int *num_devs)
{
struct device *dev = card->dev;
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
struct sof_sdw_endpoint *sof_end = sof_ends;
int num_dais = 0;
int i, j;
+ int ret;
for (adr_link = mach_params->links; adr_link->num_adr; adr_link++) {
int num_link_dailinks = 0;
sof_end->name_prefix = adr_dev->name_prefix;
+ if (codec_info->count_sidecar && codec_info->add_sidecar) {
+ ret = codec_info->count_sidecar(card, &num_dais, num_devs);
+ if (ret)
+ return ret;
+
+ sof_end->include_sidecar = true;
+ }
+
for (j = 0; j < adr_dev->num_endpoints; j++) {
const struct snd_soc_acpi_endpoint *adr_end;
const struct sof_sdw_dai_info *dai_info;
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
struct sof_sdw_endpoint *sof_end;
int stream;
+ int ret;
list_for_each_entry(sof_end, &sof_dai->endpoints, list) {
if (sof_end->name_prefix) {
(*codec_conf)->name_prefix = sof_end->name_prefix;
(*codec_conf)++;
}
+
+ if (sof_end->include_sidecar) {
+ ret = sof_end->codec_info->add_sidecar(card, dai_links, codec_conf);
+ if (ret)
+ return ret;
+ }
}
for_each_pcm_streams(stream) {
goto err_dai;
}
- ret = parse_sdw_endpoints(card, sof_dais, sof_ends);
+ ret = parse_sdw_endpoints(card, sof_dais, sof_ends, &num_devs);
if (ret < 0)
goto err_end;
const int dai_num;
int (*codec_card_late_probe)(struct snd_soc_card *card);
+
+ int (*count_sidecar)(struct snd_soc_card *card,
+ int *num_dais, int *num_devs);
+ int (*add_sidecar)(struct snd_soc_card *card,
+ struct snd_soc_dai_link **dai_links,
+ struct snd_soc_codec_conf **codec_conf);
};
struct mc_private {