Skip to content

Commit 130dc08

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-card: add snd_soc_card_suspend_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 bf5bb8d commit 130dc08

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

include/sound/soc-card.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
1919
struct snd_soc_jack *jack,
2020
struct snd_soc_jack_pin *pins, unsigned int num_pins);
2121

22+
int snd_soc_card_suspend_pre(struct snd_soc_card *card);
23+
2224
/* device driver data */
2325
static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
2426
void *data)

sound/soc/soc-card.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,13 @@ int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
7979
return soc_card_ret(card, ret);
8080
}
8181
EXPORT_SYMBOL_GPL(snd_soc_card_jack_new);
82+
83+
int snd_soc_card_suspend_pre(struct snd_soc_card *card)
84+
{
85+
int ret = 0;
86+
87+
if (card->suspend_pre)
88+
ret = card->suspend_pre(card);
89+
90+
return soc_card_ret(card, ret);
91+
}

sound/soc/soc-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ int snd_soc_suspend(struct device *dev)
561561
snd_pcm_suspend_all(rtd->pcm);
562562
}
563563

564-
if (card->suspend_pre)
565-
card->suspend_pre(card);
564+
snd_soc_card_suspend_pre(card);
566565

567566
/* close any waiting streams */
568567
snd_soc_flush_all_delayed_work(card);

0 commit comments

Comments
 (0)