From: Mengdong Lin mengdong.lin@linux.intel.com
When a new DAI link is added, the ASoC core will call this ops to notify a machine driver for extra intialization.
Signed-off-by: Mengdong Lin mengdong.lin@linux.intel.com
diff --git a/include/sound/soc.h b/include/sound/soc.h index 60e5fda..9a0e0e8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1103,6 +1103,9 @@ struct snd_soc_card { struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level);
+ int (*add_dai_link)(struct snd_soc_card *, + struct snd_soc_dai_link *link); + long pmdown_time;
/* CPU <--> Codec DAI links */ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c855e30..24e0c50 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1243,6 +1243,10 @@ static int soc_init_dai_link(struct snd_soc_card *card, void snd_soc_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { + /* Notify the machine driver for extra initialization. */ + if (card && card->add_dai_link) + card->add_dai_link(card, dai_link); + lockdep_assert_held(&client_mutex); list_add_tail(&dai_link->list, &card->dai_link_list); card->num_dai_links++;