Commit d273ebe7 authored by jassi brar's avatar jassi brar Committed by Mark Brown

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: default avatarJassi Brar <jassi.brar@samsung.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6c5f1fed
...@@ -212,6 +212,7 @@ struct snd_soc_dai_mode; ...@@ -212,6 +212,7 @@ struct snd_soc_dai_mode;
struct snd_soc_pcm_runtime; struct snd_soc_pcm_runtime;
struct snd_soc_dai; struct snd_soc_dai;
struct snd_soc_platform; struct snd_soc_platform;
struct snd_soc_dai_link;
struct snd_soc_codec; struct snd_soc_codec;
struct soc_enum; struct soc_enum;
struct snd_soc_ac97_ops; struct snd_soc_ac97_ops;
...@@ -461,8 +462,8 @@ struct snd_soc_platform { ...@@ -461,8 +462,8 @@ struct snd_soc_platform {
int (*probe)(struct platform_device *pdev); int (*probe)(struct platform_device *pdev);
int (*remove)(struct platform_device *pdev); int (*remove)(struct platform_device *pdev);
int (*suspend)(struct snd_soc_dai *dai); int (*suspend)(struct snd_soc_dai_link *dai_link);
int (*resume)(struct snd_soc_dai *dai); int (*resume)(struct snd_soc_dai_link *dai_link);
/* pcm creation and destruction */ /* pcm creation and destruction */
int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
......
...@@ -415,8 +415,9 @@ static void atmel_pcm_free_dma_buffers(struct snd_pcm *pcm) ...@@ -415,8 +415,9 @@ static void atmel_pcm_free_dma_buffers(struct snd_pcm *pcm)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int atmel_pcm_suspend(struct snd_soc_dai *dai) static int atmel_pcm_suspend(struct snd_soc_dai_link *dai_link)
{ {
struct snd_soc_dai *dai = dai_link->cpu_dai;
struct snd_pcm_runtime *runtime = dai->runtime; struct snd_pcm_runtime *runtime = dai->runtime;
struct atmel_runtime_data *prtd; struct atmel_runtime_data *prtd;
struct atmel_pcm_dma_params *params; struct atmel_pcm_dma_params *params;
...@@ -439,8 +440,9 @@ static int atmel_pcm_suspend(struct snd_soc_dai *dai) ...@@ -439,8 +440,9 @@ static int atmel_pcm_suspend(struct snd_soc_dai *dai)
return 0; return 0;
} }
static int atmel_pcm_resume(struct snd_soc_dai *dai) static int atmel_pcm_resume(struct snd_soc_dai_link *dai_link)
{ {
struct snd_soc_dai *dai = dai_link->cpu_dai;
struct snd_pcm_runtime *runtime = dai->runtime; struct snd_pcm_runtime *runtime = dai->runtime;
struct atmel_runtime_data *prtd; struct atmel_runtime_data *prtd;
struct atmel_pcm_dma_params *params; struct atmel_pcm_dma_params *params;
......
...@@ -854,7 +854,7 @@ static int soc_suspend(struct device *dev) ...@@ -854,7 +854,7 @@ static int soc_suspend(struct device *dev)
if (cpu_dai->suspend && !cpu_dai->ac97_control) if (cpu_dai->suspend && !cpu_dai->ac97_control)
cpu_dai->suspend(cpu_dai); cpu_dai->suspend(cpu_dai);
if (platform->suspend) if (platform->suspend)
platform->suspend(cpu_dai); platform->suspend(&card->dai_link[i]);
} }
/* close any waiting streams and save state */ /* close any waiting streams and save state */
...@@ -943,7 +943,7 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -943,7 +943,7 @@ static void soc_resume_deferred(struct work_struct *work)
if (cpu_dai->resume && !cpu_dai->ac97_control) if (cpu_dai->resume && !cpu_dai->ac97_control)
cpu_dai->resume(cpu_dai); cpu_dai->resume(cpu_dai);
if (platform->resume) if (platform->resume)
platform->resume(cpu_dai); platform->resume(&card->dai_link[i]);
} }
if (card->resume_post) if (card->resume_post)
......
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