Commit 792a6c51875c9d3b4a7b9af553b7fd18e8d84684
Committed by
Jaroslav Kysela
1 parent
5e12bea083
Exists in
master
and in
7 other branches
[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>
Showing 2 changed files with 19 additions and 29 deletions Side-by-side Diff
sound/arm/aaci.c
... | ... | @@ -635,19 +635,14 @@ |
635 | 635 | static int aaci_do_suspend(struct snd_card *card, unsigned int state) |
636 | 636 | { |
637 | 637 | struct aaci *aaci = card->private_data; |
638 | - if (aaci->card->power_state != SNDRV_CTL_POWER_D3cold) { | |
639 | - snd_pcm_suspend_all(aaci->pcm); | |
640 | - snd_power_change_state(aaci->card, SNDRV_CTL_POWER_D3cold); | |
641 | - } | |
638 | + snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); | |
639 | + snd_pcm_suspend_all(aaci->pcm); | |
642 | 640 | return 0; |
643 | 641 | } |
644 | 642 | |
645 | 643 | static int aaci_do_resume(struct snd_card *card, unsigned int state) |
646 | 644 | { |
647 | - struct aaci *aaci = card->private_data; | |
648 | - if (aaci->card->power_state != SNDRV_CTL_POWER_D0) { | |
649 | - snd_power_change_state(aaci->card, SNDRV_CTL_POWER_D0); | |
650 | - } | |
645 | + snd_power_change_state(card, SNDRV_CTL_POWER_D0); | |
651 | 646 | return 0; |
652 | 647 | } |
653 | 648 | |
... | ... | @@ -780,7 +775,6 @@ |
780 | 775 | return ERR_PTR(-ENOMEM); |
781 | 776 | |
782 | 777 | card->private_free = aaci_free_card; |
783 | - snd_card_set_pm_callback(card, aaci_do_suspend, aaci_do_resume, NULL); | |
784 | 778 | |
785 | 779 | strlcpy(card->driver, DRIVER_NAME, sizeof(card->driver)); |
786 | 780 | strlcpy(card->shortname, "ARM AC'97 Interface", sizeof(card->shortname)); |
sound/arm/pxa2xx-ac97.c
... | ... | @@ -247,31 +247,29 @@ |
247 | 247 | |
248 | 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) { | |
251 | - pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | |
252 | - snd_pcm_suspend_all(pxa2xx_ac97_pcm); | |
253 | - snd_ac97_suspend(pxa2xx_ac97_ac97); | |
254 | - snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); | |
255 | - if (platform_ops && platform_ops->suspend) | |
256 | - platform_ops->suspend(platform_ops->priv); | |
257 | - GCR |= GCR_ACLINK_OFF; | |
258 | - pxa_set_cken(CKEN2_AC97, 0); | |
259 | - } | |
250 | + pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | |
260 | 251 | |
252 | + snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); | |
253 | + snd_pcm_suspend_all(pxa2xx_ac97_pcm); | |
254 | + snd_ac97_suspend(pxa2xx_ac97_ac97); | |
255 | + if (platform_ops && platform_ops->suspend) | |
256 | + platform_ops->suspend(platform_ops->priv); | |
257 | + GCR |= GCR_ACLINK_OFF; | |
258 | + pxa_set_cken(CKEN2_AC97, 0); | |
259 | + | |
261 | 260 | return 0; |
262 | 261 | } |
263 | 262 | |
264 | 263 | static int pxa2xx_ac97_do_resume(struct snd_card *card) |
265 | 264 | { |
266 | - if (card->power_state != SNDRV_CTL_POWER_D0) { | |
267 | - pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | |
268 | - pxa_set_cken(CKEN2_AC97, 1); | |
269 | - if (platform_ops && platform_ops->resume) | |
270 | - platform_ops->resume(platform_ops->priv); | |
271 | - snd_ac97_resume(pxa2xx_ac97_ac97); | |
272 | - snd_power_change_state(card, SNDRV_CTL_POWER_D0); | |
273 | - } | |
265 | + pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | |
274 | 266 | |
267 | + pxa_set_cken(CKEN2_AC97, 1); | |
268 | + if (platform_ops && platform_ops->resume) | |
269 | + platform_ops->resume(platform_ops->priv); | |
270 | + snd_ac97_resume(pxa2xx_ac97_ac97); | |
271 | + snd_power_change_state(card, SNDRV_CTL_POWER_D0); | |
272 | + | |
275 | 273 | return 0; |
276 | 274 | } |
277 | 275 | |
... | ... | @@ -349,8 +347,6 @@ |
349 | 347 | snprintf(card->longname, sizeof(card->longname), |
350 | 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 | 350 | ret = snd_card_register(card); |
355 | 351 | if (ret == 0) { |
356 | 352 | platform_set_drvdata(dev, card); |