summaryrefslogtreecommitdiff
path: root/sound/soc/soc-card.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-05-28 10:49:20 +0900
committerMark Brown <broonie@kernel.org>2020-05-30 02:11:37 +0100
commit5c0eac036dfd3e20dd09ab86343c3b2fb2a1ac86 (patch)
treea03d29c3d5546a3f73af18fd306eb2525746b15e /sound/soc/soc-card.c
parent73de4b026850da432b8bcfb73fc4af94674a8102 (diff)
ASoC: soc-card: add snd_soc_card_late_probe()
Card related function should be implemented at soc-card now. This patch adds it. card has "card->probe" and "card->late_probe" callbacks, and "late_probe" callback is called after "probe". This means, we can set "card->probed" flag afer "late_probe" for all cases. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87v9kgzv4w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-card.c')
-rw-r--r--sound/soc/soc-card.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
index ff3bf379f166..317771d87e3f 100644
--- a/sound/soc/soc-card.c
+++ b/sound/soc/soc-card.c
@@ -142,3 +142,27 @@ int snd_soc_card_probe(struct snd_soc_card *card)
return 0;
}
+
+int snd_soc_card_late_probe(struct snd_soc_card *card)
+{
+ if (card->late_probe) {
+ int ret = card->late_probe(card);
+
+ if (ret < 0)
+ return soc_card_ret(card, ret);
+ }
+
+ /*
+ * It has "card->probe" and "card->late_probe" callbacks,
+ * and "late_probe" callback is called after "probe".
+ * This means, we can set "card->probed" flag afer "late_probe"
+ * for all cases.
+ *
+ * see
+ * snd_soc_bind_card()
+ * snd_soc_card_probe()
+ */
+ card->probed = 1;
+
+ return 0;
+}