From 1e34f015805adc66e6581a1e52bda2ba09120ab2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:15:58 +0100 Subject: [PATCH] --- yaml --- r: 16095 b: refs/heads/master c: e4f163d96080dda40fd02df725f3672d035e4c5a h: refs/heads/master i: 16093: 8c4280c211bce4219c5e546aa0d22c48c7b137fd 16091: 08b6938ddce741e8d0d009f426624e2138295500 16087: 44d608aa2d774f2ec2f6a528ed5fa8dce54a23b8 16079: 877c6c4ff0b93f4fbd8bec53bcdc6b38c532c36b 16063: d310b31a8a70d4055d706b996f047048a59ce6e0 v: v3 --- [refs] | 2 +- trunk/sound/pcmcia/pdaudiocf/pdaudiocf.c | 6 ++---- trunk/sound/pcmcia/pdaudiocf/pdaudiocf.h | 4 ++-- trunk/sound/pcmcia/pdaudiocf/pdaudiocf_core.c | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index d993ab7f6601..a53048852569 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f52bdb61bdb945b29c2a3b3a6d0f8e6e80b8ec8 +refs/heads/master: e4f163d96080dda40fd02df725f3672d035e4c5a diff --git a/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.c b/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.c index 0ba335d045f8..a7cd2d4df757 100644 --- a/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -217,8 +217,6 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq if (err < 0) return err; - snd_card_set_pm_callback(card, snd_pdacf_suspend, snd_pdacf_resume, pdacf); - if ((err = snd_card_register(card)) < 0) return err; @@ -339,7 +337,7 @@ static int pdacf_event(event_t event, int priority, event_callback_args_t *args) link->state |= DEV_SUSPEND; if (chip) { snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); - snd_pdacf_suspend(chip->card, PMSG_SUSPEND); + snd_pdacf_suspend(chip, PMSG_SUSPEND); } /* Fall through... */ case CS_EVENT_RESET_PHYSICAL: @@ -358,7 +356,7 @@ static int pdacf_event(event_t event, int priority, event_callback_args_t *args) pcmcia_request_configuration(link->handle, &link->conf); if (chip) { snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); - snd_pdacf_resume(chip->card); + snd_pdacf_resume(chip); } } snd_printdd(KERN_DEBUG "resume done!\n"); diff --git a/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.h b/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.h index ad8f32eedce5..2744f189a613 100644 --- a/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/trunk/sound/pcmcia/pdaudiocf/pdaudiocf.h @@ -134,8 +134,8 @@ struct snd_pdacf *snd_pdacf_create(struct snd_card *card); int snd_pdacf_ak4117_create(struct snd_pdacf *pdacf); void snd_pdacf_powerdown(struct snd_pdacf *chip); #ifdef CONFIG_PM -int snd_pdacf_suspend(struct snd_card *card, pm_message_t state); -int snd_pdacf_resume(struct snd_card *card); +int snd_pdacf_suspend(struct snd_pdacf *chip, pm_message_t state); +int snd_pdacf_resume(struct snd_pdacf *chip); #endif int snd_pdacf_pcm_new(struct snd_pdacf *chip); irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs); diff --git a/trunk/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/trunk/sound/pcmcia/pdaudiocf/pdaudiocf_core.c index 4f898238e0aa..bd0d70ff3019 100644 --- a/trunk/sound/pcmcia/pdaudiocf/pdaudiocf_core.c +++ b/trunk/sound/pcmcia/pdaudiocf/pdaudiocf_core.c @@ -255,11 +255,11 @@ void snd_pdacf_powerdown(struct snd_pdacf *chip) #ifdef CONFIG_PM -int snd_pdacf_suspend(struct snd_card *card, pm_message_t state) +int snd_pdacf_suspend(struct snd_pdacf *chip, pm_message_t state) { - struct snd_pdacf *chip = card->pm_private_data; u16 val; + snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot); snd_pcm_suspend_all(chip->pcm); /* disable interrupts, but use direct write to preserve old register value in chip->regmap */ val = inw(chip->port + PDAUDIOCF_REG_IER); @@ -275,9 +275,8 @@ static inline int check_signal(struct snd_pdacf *chip) return (chip->ak4117->rcs0 & AK4117_UNLCK) == 0; } -int snd_pdacf_resume(struct snd_card *card) +int snd_pdacf_resume(struct snd_pdacf *chip) { - struct snd_pdacf *chip = card->pm_private_data; int timeout = 40; pdacf_reinit(chip, 1); @@ -286,6 +285,7 @@ int snd_pdacf_resume(struct snd_card *card) (snd_ak4117_external_rate(chip->ak4117) <= 0 || !check_signal(chip))) mdelay(1); chip->chip_status &= ~PDAUDIOCF_STAT_IS_SUSPENDED; + snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0); return 0; } #endif