aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs4281.c
diff options
context:
space:
mode:
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] = {
1997 1997
1998#define CLKCR1_CKRA 0x00010000L 1998#define CLKCR1_CKRA 0x00010000L
1999 1999
2000static int cs4281_suspend(struct pci_dev *pci, pm_message_t state) 2000static int cs4281_suspend(struct device *dev)
2001{ 2001{
2002 struct snd_card *card = pci_get_drvdata(pci); 2002 struct pci_dev *pci = to_pci_dev(dev);
2003 struct snd_card *card = dev_get_drvdata(dev);
2003 struct cs4281 *chip = card->private_data; 2004 struct cs4281 *chip = card->private_data;
2004 u32 ulCLK; 2005 u32 ulCLK;
2005 unsigned int i; 2006 unsigned int i;
@@ -2040,13 +2041,14 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)
2040 2041
2041 pci_disable_device(pci); 2042 pci_disable_device(pci);
2042 pci_save_state(pci); 2043 pci_save_state(pci);
2043 pci_set_power_state(pci, pci_choose_state(pci, state)); 2044 pci_set_power_state(pci, PCI_D3hot);
2044 return 0; 2045 return 0;
2045} 2046}
2046 2047
2047static int cs4281_resume(struct pci_dev *pci) 2048static int cs4281_resume(struct device *dev)
2048{ 2049{
2049 struct snd_card *card = pci_get_drvdata(pci); 2050 struct pci_dev *pci = to_pci_dev(dev);
2051 struct snd_card *card = dev_get_drvdata(dev);
2050 struct cs4281 *chip = card->private_data; 2052 struct cs4281 *chip = card->private_data;
2051 unsigned int i; 2053 unsigned int i;
2052 u32 ulCLK; 2054 u32 ulCLK;
@@ -2082,6 +2084,11 @@ static int cs4281_resume(struct pci_dev *pci)
2082 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2084 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
2083 return 0; 2085 return 0;
2084} 2086}
2087
2088static SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume);
2089#define CS4281_PM_OPS &cs4281_pm
2090#else
2091#define CS4281_PM_OPS NULL
2085#endif /* CONFIG_PM */ 2092#endif /* CONFIG_PM */
2086 2093
2087static struct pci_driver cs4281_driver = { 2094static struct pci_driver cs4281_driver = {
@@ -2089,10 +2096,9 @@ static struct pci_driver cs4281_driver = {
2089 .id_table = snd_cs4281_ids, 2096 .id_table = snd_cs4281_ids,
2090 .probe = snd_cs4281_probe, 2097 .probe = snd_cs4281_probe,
2091 .remove = __devexit_p(snd_cs4281_remove), 2098 .remove = __devexit_p(snd_cs4281_remove),
2092#ifdef CONFIG_PM 2099 .driver = {
2093 .suspend = cs4281_suspend, 2100 .pm = CS4281_PM_OPS,
2094 .resume = cs4281_resume, 2101 },
2095#endif
2096}; 2102};
2097 2103
2098module_pci_driver(cs4281_driver); 2104module_pci_driver(cs4281_driver);