Blob Blame History Raw
From d41278ea0579a8c1e216c5321e2d207705ab3b54 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 28 May 2020 10:50:35 +0900
Subject: [PATCH] ASoC: soc-card: add snd_soc_card_set_bias_level_post()
Git-commit: d41278ea0579a8c1e216c5321e2d207705ab3b54
Patch-mainline: v5.8-rc1
References: jsc#SLE-16518

Card related function should be implemented at soc-card now.
This patch adds it.

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/87pnaozv2s.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 include/sound/soc-card.h |  3 +++
 sound/soc/soc-card.c     | 12 ++++++++++++
 sound/soc/soc-dapm.c     |  3 +--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc-card.h b/include/sound/soc-card.h
index 81e0c239b2e8..e35f777fd8cc 100644
--- a/include/sound/soc-card.h
+++ b/include/sound/soc-card.h
@@ -31,6 +31,9 @@ int snd_soc_card_remove(struct snd_soc_card *card);
 int snd_soc_card_set_bias_level(struct snd_soc_card *card,
 				struct snd_soc_dapm_context *dapm,
 				enum snd_soc_bias_level level);
+int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
+				     struct snd_soc_dapm_context *dapm,
+				     enum snd_soc_bias_level level);
 
 /* device driver data */
 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
index dbcaa3d72dae..5bc2832b3505 100644
--- a/sound/soc/soc-card.c
+++ b/sound/soc/soc-card.c
@@ -191,3 +191,15 @@ int snd_soc_card_set_bias_level(struct snd_soc_card *card,
 
 	return soc_card_ret(card, ret);
 }
+
+int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
+				     struct snd_soc_dapm_context *dapm,
+				     enum snd_soc_bias_level level)
+{
+	int ret = 0;
+
+	if (card && card->set_bias_level_post)
+		ret = card->set_bias_level_post(card, dapm, level);
+
+	return soc_card_ret(card, ret);
+}
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 5dc7849ecf41..653a58c96e24 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -735,8 +735,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
 	if (ret != 0)
 		goto out;
 
-	if (card && card->set_bias_level_post)
-		ret = card->set_bias_level_post(card, dapm, level);
+	ret = snd_soc_card_set_bias_level_post(card, dapm, level);
 out:
 	trace_snd_soc_bias_level_done(card, level);
 
-- 
2.16.4