Skip to content

Commit

Permalink
ASoC: soc-card: add snd_soc_card_set_bias_level()
Browse files Browse the repository at this point in the history
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
morimoto authored and broonie committed May 30, 2020
1 parent b0275d9 commit 39caefd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/sound/soc-card.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions sound/soc/soc-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
3 changes: 1 addition & 2 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 39caefd

Please sign in to comment.