aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-03 13:21:52 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-03 14:19:10 -0500
commitdc7d7b830ee1f4111696e73d1c25da683b461548 (patch)
tree4b15c46c97756605dcf9baa3b2de2e1af2570264
parent07c84d0409f3551b79d676630d8ee76bb551598d (diff)
ASoC: Remove platform device from DAI suspend and resume operations
None of the DAIs use it except s3c2412-i2s which only uses it for dev_() printouts. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--include/sound/soc-dai.h6
-rw-r--r--sound/soc/atmel/atmel_ssc_dai.c6
-rw-r--r--sound/soc/au1x/psc-ac97.c6
-rw-r--r--sound/soc/au1x/psc-i2s.c6
-rw-r--r--sound/soc/blackfin/bf5xx-ac97.c6
-rw-r--r--sound/soc/blackfin/bf5xx-i2s.c6
-rw-r--r--sound/soc/pxa/pxa-ssp.c6
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c6
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c6
-rw-r--r--sound/soc/s3c24xx/s3c2412-i2s.c16
-rw-r--r--sound/soc/s3c24xx/s3c24xx-i2s.c6
-rw-r--r--sound/soc/soc-core.c8
12 files changed, 31 insertions, 53 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index a01a24b10196..e2d5f76838c6 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -191,10 +191,8 @@ struct snd_soc_dai {
191 struct snd_soc_dai *dai); 191 struct snd_soc_dai *dai);
192 void (*remove)(struct platform_device *pdev, 192 void (*remove)(struct platform_device *pdev,
193 struct snd_soc_dai *dai); 193 struct snd_soc_dai *dai);
194 int (*suspend)(struct platform_device *pdev, 194 int (*suspend)(struct snd_soc_dai *dai);
195 struct snd_soc_dai *dai); 195 int (*resume)(struct snd_soc_dai *dai);
196 int (*resume)(struct platform_device *pdev,
197 struct snd_soc_dai *dai);
198 196
199 /* ops */ 197 /* ops */
200 struct snd_soc_dai_ops ops; 198 struct snd_soc_dai_ops ops;
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 0bb18dfa9495..d9b874c5bf37 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -628,8 +628,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
628 628
629 629
630#ifdef CONFIG_PM 630#ifdef CONFIG_PM
631static int atmel_ssc_suspend(struct platform_device *pdev, 631static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
632 struct snd_soc_dai *cpu_dai)
633{ 632{
634 struct atmel_ssc_info *ssc_p; 633 struct atmel_ssc_info *ssc_p;
635 634
@@ -657,8 +656,7 @@ static int atmel_ssc_suspend(struct platform_device *pdev,
657 656
658 657
659 658
660static int atmel_ssc_resume(struct platform_device *pdev, 659static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
661 struct snd_soc_dai *cpu_dai)
662{ 660{
663 struct atmel_ssc_info *ssc_p; 661 struct atmel_ssc_info *ssc_p;
664 u32 cr; 662 u32 cr;
diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c
index a0bcfeaf5f86..a1e824d29cf9 100644
--- a/sound/soc/au1x/psc-ac97.c
+++ b/sound/soc/au1x/psc-ac97.c
@@ -314,8 +314,7 @@ static void au1xpsc_ac97_remove(struct platform_device *pdev,
314 au1xpsc_ac97_workdata = NULL; 314 au1xpsc_ac97_workdata = NULL;
315} 315}
316 316
317static int au1xpsc_ac97_suspend(struct platform_device *pdev, 317static int au1xpsc_ac97_suspend(struct snd_soc_dai *dai)
318 struct snd_soc_dai *dai)
319{ 318{
320 /* save interesting registers and disable PSC */ 319 /* save interesting registers and disable PSC */
321 au1xpsc_ac97_workdata->pm[0] = 320 au1xpsc_ac97_workdata->pm[0] =
@@ -329,8 +328,7 @@ static int au1xpsc_ac97_suspend(struct platform_device *pdev,
329 return 0; 328 return 0;
330} 329}
331 330
332static int au1xpsc_ac97_resume(struct platform_device *pdev, 331static int au1xpsc_ac97_resume(struct snd_soc_dai *dai)
333 struct snd_soc_dai *dai)
334{ 332{
335 /* restore PSC clock config */ 333 /* restore PSC clock config */
336 au_writel(au1xpsc_ac97_workdata->pm[0] | PSC_SEL_PS_AC97MODE, 334 au_writel(au1xpsc_ac97_workdata->pm[0] | PSC_SEL_PS_AC97MODE,
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c
index f4217e70a787..16f97462ea15 100644
--- a/sound/soc/au1x/psc-i2s.c
+++ b/sound/soc/au1x/psc-i2s.c
@@ -339,8 +339,7 @@ static void au1xpsc_i2s_remove(struct platform_device *pdev,
339 au1xpsc_i2s_workdata = NULL; 339 au1xpsc_i2s_workdata = NULL;
340} 340}
341 341
342static int au1xpsc_i2s_suspend(struct platform_device *pdev, 342static int au1xpsc_i2s_suspend(struct snd_soc_dai *cpu_dai)
343 struct snd_soc_dai *cpu_dai)
344{ 343{
345 /* save interesting register and disable PSC */ 344 /* save interesting register and disable PSC */
346 au1xpsc_i2s_workdata->pm[0] = 345 au1xpsc_i2s_workdata->pm[0] =
@@ -354,8 +353,7 @@ static int au1xpsc_i2s_suspend(struct platform_device *pdev,
354 return 0; 353 return 0;
355} 354}
356 355
357static int au1xpsc_i2s_resume(struct platform_device *pdev, 356static int au1xpsc_i2s_resume(struct snd_soc_dai *cpu_dai)
358 struct snd_soc_dai *cpu_dai)
359{ 357{
360 /* select I2S mode and PSC clock */ 358 /* select I2S mode and PSC clock */
361 au_writel(PSC_CTRL_DISABLE, PSC_CTRL(au1xpsc_i2s_workdata)); 359 au_writel(PSC_CTRL_DISABLE, PSC_CTRL(au1xpsc_i2s_workdata));
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c
index 709bdf08e398..c602ce109d52 100644
--- a/sound/soc/blackfin/bf5xx-ac97.c
+++ b/sound/soc/blackfin/bf5xx-ac97.c
@@ -269,8 +269,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
269EXPORT_SYMBOL_GPL(soc_ac97_ops); 269EXPORT_SYMBOL_GPL(soc_ac97_ops);
270 270
271#ifdef CONFIG_PM 271#ifdef CONFIG_PM
272static int bf5xx_ac97_suspend(struct platform_device *pdev, 272static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
273 struct snd_soc_dai *dai)
274{ 273{
275 struct sport_device *sport = 274 struct sport_device *sport =
276 (struct sport_device *)dai->private_data; 275 (struct sport_device *)dai->private_data;
@@ -285,8 +284,7 @@ static int bf5xx_ac97_suspend(struct platform_device *pdev,
285 return 0; 284 return 0;
286} 285}
287 286
288static int bf5xx_ac97_resume(struct platform_device *pdev, 287static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
289 struct snd_soc_dai *dai)
290{ 288{
291 int ret; 289 int ret;
292 struct sport_device *sport = 290 struct sport_device *sport =
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c
index 6e5036bf9245..9f8ce87cc6c6 100644
--- a/sound/soc/blackfin/bf5xx-i2s.c
+++ b/sound/soc/blackfin/bf5xx-i2s.c
@@ -222,16 +222,14 @@ static int bf5xx_i2s_probe(struct platform_device *pdev,
222 return 0; 222 return 0;
223} 223}
224 224
225static void bf5xx_i2s_remove(struct platform_device *pdev, 225static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
226 struct snd_soc_dai *dai)
227{ 226{
228 pr_debug("%s enter\n", __func__); 227 pr_debug("%s enter\n", __func__);
229 peripheral_free_list(&sport_req[sport_num][0]); 228 peripheral_free_list(&sport_req[sport_num][0]);
230} 229}
231 230
232#ifdef CONFIG_PM 231#ifdef CONFIG_PM
233static int bf5xx_i2s_suspend(struct platform_device *dev, 232static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
234 struct snd_soc_dai *dai)
235{ 233{
236 struct sport_device *sport = 234 struct sport_device *sport =
237 (struct sport_device *)dai->private_data; 235 (struct sport_device *)dai->private_data;
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 402fc5ba65e7..73fa10defcca 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -244,8 +244,7 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
244 244
245#ifdef CONFIG_PM 245#ifdef CONFIG_PM
246 246
247static int pxa_ssp_suspend(struct platform_device *pdev, 247static int pxa_ssp_suspend(struct snd_soc_dai *cpu_dai)
248 struct snd_soc_dai *cpu_dai)
249{ 248{
250 struct ssp_priv *priv = cpu_dai->private_data; 249 struct ssp_priv *priv = cpu_dai->private_data;
251 250
@@ -257,8 +256,7 @@ static int pxa_ssp_suspend(struct platform_device *pdev,
257 return 0; 256 return 0;
258} 257}
259 258
260static int pxa_ssp_resume(struct platform_device *pdev, 259static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai)
261 struct snd_soc_dai *cpu_dai)
262{ 260{
263 struct ssp_priv *priv = cpu_dai->private_data; 261 struct ssp_priv *priv = cpu_dai->private_data;
264 262
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index bffbe288634c..8eed80d5675d 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -87,14 +87,12 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = {
87}; 87};
88 88
89#ifdef CONFIG_PM 89#ifdef CONFIG_PM
90static int pxa2xx_ac97_suspend(struct platform_device *pdev, 90static int pxa2xx_ac97_suspend(struct snd_soc_dai *dai)
91 struct snd_soc_dai *dai)
92{ 91{
93 return pxa2xx_ac97_hw_suspend(); 92 return pxa2xx_ac97_hw_suspend();
94} 93}
95 94
96static int pxa2xx_ac97_resume(struct platform_device *pdev, 95static int pxa2xx_ac97_resume(struct snd_soc_dai *dai)
97 struct snd_soc_dai *dai)
98{ 96{
99 return pxa2xx_ac97_hw_resume(); 97 return pxa2xx_ac97_hw_resume();
100} 98}
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index f9a9e2ebafa1..314973ace6dc 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -293,8 +293,7 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
293} 293}
294 294
295#ifdef CONFIG_PM 295#ifdef CONFIG_PM
296static int pxa2xx_i2s_suspend(struct platform_device *dev, 296static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
297 struct snd_soc_dai *dai)
298{ 297{
299 if (!dai->active) 298 if (!dai->active)
300 return 0; 299 return 0;
@@ -311,8 +310,7 @@ static int pxa2xx_i2s_suspend(struct platform_device *dev,
311 return 0; 310 return 0;
312} 311}
313 312
314static int pxa2xx_i2s_resume(struct platform_device *pdev, 313static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
315 struct snd_soc_dai *dai)
316{ 314{
317 if (!dai->active) 315 if (!dai->active)
318 return 0; 316 return 0;
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index 1c741047ae35..75f87c3c74d0 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.c
+++ b/sound/soc/s3c24xx/s3c2412-i2s.c
@@ -649,8 +649,7 @@ static int s3c2412_i2s_probe(struct platform_device *pdev,
649} 649}
650 650
651#ifdef CONFIG_PM 651#ifdef CONFIG_PM
652static int s3c2412_i2s_suspend(struct platform_device *dev, 652static int s3c2412_i2s_suspend(struct snd_soc_dai *dai)
653 struct snd_soc_dai *dai)
654{ 653{
655 struct s3c2412_i2s_info *i2s = &s3c2412_i2s; 654 struct s3c2412_i2s_info *i2s = &s3c2412_i2s;
656 u32 iismod; 655 u32 iismod;
@@ -665,25 +664,24 @@ static int s3c2412_i2s_suspend(struct platform_device *dev,
665 iismod = readl(i2s->regs + S3C2412_IISMOD); 664 iismod = readl(i2s->regs + S3C2412_IISMOD);
666 665
667 if (iismod & S3C2412_IISCON_RXDMA_ACTIVE) 666 if (iismod & S3C2412_IISCON_RXDMA_ACTIVE)
668 dev_warn(&dev->dev, "%s: RXDMA active?\n", __func__); 667 pr_warning("%s: RXDMA active?\n", __func__);
669 668
670 if (iismod & S3C2412_IISCON_TXDMA_ACTIVE) 669 if (iismod & S3C2412_IISCON_TXDMA_ACTIVE)
671 dev_warn(&dev->dev, "%s: TXDMA active?\n", __func__); 670 pr_warning("%s: TXDMA active?\n", __func__);
672 671
673 if (iismod & S3C2412_IISCON_IIS_ACTIVE) 672 if (iismod & S3C2412_IISCON_IIS_ACTIVE)
674 dev_warn(&dev->dev, "%s: IIS active\n", __func__); 673 pr_warning("%s: IIS active\n", __func__);
675 } 674 }
676 675
677 return 0; 676 return 0;
678} 677}
679 678
680static int s3c2412_i2s_resume(struct platform_device *pdev, 679static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
681 struct snd_soc_dai *dai)
682{ 680{
683 struct s3c2412_i2s_info *i2s = &s3c2412_i2s; 681 struct s3c2412_i2s_info *i2s = &s3c2412_i2s;
684 682
685 dev_info(&pdev->dev, "dai_active %d, IISMOD %08x, IISCON %08x\n", 683 pr_info("dai_active %d, IISMOD %08x, IISCON %08x\n",
686 dai->active, i2s->suspend_iismod, i2s->suspend_iiscon); 684 dai->active, i2s->suspend_iismod, i2s->suspend_iiscon);
687 685
688 if (dai->active) { 686 if (dai->active) {
689 writel(i2s->suspend_iiscon, i2s->regs + S3C2412_IISCON); 687 writel(i2s->suspend_iiscon, i2s->regs + S3C2412_IISCON);
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index 8d9135f41bc9..45fe8f7c88ab 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -419,8 +419,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev,
419} 419}
420 420
421#ifdef CONFIG_PM 421#ifdef CONFIG_PM
422static int s3c24xx_i2s_suspend(struct platform_device *pdev, 422static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
423 struct snd_soc_dai *cpu_dai)
424{ 423{
425 DBG("Entered %s\n", __func__); 424 DBG("Entered %s\n", __func__);
426 425
@@ -434,8 +433,7 @@ static int s3c24xx_i2s_suspend(struct platform_device *pdev,
434 return 0; 433 return 0;
435} 434}
436 435
437static int s3c24xx_i2s_resume(struct platform_device *pdev, 436static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
438 struct snd_soc_dai *cpu_dai)
439{ 437{
440 DBG("Entered %s\n", __func__); 438 DBG("Entered %s\n", __func__);
441 clk_enable(s3c24xx_i2s.iis_clk); 439 clk_enable(s3c24xx_i2s.iis_clk);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f83852f11463..2f2a8d93bbf0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -650,7 +650,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
650 for (i = 0; i < card->num_links; i++) { 650 for (i = 0; i < card->num_links; i++) {
651 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 651 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
652 if (cpu_dai->suspend && !cpu_dai->ac97_control) 652 if (cpu_dai->suspend && !cpu_dai->ac97_control)
653 cpu_dai->suspend(pdev, cpu_dai); 653 cpu_dai->suspend(cpu_dai);
654 if (platform->suspend) 654 if (platform->suspend)
655 platform->suspend(cpu_dai); 655 platform->suspend(cpu_dai);
656 } 656 }
@@ -676,7 +676,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
676 for (i = 0; i < card->num_links; i++) { 676 for (i = 0; i < card->num_links; i++) {
677 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 677 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
678 if (cpu_dai->suspend && cpu_dai->ac97_control) 678 if (cpu_dai->suspend && cpu_dai->ac97_control)
679 cpu_dai->suspend(pdev, cpu_dai); 679 cpu_dai->suspend(cpu_dai);
680 } 680 }
681 681
682 if (card->suspend_post) 682 if (card->suspend_post)
@@ -712,7 +712,7 @@ static void soc_resume_deferred(struct work_struct *work)
712 for (i = 0; i < card->num_links; i++) { 712 for (i = 0; i < card->num_links; i++) {
713 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 713 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
714 if (cpu_dai->resume && cpu_dai->ac97_control) 714 if (cpu_dai->resume && cpu_dai->ac97_control)
715 cpu_dai->resume(pdev, cpu_dai); 715 cpu_dai->resume(cpu_dai);
716 } 716 }
717 717
718 if (codec_dev->resume) 718 if (codec_dev->resume)
@@ -739,7 +739,7 @@ static void soc_resume_deferred(struct work_struct *work)
739 for (i = 0; i < card->num_links; i++) { 739 for (i = 0; i < card->num_links; i++) {
740 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 740 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
741 if (cpu_dai->resume && !cpu_dai->ac97_control) 741 if (cpu_dai->resume && !cpu_dai->ac97_control)
742 cpu_dai->resume(pdev, cpu_dai); 742 cpu_dai->resume(cpu_dai);
743 if (platform->resume) 743 if (platform->resume)
744 platform->resume(cpu_dai); 744 platform->resume(cpu_dai);
745 } 745 }