Skip to content

Commit

Permalink
ASoC: soc-card: add snd_soc_card_resume_pre()
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 <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87zh9szv5k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed May 30, 2020
1 parent d17b60b commit 934c752
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/sound/soc-card.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,

int snd_soc_card_suspend_pre(struct snd_soc_card *card);
int snd_soc_card_suspend_post(struct snd_soc_card *card);
int snd_soc_card_resume_pre(struct snd_soc_card *card);

/* device driver data */
static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
Expand Down
10 changes: 10 additions & 0 deletions sound/soc/soc-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,13 @@ int snd_soc_card_suspend_post(struct snd_soc_card *card)

return soc_card_ret(card, ret);
}

int snd_soc_card_resume_pre(struct snd_soc_card *card)
{
int ret = 0;

if (card->resume_pre)
ret = card->resume_pre(card);

return soc_card_ret(card, ret);
}
3 changes: 1 addition & 2 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,7 @@ static void soc_resume_deferred(struct work_struct *work)
/* Bring us up into D2 so that DAPM starts enabling things */
snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D2);

if (card->resume_pre)
card->resume_pre(card);
snd_soc_card_resume_pre(card);

for_each_card_components(card, component) {
if (snd_soc_component_is_suspended(component))
Expand Down

0 comments on commit 934c752

Please sign in to comment.