diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 11:19:25 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:28:46 -0500 |
commit | 792a6c51875c9d3b4a7b9af553b7fd18e8d84684 (patch) | |
tree | 8d4887d2be87c9734fbee4436bcddcfe4a946e7d /sound/arm/pxa2xx-ac97.c | |
parent | 5e12bea0833e47117c31f13b528e31dc8112de57 (diff) |
[ALSA] Fix PM support
Modules: ARM AACI PL041 driver,ARM PXA2XX driver
Fix PM support of aaci and pxa2xx drivers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/arm/pxa2xx-ac97.c')
-rw-r--r-- | sound/arm/pxa2xx-ac97.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index d9efc37393ee..dda64beb202b 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c | |||
@@ -247,30 +247,28 @@ static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = { | |||
247 | 247 | ||
248 | static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state) | 248 | static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state) |
249 | { | 249 | { |
250 | if (card->power_state != SNDRV_CTL_POWER_D3cold) { | 250 | pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; |
251 | pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | 251 | |
252 | snd_pcm_suspend_all(pxa2xx_ac97_pcm); | 252 | snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); |
253 | snd_ac97_suspend(pxa2xx_ac97_ac97); | 253 | snd_pcm_suspend_all(pxa2xx_ac97_pcm); |
254 | snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); | 254 | snd_ac97_suspend(pxa2xx_ac97_ac97); |
255 | if (platform_ops && platform_ops->suspend) | 255 | if (platform_ops && platform_ops->suspend) |
256 | platform_ops->suspend(platform_ops->priv); | 256 | platform_ops->suspend(platform_ops->priv); |
257 | GCR |= GCR_ACLINK_OFF; | 257 | GCR |= GCR_ACLINK_OFF; |
258 | pxa_set_cken(CKEN2_AC97, 0); | 258 | pxa_set_cken(CKEN2_AC97, 0); |
259 | } | ||
260 | 259 | ||
261 | return 0; | 260 | return 0; |
262 | } | 261 | } |
263 | 262 | ||
264 | static int pxa2xx_ac97_do_resume(struct snd_card *card) | 263 | static int pxa2xx_ac97_do_resume(struct snd_card *card) |
265 | { | 264 | { |
266 | if (card->power_state != SNDRV_CTL_POWER_D0) { | 265 | pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; |
267 | pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | 266 | |
268 | pxa_set_cken(CKEN2_AC97, 1); | 267 | pxa_set_cken(CKEN2_AC97, 1); |
269 | if (platform_ops && platform_ops->resume) | 268 | if (platform_ops && platform_ops->resume) |
270 | platform_ops->resume(platform_ops->priv); | 269 | platform_ops->resume(platform_ops->priv); |
271 | snd_ac97_resume(pxa2xx_ac97_ac97); | 270 | snd_ac97_resume(pxa2xx_ac97_ac97); |
272 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 271 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
273 | } | ||
274 | 272 | ||
275 | return 0; | 273 | return 0; |
276 | } | 274 | } |
@@ -349,8 +347,6 @@ static int pxa2xx_ac97_probe(struct platform_device *dev) | |||
349 | snprintf(card->longname, sizeof(card->longname), | 347 | snprintf(card->longname, sizeof(card->longname), |
350 | "%s (%s)", dev->dev.driver->name, card->mixername); | 348 | "%s (%s)", dev->dev.driver->name, card->mixername); |
351 | 349 | ||
352 | snd_card_set_pm_callback(card, pxa2xx_ac97_do_suspend, | ||
353 | pxa2xx_ac97_do_resume, NULL); | ||
354 | ret = snd_card_register(card); | 350 | ret = snd_card_register(card); |
355 | if (ret == 0) { | 351 | if (ret == 0) { |
356 | platform_set_drvdata(dev, card); | 352 | platform_set_drvdata(dev, card); |