diff options
author | jassi brar <jassisinghbrar@gmail.com> | 2010-02-22 01:58:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-02-22 09:14:58 -0500 |
commit | d273ebe77a780d3aba1f5b86615af3b0e87b76bf (patch) | |
tree | fd863113cd506960992495659e13aa1c7a4ef315 | |
parent | 6c5f1fed49f96a0600aa9a97ac3faf972c33a341 (diff) |
ASoC: Pass dai_link as argument to platform suspend and resume
Passing pointer to relevant dai_link provides easier reach to the
ASoC tree in suspend/resume of snd_soc_platform. It also provides
direct access to the dai at the other end of the dai_link.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | include/sound/soc.h | 5 | ||||
-rw-r--r-- | sound/soc/atmel/atmel-pcm.c | 6 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 5d234a8c2506..27a2ad9a6b8b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -212,6 +212,7 @@ struct snd_soc_dai_mode; | |||
212 | struct snd_soc_pcm_runtime; | 212 | struct snd_soc_pcm_runtime; |
213 | struct snd_soc_dai; | 213 | struct snd_soc_dai; |
214 | struct snd_soc_platform; | 214 | struct snd_soc_platform; |
215 | struct snd_soc_dai_link; | ||
215 | struct snd_soc_codec; | 216 | struct snd_soc_codec; |
216 | struct soc_enum; | 217 | struct soc_enum; |
217 | struct snd_soc_ac97_ops; | 218 | struct snd_soc_ac97_ops; |
@@ -461,8 +462,8 @@ struct snd_soc_platform { | |||
461 | 462 | ||
462 | int (*probe)(struct platform_device *pdev); | 463 | int (*probe)(struct platform_device *pdev); |
463 | int (*remove)(struct platform_device *pdev); | 464 | int (*remove)(struct platform_device *pdev); |
464 | int (*suspend)(struct snd_soc_dai *dai); | 465 | int (*suspend)(struct snd_soc_dai_link *dai_link); |
465 | int (*resume)(struct snd_soc_dai *dai); | 466 | int (*resume)(struct snd_soc_dai_link *dai_link); |
466 | 467 | ||
467 | /* pcm creation and destruction */ | 468 | /* pcm creation and destruction */ |
468 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, | 469 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, |
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index 9ef6b96373f5..67a32920af22 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c | |||
@@ -415,8 +415,9 @@ static void atmel_pcm_free_dma_buffers(struct snd_pcm *pcm) | |||
415 | } | 415 | } |
416 | 416 | ||
417 | #ifdef CONFIG_PM | 417 | #ifdef CONFIG_PM |
418 | static int atmel_pcm_suspend(struct snd_soc_dai *dai) | 418 | static int atmel_pcm_suspend(struct snd_soc_dai_link *dai_link) |
419 | { | 419 | { |
420 | struct snd_soc_dai *dai = dai_link->cpu_dai; | ||
420 | struct snd_pcm_runtime *runtime = dai->runtime; | 421 | struct snd_pcm_runtime *runtime = dai->runtime; |
421 | struct atmel_runtime_data *prtd; | 422 | struct atmel_runtime_data *prtd; |
422 | struct atmel_pcm_dma_params *params; | 423 | struct atmel_pcm_dma_params *params; |
@@ -439,8 +440,9 @@ static int atmel_pcm_suspend(struct snd_soc_dai *dai) | |||
439 | return 0; | 440 | return 0; |
440 | } | 441 | } |
441 | 442 | ||
442 | static int atmel_pcm_resume(struct snd_soc_dai *dai) | 443 | static int atmel_pcm_resume(struct snd_soc_dai_link *dai_link) |
443 | { | 444 | { |
445 | struct snd_soc_dai *dai = dai_link->cpu_dai; | ||
444 | struct snd_pcm_runtime *runtime = dai->runtime; | 446 | struct snd_pcm_runtime *runtime = dai->runtime; |
445 | struct atmel_runtime_data *prtd; | 447 | struct atmel_runtime_data *prtd; |
446 | struct atmel_pcm_dma_params *params; | 448 | struct atmel_pcm_dma_params *params; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e1c0336868e1..524a85a73aca 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -854,7 +854,7 @@ static int soc_suspend(struct device *dev) | |||
854 | if (cpu_dai->suspend && !cpu_dai->ac97_control) | 854 | if (cpu_dai->suspend && !cpu_dai->ac97_control) |
855 | cpu_dai->suspend(cpu_dai); | 855 | cpu_dai->suspend(cpu_dai); |
856 | if (platform->suspend) | 856 | if (platform->suspend) |
857 | platform->suspend(cpu_dai); | 857 | platform->suspend(&card->dai_link[i]); |
858 | } | 858 | } |
859 | 859 | ||
860 | /* close any waiting streams and save state */ | 860 | /* close any waiting streams and save state */ |
@@ -943,7 +943,7 @@ static void soc_resume_deferred(struct work_struct *work) | |||
943 | if (cpu_dai->resume && !cpu_dai->ac97_control) | 943 | if (cpu_dai->resume && !cpu_dai->ac97_control) |
944 | cpu_dai->resume(cpu_dai); | 944 | cpu_dai->resume(cpu_dai); |
945 | if (platform->resume) | 945 | if (platform->resume) |
946 | platform->resume(cpu_dai); | 946 | platform->resume(&card->dai_link[i]); |
947 | } | 947 | } |
948 | 948 | ||
949 | if (card->resume_post) | 949 | if (card->resume_post) |