aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio/cs5535audio_pm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-02 15:20:37 +0200
committerTakashi Iwai <tiwai@suse.de>2012-07-03 08:23:03 +0200
commit68cb2b559278858ef9f3a7722f95df88797c7840 (patch)
tree3dd568aac5e1004ffd1e8400aa5a50ca6a11ad01 /sound/pci/cs5535audio/cs5535audio_pm.c
parentALSA: convert PM ops of platform_driver to new pm ops (diff)
downloadlinux-dev-68cb2b559278858ef9f3a7722f95df88797c7840.tar.xz
linux-dev-68cb2b559278858ef9f3a7722f95df88797c7840.zip
ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy suspend/resume ops. Since we change vx222, vx_core and vxpocket have to be converted, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs5535audio/cs5535audio_pm.c')
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 185b00088320..6c34def5986d 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -55,9 +55,10 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
}
-int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
+static int snd_cs5535audio_suspend(struct device *dev)
{
- struct snd_card *card = pci_get_drvdata(pci);
+ struct pci_dev *pci = to_pci_dev(dev);
+ struct snd_card *card = dev_get_drvdata(dev);
struct cs5535audio *cs5535au = card->private_data;
int i;
@@ -77,13 +78,14 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
return -EIO;
}
pci_disable_device(pci);
- pci_set_power_state(pci, pci_choose_state(pci, state));
+ pci_set_power_state(pci, PCI_D3hot);
return 0;
}
-int snd_cs5535audio_resume(struct pci_dev *pci)
+static int snd_cs5535audio_resume(struct device *dev)
{
- struct snd_card *card = pci_get_drvdata(pci);
+ struct pci_dev *pci = to_pci_dev(dev);
+ struct snd_card *card = dev_get_drvdata(dev);
struct cs5535audio *cs5535au = card->private_data;
u32 tmp;
int timeout;
@@ -129,3 +131,4 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
return 0;
}
+SIMPLE_DEV_PM_OPS(snd_cs5535audio_pm, snd_cs5535audio_suspend, snd_cs5535audio_resume);