Commit 70b2ac12 authored by Mark Brown's avatar Mark Brown

ASoC: Use card rather than soc-audio device to card PM functions

The platform device for the card is tied closely to the soc-audio
implementation which we're currently trying to remove in favour of
allowing cards to have their own devices. Begin removing it by
replacing it with the card in the suspend and resume callbacks we
give to cards, also taking the opportunity to remove the legacy
suspend types which are currently hard coded anyway.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 16af7d60
...@@ -654,10 +654,10 @@ struct snd_soc_card { ...@@ -654,10 +654,10 @@ struct snd_soc_card {
/* the pre and post PM functions are used to do any PM work before and /* the pre and post PM functions are used to do any PM work before and
* after the codec and DAI's do any PM work. */ * after the codec and DAI's do any PM work. */
int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); int (*suspend_pre)(struct snd_soc_card *card);
int (*suspend_post)(struct platform_device *pdev, pm_message_t state); int (*suspend_post)(struct snd_soc_card *card);
int (*resume_pre)(struct platform_device *pdev); int (*resume_pre)(struct snd_soc_card *card);
int (*resume_post)(struct platform_device *pdev); int (*resume_post)(struct snd_soc_card *card);
/* callbacks */ /* callbacks */
int (*set_bias_level)(struct snd_soc_card *, int (*set_bias_level)(struct snd_soc_card *,
......
...@@ -151,13 +151,13 @@ static struct snd_soc_ops raumfeld_cs4270_ops = { ...@@ -151,13 +151,13 @@ static struct snd_soc_ops raumfeld_cs4270_ops = {
.hw_params = raumfeld_cs4270_hw_params, .hw_params = raumfeld_cs4270_hw_params,
}; };
static int raumfeld_line_suspend(struct platform_device *pdev, pm_message_t state) static int raumfeld_line_suspend(struct snd_soc_card *card)
{ {
raumfeld_enable_audio(false); raumfeld_enable_audio(false);
return 0; return 0;
} }
static int raumfeld_line_resume(struct platform_device *pdev) static int raumfeld_line_resume(struct snd_soc_card *card)
{ {
raumfeld_enable_audio(true); raumfeld_enable_audio(true);
return 0; return 0;
......
...@@ -226,8 +226,7 @@ static int zylonite_remove(struct platform_device *pdev) ...@@ -226,8 +226,7 @@ static int zylonite_remove(struct platform_device *pdev)
return 0; return 0;
} }
static int zylonite_suspend_post(struct platform_device *pdev, static int zylonite_suspend_post(struct snd_soc_card *card)
pm_message_t state)
{ {
if (clk_pout) if (clk_pout)
clk_disable(pout); clk_disable(pout);
...@@ -235,7 +234,7 @@ static int zylonite_suspend_post(struct platform_device *pdev, ...@@ -235,7 +234,7 @@ static int zylonite_suspend_post(struct platform_device *pdev,
return 0; return 0;
} }
static int zylonite_resume_pre(struct platform_device *pdev) static int zylonite_resume_pre(struct snd_soc_card *card)
{ {
int ret = 0; int ret = 0;
......
...@@ -1011,7 +1011,7 @@ static int soc_suspend(struct device *dev) ...@@ -1011,7 +1011,7 @@ static int soc_suspend(struct device *dev)
} }
if (card->suspend_pre) if (card->suspend_pre)
card->suspend_pre(pdev, PMSG_SUSPEND); card->suspend_pre(card);
for (i = 0; i < card->num_rtd; i++) { for (i = 0; i < card->num_rtd; i++) {
struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai;
...@@ -1078,7 +1078,7 @@ static int soc_suspend(struct device *dev) ...@@ -1078,7 +1078,7 @@ static int soc_suspend(struct device *dev)
} }
if (card->suspend_post) if (card->suspend_post)
card->suspend_post(pdev, PMSG_SUSPEND); card->suspend_post(card);
return 0; return 0;
} }
...@@ -1090,7 +1090,6 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -1090,7 +1090,6 @@ static void soc_resume_deferred(struct work_struct *work)
{ {
struct snd_soc_card *card = struct snd_soc_card *card =
container_of(work, struct snd_soc_card, deferred_resume_work); container_of(work, struct snd_soc_card, deferred_resume_work);
struct platform_device *pdev = to_platform_device(card->dev);
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
int i; int i;
...@@ -1104,7 +1103,7 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -1104,7 +1103,7 @@ static void soc_resume_deferred(struct work_struct *work)
snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D2); snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D2);
if (card->resume_pre) if (card->resume_pre)
card->resume_pre(pdev); card->resume_pre(card);
/* resume AC97 DAIs */ /* resume AC97 DAIs */
for (i = 0; i < card->num_rtd; i++) { for (i = 0; i < card->num_rtd; i++) {
...@@ -1179,7 +1178,7 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -1179,7 +1178,7 @@ static void soc_resume_deferred(struct work_struct *work)
} }
if (card->resume_post) if (card->resume_post)
card->resume_post(pdev); card->resume_post(card);
dev_dbg(card->dev, "resume work completed\n"); dev_dbg(card->dev, "resume work completed\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment