summaryrefslogtreecommitdiffstats
path: root/sound/pci/cs4281.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/cs4281.c
parent284e7ca75f96a18f182cce38ba76ee724fb97e16 (diff)
downloadtalos-obmc-linux-68cb2b559278858ef9f3a7722f95df88797c7840.tar.gz
talos-obmc-linux-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/cs4281.c')
-rw-r--r--sound/pci/cs4281.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index 33506ee569bd..45a8317085f4 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -1997,9 +1997,10 @@ static int saved_regs[SUSPEND_REGISTERS] = {
#define CLKCR1_CKRA 0x00010000L
-static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)
+static int cs4281_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 cs4281 *chip = card->private_data;
u32 ulCLK;
unsigned int i;
@@ -2040,13 +2041,14 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)
pci_disable_device(pci);
pci_save_state(pci);
- pci_set_power_state(pci, pci_choose_state(pci, state));
+ pci_set_power_state(pci, PCI_D3hot);
return 0;
}
-static int cs4281_resume(struct pci_dev *pci)
+static int cs4281_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 cs4281 *chip = card->private_data;
unsigned int i;
u32 ulCLK;
@@ -2082,6 +2084,11 @@ static int cs4281_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
+
+static SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume);
+#define CS4281_PM_OPS &cs4281_pm
+#else
+#define CS4281_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver cs4281_driver = {
@@ -2089,10 +2096,9 @@ static struct pci_driver cs4281_driver = {
.id_table = snd_cs4281_ids,
.probe = snd_cs4281_probe,
.remove = __devexit_p(snd_cs4281_remove),
-#ifdef CONFIG_PM
- .suspend = cs4281_suspend,
- .resume = cs4281_resume,
-#endif
+ .driver = {
+ .pm = CS4281_PM_OPS,
+ },
};
module_pci_driver(cs4281_driver);
OpenPOWER on IntegriCloud