aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-26 09:05:25 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-27 06:55:53 -0500
commit70b2ac126a60c87145ae8a8eb1b4dccaa0bf5468 (patch)
tree314a435bc3753194b6abcf63ce7721810729f841
parent16af7d60aa27d3fc39e46fd456b8e33d34d60437 (diff)
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: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--include/sound/soc.h8
-rw-r--r--sound/soc/pxa/raumfeld.c4
-rw-r--r--sound/soc/pxa/zylonite.c5
-rw-r--r--sound/soc/soc-core.c9
4 files changed, 12 insertions, 14 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1355ef029d82..4a489ae44a6e 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -654,10 +654,10 @@ struct snd_soc_card {
654 654
655 /* the pre and post PM functions are used to do any PM work before and 655 /* the pre and post PM functions are used to do any PM work before and
656 * after the codec and DAI's do any PM work. */ 656 * after the codec and DAI's do any PM work. */
657 int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); 657 int (*suspend_pre)(struct snd_soc_card *card);
658 int (*suspend_post)(struct platform_device *pdev, pm_message_t state); 658 int (*suspend_post)(struct snd_soc_card *card);
659 int (*resume_pre)(struct platform_device *pdev); 659 int (*resume_pre)(struct snd_soc_card *card);
660 int (*resume_post)(struct platform_device *pdev); 660 int (*resume_post)(struct snd_soc_card *card);
661 661
662 /* callbacks */ 662 /* callbacks */
663 int (*set_bias_level)(struct snd_soc_card *, 663 int (*set_bias_level)(struct snd_soc_card *,
diff --git a/sound/soc/pxa/raumfeld.c b/sound/soc/pxa/raumfeld.c
index 0fd60f423036..db1dd560a585 100644
--- a/sound/soc/pxa/raumfeld.c
+++ b/sound/soc/pxa/raumfeld.c
@@ -151,13 +151,13 @@ static struct snd_soc_ops raumfeld_cs4270_ops = {
151 .hw_params = raumfeld_cs4270_hw_params, 151 .hw_params = raumfeld_cs4270_hw_params,
152}; 152};
153 153
154static int raumfeld_line_suspend(struct platform_device *pdev, pm_message_t state) 154static int raumfeld_line_suspend(struct snd_soc_card *card)
155{ 155{
156 raumfeld_enable_audio(false); 156 raumfeld_enable_audio(false);
157 return 0; 157 return 0;
158} 158}
159 159
160static int raumfeld_line_resume(struct platform_device *pdev) 160static int raumfeld_line_resume(struct snd_soc_card *card)
161{ 161{
162 raumfeld_enable_audio(true); 162 raumfeld_enable_audio(true);
163 return 0; 163 return 0;
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c
index b222a7d72027..7b729013a728 100644
--- a/sound/soc/pxa/zylonite.c
+++ b/sound/soc/pxa/zylonite.c
@@ -226,8 +226,7 @@ static int zylonite_remove(struct platform_device *pdev)
226 return 0; 226 return 0;
227} 227}
228 228
229static int zylonite_suspend_post(struct platform_device *pdev, 229static int zylonite_suspend_post(struct snd_soc_card *card)
230 pm_message_t state)
231{ 230{
232 if (clk_pout) 231 if (clk_pout)
233 clk_disable(pout); 232 clk_disable(pout);
@@ -235,7 +234,7 @@ static int zylonite_suspend_post(struct platform_device *pdev,
235 return 0; 234 return 0;
236} 235}
237 236
238static int zylonite_resume_pre(struct platform_device *pdev) 237static int zylonite_resume_pre(struct snd_soc_card *card)
239{ 238{
240 int ret = 0; 239 int ret = 0;
241 240
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 14861f95f629..446838e7d3ec 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1011,7 +1011,7 @@ static int soc_suspend(struct device *dev)
1011 } 1011 }
1012 1012
1013 if (card->suspend_pre) 1013 if (card->suspend_pre)
1014 card->suspend_pre(pdev, PMSG_SUSPEND); 1014 card->suspend_pre(card);
1015 1015
1016 for (i = 0; i < card->num_rtd; i++) { 1016 for (i = 0; i < card->num_rtd; i++) {
1017 struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; 1017 struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai;
@@ -1078,7 +1078,7 @@ static int soc_suspend(struct device *dev)
1078 } 1078 }
1079 1079
1080 if (card->suspend_post) 1080 if (card->suspend_post)
1081 card->suspend_post(pdev, PMSG_SUSPEND); 1081 card->suspend_post(card);
1082 1082
1083 return 0; 1083 return 0;
1084} 1084}
@@ -1090,7 +1090,6 @@ static void soc_resume_deferred(struct work_struct *work)
1090{ 1090{
1091 struct snd_soc_card *card = 1091 struct snd_soc_card *card =
1092 container_of(work, struct snd_soc_card, deferred_resume_work); 1092 container_of(work, struct snd_soc_card, deferred_resume_work);
1093 struct platform_device *pdev = to_platform_device(card->dev);
1094 struct snd_soc_codec *codec; 1093 struct snd_soc_codec *codec;
1095 int i; 1094 int i;
1096 1095
@@ -1104,7 +1103,7 @@ static void soc_resume_deferred(struct work_struct *work)
1104 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D2); 1103 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D2);
1105 1104
1106 if (card->resume_pre) 1105 if (card->resume_pre)
1107 card->resume_pre(pdev); 1106 card->resume_pre(card);
1108 1107
1109 /* resume AC97 DAIs */ 1108 /* resume AC97 DAIs */
1110 for (i = 0; i < card->num_rtd; i++) { 1109 for (i = 0; i < card->num_rtd; i++) {
@@ -1179,7 +1178,7 @@ static void soc_resume_deferred(struct work_struct *work)
1179 } 1178 }
1180 1179
1181 if (card->resume_post) 1180 if (card->resume_post)
1182 card->resume_post(pdev); 1181 card->resume_post(card);
1183 1182
1184 dev_dbg(card->dev, "resume work completed\n"); 1183 dev_dbg(card->dev, "resume work completed\n");
1185 1184