Skip to content

Commit 934c752

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-card: add snd_soc_card_resume_pre()
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]>
1 parent d17b60b commit 934c752

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

include/sound/soc-card.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
2121

2222
int snd_soc_card_suspend_pre(struct snd_soc_card *card);
2323
int snd_soc_card_suspend_post(struct snd_soc_card *card);
24+
int snd_soc_card_resume_pre(struct snd_soc_card *card);
2425

2526
/* device driver data */
2627
static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,

sound/soc/soc-card.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,13 @@ int snd_soc_card_suspend_post(struct snd_soc_card *card)
9999

100100
return soc_card_ret(card, ret);
101101
}
102+
103+
int snd_soc_card_resume_pre(struct snd_soc_card *card)
104+
{
105+
int ret = 0;
106+
107+
if (card->resume_pre)
108+
ret = card->resume_pre(card);
109+
110+
return soc_card_ret(card, ret);
111+
}

sound/soc/soc-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,7 @@ static void soc_resume_deferred(struct work_struct *work)
660660
/* Bring us up into D2 so that DAPM starts enabling things */
661661
snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D2);
662662

663-
if (card->resume_pre)
664-
card->resume_pre(card);
663+
snd_soc_card_resume_pre(card);
665664

666665
for_each_card_components(card, component) {
667666
if (snd_soc_component_is_suspended(component))

0 commit comments

Comments
 (0)