]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ASoC: soc-card: add snd_soc_card_set_bias_level()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 28 May 2020 01:49:35 +0000 (10:49 +0900)
committerMark Brown <broonie@kernel.org>
Sat, 30 May 2020 01:11:39 +0000 (02:11 +0100)
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/87sgfkzv4g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-card.h
sound/soc/soc-card.c
sound/soc/soc-dapm.c

index 97a34f0b0d2faabc8ba8d12b47b9838cf411d37c..81e0c239b2e86b36025bd5694c862941b6ba4e2a 100644 (file)
@@ -28,6 +28,10 @@ int snd_soc_card_probe(struct snd_soc_card *card);
 int snd_soc_card_late_probe(struct snd_soc_card *card);
 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);
+
 /* device driver data */
 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
                                            void *data)
index 920967a9a5ea853c43290422d6e3e08049fea58f..dbcaa3d72dae23aebf0e680873b820ba9e09e0d0 100644 (file)
@@ -179,3 +179,15 @@ int snd_soc_card_remove(struct snd_soc_card *card)
 
        return soc_card_ret(card, ret);
 }
+
+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 ret = 0;
+
+       if (card && card->set_bias_level)
+               ret = card->set_bias_level(card, dapm, level);
+
+       return soc_card_ret(card, ret);
+}
index a4de3e4bc2eff64c6ebd90251c911fed26f7f450..5dc7849ecf41a7cd384337e62032380419f8895b 100644 (file)
@@ -725,8 +725,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
 
        trace_snd_soc_bias_level_start(card, level);
 
-       if (card && card->set_bias_level)
-               ret = card->set_bias_level(card, dapm, level);
+       ret = snd_soc_card_set_bias_level(card, dapm, level);
        if (ret != 0)
                goto out;