aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-11 05:26:48 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-11 05:26:48 -0500
commit9e5947465d72ef1b3a88104474ab2adf78837220 (patch)
tree2e71fa8e496b8e047e5a90e81b685ed1f8d3ed7f /sound/pci
parent624afe4dc9a08992b200046dfe8a61f19bab74ab (diff)
parent3e41c9b5a1ca2acfd9306a918fe3903f02eb89ca (diff)
Merge branch 'topic/pci-cleanup' into for-next
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/ali5451/ali5451.c15
-rw-r--r--sound/pci/als300.c15
-rw-r--r--sound/pci/als4000.c15
-rw-r--r--sound/pci/atiixp.c15
-rw-r--r--sound/pci/atiixp_modem.c15
-rw-r--r--sound/pci/azt3328.c15
-rw-r--r--sound/pci/ca0106/ca0106_main.c16
-rw-r--r--sound/pci/cmipci.c15
-rw-r--r--sound/pci/cs4281.c15
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c15
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pm.c18
-rw-r--r--sound/pci/ctxfi/cthw20k1.c9
-rw-r--r--sound/pci/ctxfi/cthw20k2.c12
-rw-r--r--sound/pci/echoaudio/echoaudio.c5
-rw-r--r--sound/pci/emu10k1/emu10k1.c15
-rw-r--r--sound/pci/ens1370.c15
-rw-r--r--sound/pci/es1938.c12
-rw-r--r--sound/pci/es1968.c16
-rw-r--r--sound/pci/fm801.c15
-rw-r--r--sound/pci/hda/hda_intel.c13
-rw-r--r--sound/pci/ice1712/ice1712.c16
-rw-r--r--sound/pci/ice1712/ice1724.c16
-rw-r--r--sound/pci/intel8x0.c15
-rw-r--r--sound/pci/intel8x0m.c12
-rw-r--r--sound/pci/maestro3.c15
-rw-r--r--sound/pci/nm256/nm256.c14
-rw-r--r--sound/pci/oxygen/oxygen_lib.c15
-rw-r--r--sound/pci/riptide/riptide.c14
-rw-r--r--sound/pci/rme96.c13
-rw-r--r--sound/pci/sis7019.c13
-rw-r--r--sound/pci/trident/trident_main.c15
-rw-r--r--sound/pci/via82xx.c14
-rw-r--r--sound/pci/via82xx_modem.c15
-rw-r--r--sound/pci/vx222/vx222.c17
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c12
35 files changed, 1 insertions, 496 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index af89e42b2160..4cd2210fd95c 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -1873,7 +1873,6 @@ static int snd_ali_mixer(struct snd_ali *codec)
1873#ifdef CONFIG_PM_SLEEP 1873#ifdef CONFIG_PM_SLEEP
1874static int ali_suspend(struct device *dev) 1874static int ali_suspend(struct device *dev)
1875{ 1875{
1876 struct pci_dev *pci = to_pci_dev(dev);
1877 struct snd_card *card = dev_get_drvdata(dev); 1876 struct snd_card *card = dev_get_drvdata(dev);
1878 struct snd_ali *chip = card->private_data; 1877 struct snd_ali *chip = card->private_data;
1879 struct snd_ali_image *im; 1878 struct snd_ali_image *im;
@@ -1914,16 +1913,11 @@ static int ali_suspend(struct device *dev)
1914 outl(0xffffffff, ALI_REG(chip, ALI_STOP)); 1913 outl(0xffffffff, ALI_REG(chip, ALI_STOP));
1915 1914
1916 spin_unlock_irq(&chip->reg_lock); 1915 spin_unlock_irq(&chip->reg_lock);
1917
1918 pci_disable_device(pci);
1919 pci_save_state(pci);
1920 pci_set_power_state(pci, PCI_D3hot);
1921 return 0; 1916 return 0;
1922} 1917}
1923 1918
1924static int ali_resume(struct device *dev) 1919static int ali_resume(struct device *dev)
1925{ 1920{
1926 struct pci_dev *pci = to_pci_dev(dev);
1927 struct snd_card *card = dev_get_drvdata(dev); 1921 struct snd_card *card = dev_get_drvdata(dev);
1928 struct snd_ali *chip = card->private_data; 1922 struct snd_ali *chip = card->private_data;
1929 struct snd_ali_image *im; 1923 struct snd_ali_image *im;
@@ -1933,15 +1927,6 @@ static int ali_resume(struct device *dev)
1933 if (!im) 1927 if (!im)
1934 return 0; 1928 return 0;
1935 1929
1936 pci_set_power_state(pci, PCI_D0);
1937 pci_restore_state(pci);
1938 if (pci_enable_device(pci) < 0) {
1939 dev_err(dev, "pci_enable_device failed, disabling device\n");
1940 snd_card_disconnect(card);
1941 return -EIO;
1942 }
1943 pci_set_master(pci);
1944
1945 spin_lock_irq(&chip->reg_lock); 1930 spin_lock_irq(&chip->reg_lock);
1946 1931
1947 for (i = 0; i < ALI_CHANNELS; i++) { 1932 for (i = 0; i < ALI_CHANNELS; i++) {
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 7bb6ac565107..bd01113de39a 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -728,35 +728,20 @@ static int snd_als300_create(struct snd_card *card,
728#ifdef CONFIG_PM_SLEEP 728#ifdef CONFIG_PM_SLEEP
729static int snd_als300_suspend(struct device *dev) 729static int snd_als300_suspend(struct device *dev)
730{ 730{
731 struct pci_dev *pci = to_pci_dev(dev);
732 struct snd_card *card = dev_get_drvdata(dev); 731 struct snd_card *card = dev_get_drvdata(dev);
733 struct snd_als300 *chip = card->private_data; 732 struct snd_als300 *chip = card->private_data;
734 733
735 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 734 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
736 snd_pcm_suspend_all(chip->pcm); 735 snd_pcm_suspend_all(chip->pcm);
737 snd_ac97_suspend(chip->ac97); 736 snd_ac97_suspend(chip->ac97);
738
739 pci_disable_device(pci);
740 pci_save_state(pci);
741 pci_set_power_state(pci, PCI_D3hot);
742 return 0; 737 return 0;
743} 738}
744 739
745static int snd_als300_resume(struct device *dev) 740static int snd_als300_resume(struct device *dev)
746{ 741{
747 struct pci_dev *pci = to_pci_dev(dev);
748 struct snd_card *card = dev_get_drvdata(dev); 742 struct snd_card *card = dev_get_drvdata(dev);
749 struct snd_als300 *chip = card->private_data; 743 struct snd_als300 *chip = card->private_data;
750 744
751 pci_set_power_state(pci, PCI_D0);
752 pci_restore_state(pci);
753 if (pci_enable_device(pci) < 0) {
754 dev_err(dev, "pci_enable_device failed, disabling device\n");
755 snd_card_disconnect(card);
756 return -EIO;
757 }
758 pci_set_master(pci);
759
760 snd_als300_init(chip); 745 snd_als300_init(chip);
761 snd_ac97_resume(chip->ac97); 746 snd_ac97_resume(chip->ac97);
762 747
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index d3e6424ee656..94608524f3cc 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -988,7 +988,6 @@ static void snd_card_als4000_remove(struct pci_dev *pci)
988#ifdef CONFIG_PM_SLEEP 988#ifdef CONFIG_PM_SLEEP
989static int snd_als4000_suspend(struct device *dev) 989static int snd_als4000_suspend(struct device *dev)
990{ 990{
991 struct pci_dev *pci = to_pci_dev(dev);
992 struct snd_card *card = dev_get_drvdata(dev); 991 struct snd_card *card = dev_get_drvdata(dev);
993 struct snd_card_als4000 *acard = card->private_data; 992 struct snd_card_als4000 *acard = card->private_data;
994 struct snd_sb *chip = acard->chip; 993 struct snd_sb *chip = acard->chip;
@@ -997,29 +996,15 @@ static int snd_als4000_suspend(struct device *dev)
997 996
998 snd_pcm_suspend_all(chip->pcm); 997 snd_pcm_suspend_all(chip->pcm);
999 snd_sbmixer_suspend(chip); 998 snd_sbmixer_suspend(chip);
1000
1001 pci_disable_device(pci);
1002 pci_save_state(pci);
1003 pci_set_power_state(pci, PCI_D3hot);
1004 return 0; 999 return 0;
1005} 1000}
1006 1001
1007static int snd_als4000_resume(struct device *dev) 1002static int snd_als4000_resume(struct device *dev)
1008{ 1003{
1009 struct pci_dev *pci = to_pci_dev(dev);
1010 struct snd_card *card = dev_get_drvdata(dev); 1004 struct snd_card *card = dev_get_drvdata(dev);
1011 struct snd_card_als4000 *acard = card->private_data; 1005 struct snd_card_als4000 *acard = card->private_data;
1012 struct snd_sb *chip = acard->chip; 1006 struct snd_sb *chip = acard->chip;
1013 1007
1014 pci_set_power_state(pci, PCI_D0);
1015 pci_restore_state(pci);
1016 if (pci_enable_device(pci) < 0) {
1017 dev_err(dev, "pci_enable_device failed, disabling device\n");
1018 snd_card_disconnect(card);
1019 return -EIO;
1020 }
1021 pci_set_master(pci);
1022
1023 snd_als4000_configure(chip); 1008 snd_als4000_configure(chip);
1024 snd_sbdsp_reset(chip); 1009 snd_sbdsp_reset(chip);
1025 snd_sbmixer_resume(chip); 1010 snd_sbmixer_resume(chip);
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index d24188fea4b6..eb4f9ee54f85 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1474,7 +1474,6 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock,
1474 */ 1474 */
1475static int snd_atiixp_suspend(struct device *dev) 1475static int snd_atiixp_suspend(struct device *dev)
1476{ 1476{
1477 struct pci_dev *pci = to_pci_dev(dev);
1478 struct snd_card *card = dev_get_drvdata(dev); 1477 struct snd_card *card = dev_get_drvdata(dev);
1479 struct atiixp *chip = card->private_data; 1478 struct atiixp *chip = card->private_data;
1480 int i; 1479 int i;
@@ -1492,29 +1491,15 @@ static int snd_atiixp_suspend(struct device *dev)
1492 snd_ac97_suspend(chip->ac97[i]); 1491 snd_ac97_suspend(chip->ac97[i]);
1493 snd_atiixp_aclink_down(chip); 1492 snd_atiixp_aclink_down(chip);
1494 snd_atiixp_chip_stop(chip); 1493 snd_atiixp_chip_stop(chip);
1495
1496 pci_disable_device(pci);
1497 pci_save_state(pci);
1498 pci_set_power_state(pci, PCI_D3hot);
1499 return 0; 1494 return 0;
1500} 1495}
1501 1496
1502static int snd_atiixp_resume(struct device *dev) 1497static int snd_atiixp_resume(struct device *dev)
1503{ 1498{
1504 struct pci_dev *pci = to_pci_dev(dev);
1505 struct snd_card *card = dev_get_drvdata(dev); 1499 struct snd_card *card = dev_get_drvdata(dev);
1506 struct atiixp *chip = card->private_data; 1500 struct atiixp *chip = card->private_data;
1507 int i; 1501 int i;
1508 1502
1509 pci_set_power_state(pci, PCI_D0);
1510 pci_restore_state(pci);
1511 if (pci_enable_device(pci) < 0) {
1512 dev_err(dev, "pci_enable_device failed, disabling device\n");
1513 snd_card_disconnect(card);
1514 return -EIO;
1515 }
1516 pci_set_master(pci);
1517
1518 snd_atiixp_aclink_reset(chip); 1503 snd_atiixp_aclink_reset(chip);
1519 snd_atiixp_chip_start(chip); 1504 snd_atiixp_chip_start(chip);
1520 1505
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index c321a97b4344..349dd7ba6e43 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -1120,7 +1120,6 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
1120 */ 1120 */
1121static int snd_atiixp_suspend(struct device *dev) 1121static int snd_atiixp_suspend(struct device *dev)
1122{ 1122{
1123 struct pci_dev *pci = to_pci_dev(dev);
1124 struct snd_card *card = dev_get_drvdata(dev); 1123 struct snd_card *card = dev_get_drvdata(dev);
1125 struct atiixp_modem *chip = card->private_data; 1124 struct atiixp_modem *chip = card->private_data;
1126 int i; 1125 int i;
@@ -1132,29 +1131,15 @@ static int snd_atiixp_suspend(struct device *dev)
1132 snd_ac97_suspend(chip->ac97[i]); 1131 snd_ac97_suspend(chip->ac97[i]);
1133 snd_atiixp_aclink_down(chip); 1132 snd_atiixp_aclink_down(chip);
1134 snd_atiixp_chip_stop(chip); 1133 snd_atiixp_chip_stop(chip);
1135
1136 pci_disable_device(pci);
1137 pci_save_state(pci);
1138 pci_set_power_state(pci, PCI_D3hot);
1139 return 0; 1134 return 0;
1140} 1135}
1141 1136
1142static int snd_atiixp_resume(struct device *dev) 1137static int snd_atiixp_resume(struct device *dev)
1143{ 1138{
1144 struct pci_dev *pci = to_pci_dev(dev);
1145 struct snd_card *card = dev_get_drvdata(dev); 1139 struct snd_card *card = dev_get_drvdata(dev);
1146 struct atiixp_modem *chip = card->private_data; 1140 struct atiixp_modem *chip = card->private_data;
1147 int i; 1141 int i;
1148 1142
1149 pci_set_power_state(pci, PCI_D0);
1150 pci_restore_state(pci);
1151 if (pci_enable_device(pci) < 0) {
1152 dev_err(dev, "pci_enable_device failed, disabling device\n");
1153 snd_card_disconnect(card);
1154 return -EIO;
1155 }
1156 pci_set_master(pci);
1157
1158 snd_atiixp_aclink_reset(chip); 1143 snd_atiixp_aclink_reset(chip);
1159 snd_atiixp_chip_start(chip); 1144 snd_atiixp_chip_start(chip);
1160 1145
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index fdbb9c05c77b..bbacc75c902a 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -2694,7 +2694,6 @@ snd_azf3328_resume_ac97(const struct snd_azf3328 *chip)
2694static int 2694static int
2695snd_azf3328_suspend(struct device *dev) 2695snd_azf3328_suspend(struct device *dev)
2696{ 2696{
2697 struct pci_dev *pci = to_pci_dev(dev);
2698 struct snd_card *card = dev_get_drvdata(dev); 2697 struct snd_card *card = dev_get_drvdata(dev);
2699 struct snd_azf3328 *chip = card->private_data; 2698 struct snd_azf3328 *chip = card->private_data;
2700 u16 *saved_regs_ctrl_u16; 2699 u16 *saved_regs_ctrl_u16;
@@ -2720,29 +2719,15 @@ snd_azf3328_suspend(struct device *dev)
2720 ARRAY_SIZE(chip->saved_regs_mpu), chip->saved_regs_mpu); 2719 ARRAY_SIZE(chip->saved_regs_mpu), chip->saved_regs_mpu);
2721 snd_azf3328_suspend_regs(chip, chip->opl3_io, 2720 snd_azf3328_suspend_regs(chip, chip->opl3_io,
2722 ARRAY_SIZE(chip->saved_regs_opl3), chip->saved_regs_opl3); 2721 ARRAY_SIZE(chip->saved_regs_opl3), chip->saved_regs_opl3);
2723
2724 pci_disable_device(pci);
2725 pci_save_state(pci);
2726 pci_set_power_state(pci, PCI_D3hot);
2727 return 0; 2722 return 0;
2728} 2723}
2729 2724
2730static int 2725static int
2731snd_azf3328_resume(struct device *dev) 2726snd_azf3328_resume(struct device *dev)
2732{ 2727{
2733 struct pci_dev *pci = to_pci_dev(dev);
2734 struct snd_card *card = dev_get_drvdata(dev); 2728 struct snd_card *card = dev_get_drvdata(dev);
2735 const struct snd_azf3328 *chip = card->private_data; 2729 const struct snd_azf3328 *chip = card->private_data;
2736 2730
2737 pci_set_power_state(pci, PCI_D0);
2738 pci_restore_state(pci);
2739 if (pci_enable_device(pci) < 0) {
2740 dev_err(dev, "pci_enable_device failed, disabling device\n");
2741 snd_card_disconnect(card);
2742 return -EIO;
2743 }
2744 pci_set_master(pci);
2745
2746 snd_azf3328_resume_regs(chip, chip->saved_regs_game, chip->game_io, 2731 snd_azf3328_resume_regs(chip, chip->saved_regs_game, chip->game_io,
2747 ARRAY_SIZE(chip->saved_regs_game)); 2732 ARRAY_SIZE(chip->saved_regs_game));
2748 snd_azf3328_resume_regs(chip, chip->saved_regs_mpu, chip->mpu_io, 2733 snd_azf3328_resume_regs(chip, chip->saved_regs_mpu, chip->mpu_io,
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 96af33965b51..dd75b7536fa2 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1910,7 +1910,6 @@ static void snd_ca0106_remove(struct pci_dev *pci)
1910#ifdef CONFIG_PM_SLEEP 1910#ifdef CONFIG_PM_SLEEP
1911static int snd_ca0106_suspend(struct device *dev) 1911static int snd_ca0106_suspend(struct device *dev)
1912{ 1912{
1913 struct pci_dev *pci = to_pci_dev(dev);
1914 struct snd_card *card = dev_get_drvdata(dev); 1913 struct snd_card *card = dev_get_drvdata(dev);
1915 struct snd_ca0106 *chip = card->private_data; 1914 struct snd_ca0106 *chip = card->private_data;
1916 int i; 1915 int i;
@@ -1923,30 +1922,15 @@ static int snd_ca0106_suspend(struct device *dev)
1923 snd_ca0106_mixer_suspend(chip); 1922 snd_ca0106_mixer_suspend(chip);
1924 1923
1925 ca0106_stop_chip(chip); 1924 ca0106_stop_chip(chip);
1926
1927 pci_disable_device(pci);
1928 pci_save_state(pci);
1929 pci_set_power_state(pci, PCI_D3hot);
1930 return 0; 1925 return 0;
1931} 1926}
1932 1927
1933static int snd_ca0106_resume(struct device *dev) 1928static int snd_ca0106_resume(struct device *dev)
1934{ 1929{
1935 struct pci_dev *pci = to_pci_dev(dev);
1936 struct snd_card *card = dev_get_drvdata(dev); 1930 struct snd_card *card = dev_get_drvdata(dev);
1937 struct snd_ca0106 *chip = card->private_data; 1931 struct snd_ca0106 *chip = card->private_data;
1938 int i; 1932 int i;
1939 1933
1940 pci_set_power_state(pci, PCI_D0);
1941 pci_restore_state(pci);
1942
1943 if (pci_enable_device(pci) < 0) {
1944 snd_card_disconnect(card);
1945 return -EIO;
1946 }
1947
1948 pci_set_master(pci);
1949
1950 ca0106_init_chip(chip, 1); 1934 ca0106_init_chip(chip, 1);
1951 1935
1952 if (chip->details->ac97) 1936 if (chip->details->ac97)
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 85ed40339db9..63d2c8236ec6 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -3347,7 +3347,6 @@ static unsigned char saved_mixers[] = {
3347 3347
3348static int snd_cmipci_suspend(struct device *dev) 3348static int snd_cmipci_suspend(struct device *dev)
3349{ 3349{
3350 struct pci_dev *pci = to_pci_dev(dev);
3351 struct snd_card *card = dev_get_drvdata(dev); 3350 struct snd_card *card = dev_get_drvdata(dev);
3352 struct cmipci *cm = card->private_data; 3351 struct cmipci *cm = card->private_data;
3353 int i; 3352 int i;
@@ -3366,29 +3365,15 @@ static int snd_cmipci_suspend(struct device *dev)
3366 3365
3367 /* disable ints */ 3366 /* disable ints */
3368 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); 3367 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
3369
3370 pci_disable_device(pci);
3371 pci_save_state(pci);
3372 pci_set_power_state(pci, PCI_D3hot);
3373 return 0; 3368 return 0;
3374} 3369}
3375 3370
3376static int snd_cmipci_resume(struct device *dev) 3371static int snd_cmipci_resume(struct device *dev)
3377{ 3372{
3378 struct pci_dev *pci = to_pci_dev(dev);
3379 struct snd_card *card = dev_get_drvdata(dev); 3373 struct snd_card *card = dev_get_drvdata(dev);
3380 struct cmipci *cm = card->private_data; 3374 struct cmipci *cm = card->private_data;
3381 int i; 3375 int i;
3382 3376
3383 pci_set_power_state(pci, PCI_D0);
3384 pci_restore_state(pci);
3385 if (pci_enable_device(pci) < 0) {
3386 dev_err(dev, "pci_enable_device failed, disabling device\n");
3387 snd_card_disconnect(card);
3388 return -EIO;
3389 }
3390 pci_set_master(pci);
3391
3392 /* reset / initialize to a sane state */ 3377 /* reset / initialize to a sane state */
3393 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); 3378 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
3394 snd_cmipci_ch_reset(cm, CM_CH_PLAY); 3379 snd_cmipci_ch_reset(cm, CM_CH_PLAY);
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ea339111c59f..754613b772ab 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -1996,7 +1996,6 @@ static int saved_regs[SUSPEND_REGISTERS] = {
1996 1996
1997static int cs4281_suspend(struct device *dev) 1997static int cs4281_suspend(struct device *dev)
1998{ 1998{
1999 struct pci_dev *pci = to_pci_dev(dev);
2000 struct snd_card *card = dev_get_drvdata(dev); 1999 struct snd_card *card = dev_get_drvdata(dev);
2001 struct cs4281 *chip = card->private_data; 2000 struct cs4281 *chip = card->private_data;
2002 u32 ulCLK; 2001 u32 ulCLK;
@@ -2035,30 +2034,16 @@ static int cs4281_suspend(struct device *dev)
2035 ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1); 2034 ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
2036 ulCLK &= ~CLKCR1_CKRA; 2035 ulCLK &= ~CLKCR1_CKRA;
2037 snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK); 2036 snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
2038
2039 pci_disable_device(pci);
2040 pci_save_state(pci);
2041 pci_set_power_state(pci, PCI_D3hot);
2042 return 0; 2037 return 0;
2043} 2038}
2044 2039
2045static int cs4281_resume(struct device *dev) 2040static int cs4281_resume(struct device *dev)
2046{ 2041{
2047 struct pci_dev *pci = to_pci_dev(dev);
2048 struct snd_card *card = dev_get_drvdata(dev); 2042 struct snd_card *card = dev_get_drvdata(dev);
2049 struct cs4281 *chip = card->private_data; 2043 struct cs4281 *chip = card->private_data;
2050 unsigned int i; 2044 unsigned int i;
2051 u32 ulCLK; 2045 u32 ulCLK;
2052 2046
2053 pci_set_power_state(pci, PCI_D0);
2054 pci_restore_state(pci);
2055 if (pci_enable_device(pci) < 0) {
2056 dev_err(dev, "pci_enable_device failed, disabling device\n");
2057 snd_card_disconnect(card);
2058 return -EIO;
2059 }
2060 pci_set_master(pci);
2061
2062 ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1); 2047 ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
2063 ulCLK |= CLKCR1_CKRA; 2048 ulCLK |= CLKCR1_CKRA;
2064 snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK); 2049 snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 128bbfe80aa7..fb3abb2203cd 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -3774,7 +3774,6 @@ static unsigned int saved_regs[] = {
3774 3774
3775static int snd_cs46xx_suspend(struct device *dev) 3775static int snd_cs46xx_suspend(struct device *dev)
3776{ 3776{
3777 struct pci_dev *pci = to_pci_dev(dev);
3778 struct snd_card *card = dev_get_drvdata(dev); 3777 struct snd_card *card = dev_get_drvdata(dev);
3779 struct snd_cs46xx *chip = card->private_data; 3778 struct snd_cs46xx *chip = card->private_data;
3780 int i, amp_saved; 3779 int i, amp_saved;
@@ -3799,16 +3798,11 @@ static int snd_cs46xx_suspend(struct device *dev)
3799 /* disable CLKRUN */ 3798 /* disable CLKRUN */
3800 chip->active_ctrl(chip, -chip->amplifier); 3799 chip->active_ctrl(chip, -chip->amplifier);
3801 chip->amplifier = amp_saved; /* restore the status */ 3800 chip->amplifier = amp_saved; /* restore the status */
3802
3803 pci_disable_device(pci);
3804 pci_save_state(pci);
3805 pci_set_power_state(pci, PCI_D3hot);
3806 return 0; 3801 return 0;
3807} 3802}
3808 3803
3809static int snd_cs46xx_resume(struct device *dev) 3804static int snd_cs46xx_resume(struct device *dev)
3810{ 3805{
3811 struct pci_dev *pci = to_pci_dev(dev);
3812 struct snd_card *card = dev_get_drvdata(dev); 3806 struct snd_card *card = dev_get_drvdata(dev);
3813 struct snd_cs46xx *chip = card->private_data; 3807 struct snd_cs46xx *chip = card->private_data;
3814 int amp_saved; 3808 int amp_saved;
@@ -3817,15 +3811,6 @@ static int snd_cs46xx_resume(struct device *dev)
3817#endif 3811#endif
3818 unsigned int tmp; 3812 unsigned int tmp;
3819 3813
3820 pci_set_power_state(pci, PCI_D0);
3821 pci_restore_state(pci);
3822 if (pci_enable_device(pci) < 0) {
3823 dev_err(dev, "pci_enable_device failed, disabling device\n");
3824 snd_card_disconnect(card);
3825 return -EIO;
3826 }
3827 pci_set_master(pci);
3828
3829 amp_saved = chip->amplifier; 3814 amp_saved = chip->amplifier;
3830 chip->amplifier = 0; 3815 chip->amplifier = 0;
3831 chip->active_ctrl(chip, 1); /* force to on */ 3816 chip->active_ctrl(chip, 1); /* force to on */
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 34cc60057d0c..06ac5d8da362 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -57,7 +57,6 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
57 57
58static int snd_cs5535audio_suspend(struct device *dev) 58static int snd_cs5535audio_suspend(struct device *dev)
59{ 59{
60 struct pci_dev *pci = to_pci_dev(dev);
61 struct snd_card *card = dev_get_drvdata(dev); 60 struct snd_card *card = dev_get_drvdata(dev);
62 struct cs5535audio *cs5535au = card->private_data; 61 struct cs5535audio *cs5535au = card->private_data;
63 int i; 62 int i;
@@ -72,34 +71,17 @@ static int snd_cs5535audio_suspend(struct device *dev)
72 } 71 }
73 /* save important regs, then disable aclink in hw */ 72 /* save important regs, then disable aclink in hw */
74 snd_cs5535audio_stop_hardware(cs5535au); 73 snd_cs5535audio_stop_hardware(cs5535au);
75
76 if (pci_save_state(pci)) {
77 dev_err(dev, "pci_save_state failed!\n");
78 return -EIO;
79 }
80 pci_disable_device(pci);
81 pci_set_power_state(pci, PCI_D3hot);
82 return 0; 74 return 0;
83} 75}
84 76
85static int snd_cs5535audio_resume(struct device *dev) 77static int snd_cs5535audio_resume(struct device *dev)
86{ 78{
87 struct pci_dev *pci = to_pci_dev(dev);
88 struct snd_card *card = dev_get_drvdata(dev); 79 struct snd_card *card = dev_get_drvdata(dev);
89 struct cs5535audio *cs5535au = card->private_data; 80 struct cs5535audio *cs5535au = card->private_data;
90 u32 tmp; 81 u32 tmp;
91 int timeout; 82 int timeout;
92 int i; 83 int i;
93 84
94 pci_set_power_state(pci, PCI_D0);
95 pci_restore_state(pci);
96 if (pci_enable_device(pci) < 0) {
97 dev_err(dev, "pci_enable_device failed, disabling device\n");
98 snd_card_disconnect(card);
99 return -EIO;
100 }
101 pci_set_master(pci);
102
103 /* set LNK_WRM_RST to reset AC link */ 85 /* set LNK_WRM_RST to reset AC link */
104 cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_WRM_RST); 86 cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_WRM_RST);
105 87
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index b8b0d8ef9319..1cac55fd1139 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -2096,20 +2096,11 @@ static int hw_suspend(struct hw *hw)
2096 pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0); 2096 pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0);
2097 } 2097 }
2098 2098
2099 pci_disable_device(pci);
2100 pci_save_state(pci);
2101 pci_set_power_state(pci, PCI_D3hot);
2102
2103 return 0; 2099 return 0;
2104} 2100}
2105 2101
2106static int hw_resume(struct hw *hw, struct card_conf *info) 2102static int hw_resume(struct hw *hw, struct card_conf *info)
2107{ 2103{
2108 struct pci_dev *pci = hw->pci;
2109
2110 pci_set_power_state(pci, PCI_D0);
2111 pci_restore_state(pci);
2112
2113 /* Re-initialize card hardware. */ 2104 /* Re-initialize card hardware. */
2114 return hw_card_init(hw, info); 2105 return hw_card_init(hw, info);
2115} 2106}
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 4e16b4d05eed..955ad871e9a8 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -2206,24 +2206,12 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
2206#ifdef CONFIG_PM_SLEEP 2206#ifdef CONFIG_PM_SLEEP
2207static int hw_suspend(struct hw *hw) 2207static int hw_suspend(struct hw *hw)
2208{ 2208{
2209 struct pci_dev *pci = hw->pci;
2210
2211 hw_card_stop(hw); 2209 hw_card_stop(hw);
2212
2213 pci_disable_device(pci);
2214 pci_save_state(pci);
2215 pci_set_power_state(pci, PCI_D3hot);
2216
2217 return 0; 2210 return 0;
2218} 2211}
2219 2212
2220static int hw_resume(struct hw *hw, struct card_conf *info) 2213static int hw_resume(struct hw *hw, struct card_conf *info)
2221{ 2214{
2222 struct pci_dev *pci = hw->pci;
2223
2224 pci_set_power_state(pci, PCI_D0);
2225 pci_restore_state(pci);
2226
2227 /* Re-initialize card hardware. */ 2215 /* Re-initialize card hardware. */
2228 return hw_card_init(hw, info); 2216 return hw_card_init(hw, info);
2229} 2217}
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 98d4f35cff2e..a962de03ebb6 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -2158,7 +2158,6 @@ ctl_error:
2158 2158
2159static int snd_echo_suspend(struct device *dev) 2159static int snd_echo_suspend(struct device *dev)
2160{ 2160{
2161 struct pci_dev *pci = to_pci_dev(dev);
2162 struct echoaudio *chip = dev_get_drvdata(dev); 2161 struct echoaudio *chip = dev_get_drvdata(dev);
2163 2162
2164 snd_pcm_suspend_all(chip->analog_pcm); 2163 snd_pcm_suspend_all(chip->analog_pcm);
@@ -2184,9 +2183,6 @@ static int snd_echo_suspend(struct device *dev)
2184 chip->dsp_code = NULL; 2183 chip->dsp_code = NULL;
2185 free_irq(chip->irq, chip); 2184 free_irq(chip->irq, chip);
2186 chip->irq = -1; 2185 chip->irq = -1;
2187 pci_save_state(pci);
2188 pci_disable_device(pci);
2189
2190 return 0; 2186 return 0;
2191} 2187}
2192 2188
@@ -2200,7 +2196,6 @@ static int snd_echo_resume(struct device *dev)
2200 u32 pipe_alloc_mask; 2196 u32 pipe_alloc_mask;
2201 int err; 2197 int err;
2202 2198
2203 pci_restore_state(pci);
2204 commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL); 2199 commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL);
2205 if (commpage_bak == NULL) 2200 if (commpage_bak == NULL)
2206 return -ENOMEM; 2201 return -ENOMEM;
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index a3c00a668268..37d0220a094c 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -210,7 +210,6 @@ static void snd_card_emu10k1_remove(struct pci_dev *pci)
210#ifdef CONFIG_PM_SLEEP 210#ifdef CONFIG_PM_SLEEP
211static int snd_emu10k1_suspend(struct device *dev) 211static int snd_emu10k1_suspend(struct device *dev)
212{ 212{
213 struct pci_dev *pci = to_pci_dev(dev);
214 struct snd_card *card = dev_get_drvdata(dev); 213 struct snd_card *card = dev_get_drvdata(dev);
215 struct snd_emu10k1 *emu = card->private_data; 214 struct snd_emu10k1 *emu = card->private_data;
216 215
@@ -232,28 +231,14 @@ static int snd_emu10k1_suspend(struct device *dev)
232 snd_p16v_suspend(emu); 231 snd_p16v_suspend(emu);
233 232
234 snd_emu10k1_done(emu); 233 snd_emu10k1_done(emu);
235
236 pci_disable_device(pci);
237 pci_save_state(pci);
238 pci_set_power_state(pci, PCI_D3hot);
239 return 0; 234 return 0;
240} 235}
241 236
242static int snd_emu10k1_resume(struct device *dev) 237static int snd_emu10k1_resume(struct device *dev)
243{ 238{
244 struct pci_dev *pci = to_pci_dev(dev);
245 struct snd_card *card = dev_get_drvdata(dev); 239 struct snd_card *card = dev_get_drvdata(dev);
246 struct snd_emu10k1 *emu = card->private_data; 240 struct snd_emu10k1 *emu = card->private_data;
247 241
248 pci_set_power_state(pci, PCI_D0);
249 pci_restore_state(pci);
250 if (pci_enable_device(pci) < 0) {
251 dev_err(dev, "pci_enable_device failed, disabling device\n");
252 snd_card_disconnect(card);
253 return -EIO;
254 }
255 pci_set_master(pci);
256
257 snd_emu10k1_resume_init(emu); 242 snd_emu10k1_resume_init(emu);
258 snd_emu10k1_efx_resume(emu); 243 snd_emu10k1_efx_resume(emu);
259 snd_ac97_resume(emu->ac97); 244 snd_ac97_resume(emu->ac97);
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index bb1f4d22df5f..219b8af29a49 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -2033,7 +2033,6 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq)
2033#ifdef CONFIG_PM_SLEEP 2033#ifdef CONFIG_PM_SLEEP
2034static int snd_ensoniq_suspend(struct device *dev) 2034static int snd_ensoniq_suspend(struct device *dev)
2035{ 2035{
2036 struct pci_dev *pci = to_pci_dev(dev);
2037 struct snd_card *card = dev_get_drvdata(dev); 2036 struct snd_card *card = dev_get_drvdata(dev);
2038 struct ensoniq *ensoniq = card->private_data; 2037 struct ensoniq *ensoniq = card->private_data;
2039 2038
@@ -2054,28 +2053,14 @@ static int snd_ensoniq_suspend(struct device *dev)
2054 udelay(100); 2053 udelay(100);
2055 snd_ak4531_suspend(ensoniq->u.es1370.ak4531); 2054 snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
2056#endif 2055#endif
2057
2058 pci_disable_device(pci);
2059 pci_save_state(pci);
2060 pci_set_power_state(pci, PCI_D3hot);
2061 return 0; 2056 return 0;
2062} 2057}
2063 2058
2064static int snd_ensoniq_resume(struct device *dev) 2059static int snd_ensoniq_resume(struct device *dev)
2065{ 2060{
2066 struct pci_dev *pci = to_pci_dev(dev);
2067 struct snd_card *card = dev_get_drvdata(dev); 2061 struct snd_card *card = dev_get_drvdata(dev);
2068 struct ensoniq *ensoniq = card->private_data; 2062 struct ensoniq *ensoniq = card->private_data;
2069 2063
2070 pci_set_power_state(pci, PCI_D0);
2071 pci_restore_state(pci);
2072 if (pci_enable_device(pci) < 0) {
2073 dev_err(dev, "pci_enable_device failed, disabling device\n");
2074 snd_card_disconnect(card);
2075 return -EIO;
2076 }
2077 pci_set_master(pci);
2078
2079 snd_ensoniq_chip_init(ensoniq); 2064 snd_ensoniq_chip_init(ensoniq);
2080 2065
2081#ifdef CHIP1371 2066#ifdef CHIP1371
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 0fc46eb4e251..a01454b545a0 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1454,7 +1454,6 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = {
1454 1454
1455static int es1938_suspend(struct device *dev) 1455static int es1938_suspend(struct device *dev)
1456{ 1456{
1457 struct pci_dev *pci = to_pci_dev(dev);
1458 struct snd_card *card = dev_get_drvdata(dev); 1457 struct snd_card *card = dev_get_drvdata(dev);
1459 struct es1938 *chip = card->private_data; 1458 struct es1938 *chip = card->private_data;
1460 unsigned char *s, *d; 1459 unsigned char *s, *d;
@@ -1471,9 +1470,6 @@ static int es1938_suspend(struct device *dev)
1471 free_irq(chip->irq, chip); 1470 free_irq(chip->irq, chip);
1472 chip->irq = -1; 1471 chip->irq = -1;
1473 } 1472 }
1474 pci_disable_device(pci);
1475 pci_save_state(pci);
1476 pci_set_power_state(pci, PCI_D3hot);
1477 return 0; 1473 return 0;
1478} 1474}
1479 1475
@@ -1484,14 +1480,6 @@ static int es1938_resume(struct device *dev)
1484 struct es1938 *chip = card->private_data; 1480 struct es1938 *chip = card->private_data;
1485 unsigned char *s, *d; 1481 unsigned char *s, *d;
1486 1482
1487 pci_set_power_state(pci, PCI_D0);
1488 pci_restore_state(pci);
1489 if (pci_enable_device(pci) < 0) {
1490 dev_err(dev, "pci_enable_device failed, disabling device\n");
1491 snd_card_disconnect(card);
1492 return -EIO;
1493 }
1494
1495 if (request_irq(pci->irq, snd_es1938_interrupt, 1483 if (request_irq(pci->irq, snd_es1938_interrupt,
1496 IRQF_SHARED, KBUILD_MODNAME, chip)) { 1484 IRQF_SHARED, KBUILD_MODNAME, chip)) {
1497 dev_err(dev, "unable to grab IRQ %d, disabling device\n", 1485 dev_err(dev, "unable to grab IRQ %d, disabling device\n",
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 6039700f8579..631be029f8c0 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2383,7 +2383,6 @@ static void snd_es1968_start_irq(struct es1968 *chip)
2383 */ 2383 */
2384static int es1968_suspend(struct device *dev) 2384static int es1968_suspend(struct device *dev)
2385{ 2385{
2386 struct pci_dev *pci = to_pci_dev(dev);
2387 struct snd_card *card = dev_get_drvdata(dev); 2386 struct snd_card *card = dev_get_drvdata(dev);
2388 struct es1968 *chip = card->private_data; 2387 struct es1968 *chip = card->private_data;
2389 2388
@@ -2396,16 +2395,11 @@ static int es1968_suspend(struct device *dev)
2396 snd_pcm_suspend_all(chip->pcm); 2395 snd_pcm_suspend_all(chip->pcm);
2397 snd_ac97_suspend(chip->ac97); 2396 snd_ac97_suspend(chip->ac97);
2398 snd_es1968_bob_stop(chip); 2397 snd_es1968_bob_stop(chip);
2399
2400 pci_disable_device(pci);
2401 pci_save_state(pci);
2402 pci_set_power_state(pci, PCI_D3hot);
2403 return 0; 2398 return 0;
2404} 2399}
2405 2400
2406static int es1968_resume(struct device *dev) 2401static int es1968_resume(struct device *dev)
2407{ 2402{
2408 struct pci_dev *pci = to_pci_dev(dev);
2409 struct snd_card *card = dev_get_drvdata(dev); 2403 struct snd_card *card = dev_get_drvdata(dev);
2410 struct es1968 *chip = card->private_data; 2404 struct es1968 *chip = card->private_data;
2411 struct esschan *es; 2405 struct esschan *es;
@@ -2413,16 +2407,6 @@ static int es1968_resume(struct device *dev)
2413 if (! chip->do_pm) 2407 if (! chip->do_pm)
2414 return 0; 2408 return 0;
2415 2409
2416 /* restore all our config */
2417 pci_set_power_state(pci, PCI_D0);
2418 pci_restore_state(pci);
2419 if (pci_enable_device(pci) < 0) {
2420 dev_err(dev, "pci_enable_device failed, disabling device\n");
2421 snd_card_disconnect(card);
2422 return -EIO;
2423 }
2424 pci_set_master(pci);
2425
2426 snd_es1968_chip_init(chip); 2410 snd_es1968_chip_init(chip);
2427 2411
2428 /* need to restore the base pointers.. */ 2412 /* need to restore the base pointers.. */
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 46ac399d2f88..52555bdaf91c 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1367,7 +1367,6 @@ static unsigned char saved_regs[] = {
1367 1367
1368static int snd_fm801_suspend(struct device *dev) 1368static int snd_fm801_suspend(struct device *dev)
1369{ 1369{
1370 struct pci_dev *pci = to_pci_dev(dev);
1371 struct snd_card *card = dev_get_drvdata(dev); 1370 struct snd_card *card = dev_get_drvdata(dev);
1372 struct fm801 *chip = card->private_data; 1371 struct fm801 *chip = card->private_data;
1373 int i; 1372 int i;
@@ -1379,29 +1378,15 @@ static int snd_fm801_suspend(struct device *dev)
1379 for (i = 0; i < ARRAY_SIZE(saved_regs); i++) 1378 for (i = 0; i < ARRAY_SIZE(saved_regs); i++)
1380 chip->saved_regs[i] = inw(chip->port + saved_regs[i]); 1379 chip->saved_regs[i] = inw(chip->port + saved_regs[i]);
1381 /* FIXME: tea575x suspend */ 1380 /* FIXME: tea575x suspend */
1382
1383 pci_disable_device(pci);
1384 pci_save_state(pci);
1385 pci_set_power_state(pci, PCI_D3hot);
1386 return 0; 1381 return 0;
1387} 1382}
1388 1383
1389static int snd_fm801_resume(struct device *dev) 1384static int snd_fm801_resume(struct device *dev)
1390{ 1385{
1391 struct pci_dev *pci = to_pci_dev(dev);
1392 struct snd_card *card = dev_get_drvdata(dev); 1386 struct snd_card *card = dev_get_drvdata(dev);
1393 struct fm801 *chip = card->private_data; 1387 struct fm801 *chip = card->private_data;
1394 int i; 1388 int i;
1395 1389
1396 pci_set_power_state(pci, PCI_D0);
1397 pci_restore_state(pci);
1398 if (pci_enable_device(pci) < 0) {
1399 dev_err(dev, "pci_enable_device failed, disabling device\n");
1400 snd_card_disconnect(card);
1401 return -EIO;
1402 }
1403 pci_set_master(pci);
1404
1405 snd_fm801_chip_init(chip, 1); 1390 snd_fm801_chip_init(chip, 1);
1406 snd_ac97_resume(chip->ac97); 1391 snd_ac97_resume(chip->ac97);
1407 snd_ac97_resume(chip->ac97_sec); 1392 snd_ac97_resume(chip->ac97_sec);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index a9714251b159..23b35687025a 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -795,7 +795,6 @@ static int param_set_xint(const char *val, const struct kernel_param *kp)
795 */ 795 */
796static int azx_suspend(struct device *dev) 796static int azx_suspend(struct device *dev)
797{ 797{
798 struct pci_dev *pci = to_pci_dev(dev);
799 struct snd_card *card = dev_get_drvdata(dev); 798 struct snd_card *card = dev_get_drvdata(dev);
800 struct azx *chip; 799 struct azx *chip;
801 struct hda_intel *hda; 800 struct hda_intel *hda;
@@ -824,9 +823,6 @@ static int azx_suspend(struct device *dev)
824 823
825 if (chip->msi) 824 if (chip->msi)
826 pci_disable_msi(chip->pci); 825 pci_disable_msi(chip->pci);
827 pci_disable_device(pci);
828 pci_save_state(pci);
829 pci_set_power_state(pci, PCI_D3hot);
830 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 826 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
831 hda_display_power(false); 827 hda_display_power(false);
832 return 0; 828 return 0;
@@ -851,15 +847,6 @@ static int azx_resume(struct device *dev)
851 hda_display_power(true); 847 hda_display_power(true);
852 haswell_set_bclk(chip); 848 haswell_set_bclk(chip);
853 } 849 }
854 pci_set_power_state(pci, PCI_D0);
855 pci_restore_state(pci);
856 if (pci_enable_device(pci) < 0) {
857 dev_err(chip->card->dev,
858 "pci_enable_device failed, disabling device\n");
859 snd_card_disconnect(card);
860 return -EIO;
861 }
862 pci_set_master(pci);
863 if (chip->msi) 850 if (chip->msi)
864 if (pci_enable_msi(pci) < 0) 851 if (pci_enable_msi(pci) < 0)
865 chip->msi = 0; 852 chip->msi = 0;
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index a2ee29826d0d..f7b1523e8a82 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2784,7 +2784,6 @@ static void snd_ice1712_remove(struct pci_dev *pci)
2784#ifdef CONFIG_PM_SLEEP 2784#ifdef CONFIG_PM_SLEEP
2785static int snd_ice1712_suspend(struct device *dev) 2785static int snd_ice1712_suspend(struct device *dev)
2786{ 2786{
2787 struct pci_dev *pci = to_pci_dev(dev);
2788 struct snd_card *card = dev_get_drvdata(dev); 2787 struct snd_card *card = dev_get_drvdata(dev);
2789 struct snd_ice1712 *ice = card->private_data; 2788 struct snd_ice1712 *ice = card->private_data;
2790 2789
@@ -2806,16 +2805,11 @@ static int snd_ice1712_suspend(struct device *dev)
2806 2805
2807 if (ice->pm_suspend) 2806 if (ice->pm_suspend)
2808 ice->pm_suspend(ice); 2807 ice->pm_suspend(ice);
2809
2810 pci_disable_device(pci);
2811 pci_save_state(pci);
2812 pci_set_power_state(pci, PCI_D3hot);
2813 return 0; 2808 return 0;
2814} 2809}
2815 2810
2816static int snd_ice1712_resume(struct device *dev) 2811static int snd_ice1712_resume(struct device *dev)
2817{ 2812{
2818 struct pci_dev *pci = to_pci_dev(dev);
2819 struct snd_card *card = dev_get_drvdata(dev); 2813 struct snd_card *card = dev_get_drvdata(dev);
2820 struct snd_ice1712 *ice = card->private_data; 2814 struct snd_ice1712 *ice = card->private_data;
2821 int rate; 2815 int rate;
@@ -2823,16 +2817,6 @@ static int snd_ice1712_resume(struct device *dev)
2823 if (!ice->pm_suspend_enabled) 2817 if (!ice->pm_suspend_enabled)
2824 return 0; 2818 return 0;
2825 2819
2826 pci_set_power_state(pci, PCI_D0);
2827 pci_restore_state(pci);
2828
2829 if (pci_enable_device(pci) < 0) {
2830 snd_card_disconnect(card);
2831 return -EIO;
2832 }
2833
2834 pci_set_master(pci);
2835
2836 if (ice->cur_rate) 2820 if (ice->cur_rate)
2837 rate = ice->cur_rate; 2821 rate = ice->cur_rate;
2838 else 2822 else
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index d73da157ea14..0b22c00642bb 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -2798,7 +2798,6 @@ static void snd_vt1724_remove(struct pci_dev *pci)
2798#ifdef CONFIG_PM_SLEEP 2798#ifdef CONFIG_PM_SLEEP
2799static int snd_vt1724_suspend(struct device *dev) 2799static int snd_vt1724_suspend(struct device *dev)
2800{ 2800{
2801 struct pci_dev *pci = to_pci_dev(dev);
2802 struct snd_card *card = dev_get_drvdata(dev); 2801 struct snd_card *card = dev_get_drvdata(dev);
2803 struct snd_ice1712 *ice = card->private_data; 2802 struct snd_ice1712 *ice = card->private_data;
2804 2803
@@ -2821,32 +2820,17 @@ static int snd_vt1724_suspend(struct device *dev)
2821 2820
2822 if (ice->pm_suspend) 2821 if (ice->pm_suspend)
2823 ice->pm_suspend(ice); 2822 ice->pm_suspend(ice);
2824
2825 pci_disable_device(pci);
2826 pci_save_state(pci);
2827 pci_set_power_state(pci, PCI_D3hot);
2828 return 0; 2823 return 0;
2829} 2824}
2830 2825
2831static int snd_vt1724_resume(struct device *dev) 2826static int snd_vt1724_resume(struct device *dev)
2832{ 2827{
2833 struct pci_dev *pci = to_pci_dev(dev);
2834 struct snd_card *card = dev_get_drvdata(dev); 2828 struct snd_card *card = dev_get_drvdata(dev);
2835 struct snd_ice1712 *ice = card->private_data; 2829 struct snd_ice1712 *ice = card->private_data;
2836 2830
2837 if (!ice->pm_suspend_enabled) 2831 if (!ice->pm_suspend_enabled)
2838 return 0; 2832 return 0;
2839 2833
2840 pci_set_power_state(pci, PCI_D0);
2841 pci_restore_state(pci);
2842
2843 if (pci_enable_device(pci) < 0) {
2844 snd_card_disconnect(card);
2845 return -EIO;
2846 }
2847
2848 pci_set_master(pci);
2849
2850 snd_vt1724_chip_reset(ice); 2834 snd_vt1724_chip_reset(ice);
2851 2835
2852 if (snd_vt1724_chip_init(ice) < 0) { 2836 if (snd_vt1724_chip_init(ice) < 0) {
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 4a28252a42b9..67f9e8b77385 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2654,7 +2654,6 @@ static int snd_intel8x0_free(struct intel8x0 *chip)
2654 */ 2654 */
2655static int intel8x0_suspend(struct device *dev) 2655static int intel8x0_suspend(struct device *dev)
2656{ 2656{
2657 struct pci_dev *pci = to_pci_dev(dev);
2658 struct snd_card *card = dev_get_drvdata(dev); 2657 struct snd_card *card = dev_get_drvdata(dev);
2659 struct intel8x0 *chip = card->private_data; 2658 struct intel8x0 *chip = card->private_data;
2660 int i; 2659 int i;
@@ -2682,12 +2681,6 @@ static int intel8x0_suspend(struct device *dev)
2682 free_irq(chip->irq, chip); 2681 free_irq(chip->irq, chip);
2683 chip->irq = -1; 2682 chip->irq = -1;
2684 } 2683 }
2685 pci_disable_device(pci);
2686 pci_save_state(pci);
2687 /* The call below may disable built-in speaker on some laptops
2688 * after S2RAM. So, don't touch it.
2689 */
2690 /* pci_set_power_state(pci, PCI_D3hot); */
2691 return 0; 2684 return 0;
2692} 2685}
2693 2686
@@ -2698,14 +2691,6 @@ static int intel8x0_resume(struct device *dev)
2698 struct intel8x0 *chip = card->private_data; 2691 struct intel8x0 *chip = card->private_data;
2699 int i; 2692 int i;
2700 2693
2701 pci_set_power_state(pci, PCI_D0);
2702 pci_restore_state(pci);
2703 if (pci_enable_device(pci) < 0) {
2704 dev_err(dev, "pci_enable_device failed, disabling device\n");
2705 snd_card_disconnect(card);
2706 return -EIO;
2707 }
2708 pci_set_master(pci);
2709 snd_intel8x0_chip_init(chip, 0); 2694 snd_intel8x0_chip_init(chip, 0);
2710 if (request_irq(pci->irq, snd_intel8x0_interrupt, 2695 if (request_irq(pci->irq, snd_intel8x0_interrupt,
2711 IRQF_SHARED, KBUILD_MODNAME, chip)) { 2696 IRQF_SHARED, KBUILD_MODNAME, chip)) {
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 6b40235be13c..748f6f67c982 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -1023,7 +1023,6 @@ static int snd_intel8x0m_free(struct intel8x0m *chip)
1023 */ 1023 */
1024static int intel8x0m_suspend(struct device *dev) 1024static int intel8x0m_suspend(struct device *dev)
1025{ 1025{
1026 struct pci_dev *pci = to_pci_dev(dev);
1027 struct snd_card *card = dev_get_drvdata(dev); 1026 struct snd_card *card = dev_get_drvdata(dev);
1028 struct intel8x0m *chip = card->private_data; 1027 struct intel8x0m *chip = card->private_data;
1029 int i; 1028 int i;
@@ -1036,9 +1035,6 @@ static int intel8x0m_suspend(struct device *dev)
1036 free_irq(chip->irq, chip); 1035 free_irq(chip->irq, chip);
1037 chip->irq = -1; 1036 chip->irq = -1;
1038 } 1037 }
1039 pci_disable_device(pci);
1040 pci_save_state(pci);
1041 pci_set_power_state(pci, PCI_D3hot);
1042 return 0; 1038 return 0;
1043} 1039}
1044 1040
@@ -1048,14 +1044,6 @@ static int intel8x0m_resume(struct device *dev)
1048 struct snd_card *card = dev_get_drvdata(dev); 1044 struct snd_card *card = dev_get_drvdata(dev);
1049 struct intel8x0m *chip = card->private_data; 1045 struct intel8x0m *chip = card->private_data;
1050 1046
1051 pci_set_power_state(pci, PCI_D0);
1052 pci_restore_state(pci);
1053 if (pci_enable_device(pci) < 0) {
1054 dev_err(dev, "pci_enable_device failed, disabling device\n");
1055 snd_card_disconnect(card);
1056 return -EIO;
1057 }
1058 pci_set_master(pci);
1059 if (request_irq(pci->irq, snd_intel8x0m_interrupt, 1047 if (request_irq(pci->irq, snd_intel8x0m_interrupt,
1060 IRQF_SHARED, KBUILD_MODNAME, chip)) { 1048 IRQF_SHARED, KBUILD_MODNAME, chip)) {
1061 dev_err(dev, "unable to grab IRQ %d, disabling device\n", 1049 dev_err(dev, "unable to grab IRQ %d, disabling device\n",
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 98823d11d485..18a60be63266 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2395,7 +2395,6 @@ static int snd_m3_free(struct snd_m3 *chip)
2395#ifdef CONFIG_PM_SLEEP 2395#ifdef CONFIG_PM_SLEEP
2396static int m3_suspend(struct device *dev) 2396static int m3_suspend(struct device *dev)
2397{ 2397{
2398 struct pci_dev *pci = to_pci_dev(dev);
2399 struct snd_card *card = dev_get_drvdata(dev); 2398 struct snd_card *card = dev_get_drvdata(dev);
2400 struct snd_m3 *chip = card->private_data; 2399 struct snd_m3 *chip = card->private_data;
2401 int i, dsp_index; 2400 int i, dsp_index;
@@ -2421,16 +2420,11 @@ static int m3_suspend(struct device *dev)
2421 for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++) 2420 for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
2422 chip->suspend_mem[dsp_index++] = 2421 chip->suspend_mem[dsp_index++] =
2423 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i); 2422 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
2424
2425 pci_disable_device(pci);
2426 pci_save_state(pci);
2427 pci_set_power_state(pci, PCI_D3hot);
2428 return 0; 2423 return 0;
2429} 2424}
2430 2425
2431static int m3_resume(struct device *dev) 2426static int m3_resume(struct device *dev)
2432{ 2427{
2433 struct pci_dev *pci = to_pci_dev(dev);
2434 struct snd_card *card = dev_get_drvdata(dev); 2428 struct snd_card *card = dev_get_drvdata(dev);
2435 struct snd_m3 *chip = card->private_data; 2429 struct snd_m3 *chip = card->private_data;
2436 int i, dsp_index; 2430 int i, dsp_index;
@@ -2438,15 +2432,6 @@ static int m3_resume(struct device *dev)
2438 if (chip->suspend_mem == NULL) 2432 if (chip->suspend_mem == NULL)
2439 return 0; 2433 return 0;
2440 2434
2441 pci_set_power_state(pci, PCI_D0);
2442 pci_restore_state(pci);
2443 if (pci_enable_device(pci) < 0) {
2444 dev_err(dev, "pci_enable_device failed, disabling device\n");
2445 snd_card_disconnect(card);
2446 return -EIO;
2447 }
2448 pci_set_master(pci);
2449
2450 /* first lets just bring everything back. .*/ 2435 /* first lets just bring everything back. .*/
2451 snd_m3_outw(chip, 0, 0x54); 2436 snd_m3_outw(chip, 0, 0x54);
2452 snd_m3_outw(chip, 0, 0x56); 2437 snd_m3_outw(chip, 0, 0x56);
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 3f52a44143a5..90674b93b930 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1392,7 +1392,6 @@ snd_nm256_peek_for_sig(struct nm256 *chip)
1392 */ 1392 */
1393static int nm256_suspend(struct device *dev) 1393static int nm256_suspend(struct device *dev)
1394{ 1394{
1395 struct pci_dev *pci = to_pci_dev(dev);
1396 struct snd_card *card = dev_get_drvdata(dev); 1395 struct snd_card *card = dev_get_drvdata(dev);
1397 struct nm256 *chip = card->private_data; 1396 struct nm256 *chip = card->private_data;
1398 1397
@@ -1400,15 +1399,11 @@ static int nm256_suspend(struct device *dev)
1400 snd_pcm_suspend_all(chip->pcm); 1399 snd_pcm_suspend_all(chip->pcm);
1401 snd_ac97_suspend(chip->ac97); 1400 snd_ac97_suspend(chip->ac97);
1402 chip->coeffs_current = 0; 1401 chip->coeffs_current = 0;
1403 pci_disable_device(pci);
1404 pci_save_state(pci);
1405 pci_set_power_state(pci, PCI_D3hot);
1406 return 0; 1402 return 0;
1407} 1403}
1408 1404
1409static int nm256_resume(struct device *dev) 1405static int nm256_resume(struct device *dev)
1410{ 1406{
1411 struct pci_dev *pci = to_pci_dev(dev);
1412 struct snd_card *card = dev_get_drvdata(dev); 1407 struct snd_card *card = dev_get_drvdata(dev);
1413 struct nm256 *chip = card->private_data; 1408 struct nm256 *chip = card->private_data;
1414 int i; 1409 int i;
@@ -1416,15 +1411,6 @@ static int nm256_resume(struct device *dev)
1416 /* Perform a full reset on the hardware */ 1411 /* Perform a full reset on the hardware */
1417 chip->in_resume = 1; 1412 chip->in_resume = 1;
1418 1413
1419 pci_set_power_state(pci, PCI_D0);
1420 pci_restore_state(pci);
1421 if (pci_enable_device(pci) < 0) {
1422 dev_err(dev, "pci_enable_device failed, disabling device\n");
1423 snd_card_disconnect(card);
1424 return -EIO;
1425 }
1426 pci_set_master(pci);
1427
1428 snd_nm256_init_chip(chip); 1414 snd_nm256_init_chip(chip);
1429 1415
1430 /* restore ac97 */ 1416 /* restore ac97 */
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index 61a62c0d3488..dbf1f2d4e4b5 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -728,7 +728,6 @@ EXPORT_SYMBOL(oxygen_pci_remove);
728#ifdef CONFIG_PM_SLEEP 728#ifdef CONFIG_PM_SLEEP
729static int oxygen_pci_suspend(struct device *dev) 729static int oxygen_pci_suspend(struct device *dev)
730{ 730{
731 struct pci_dev *pci = to_pci_dev(dev);
732 struct snd_card *card = dev_get_drvdata(dev); 731 struct snd_card *card = dev_get_drvdata(dev);
733 struct oxygen *chip = card->private_data; 732 struct oxygen *chip = card->private_data;
734 unsigned int i, saved_interrupt_mask; 733 unsigned int i, saved_interrupt_mask;
@@ -752,10 +751,6 @@ static int oxygen_pci_suspend(struct device *dev)
752 flush_work(&chip->spdif_input_bits_work); 751 flush_work(&chip->spdif_input_bits_work);
753 flush_work(&chip->gpio_work); 752 flush_work(&chip->gpio_work);
754 chip->interrupt_mask = saved_interrupt_mask; 753 chip->interrupt_mask = saved_interrupt_mask;
755
756 pci_disable_device(pci);
757 pci_save_state(pci);
758 pci_set_power_state(pci, PCI_D3hot);
759 return 0; 754 return 0;
760} 755}
761 756
@@ -787,20 +782,10 @@ static void oxygen_restore_ac97(struct oxygen *chip, unsigned int codec)
787 782
788static int oxygen_pci_resume(struct device *dev) 783static int oxygen_pci_resume(struct device *dev)
789{ 784{
790 struct pci_dev *pci = to_pci_dev(dev);
791 struct snd_card *card = dev_get_drvdata(dev); 785 struct snd_card *card = dev_get_drvdata(dev);
792 struct oxygen *chip = card->private_data; 786 struct oxygen *chip = card->private_data;
793 unsigned int i; 787 unsigned int i;
794 788
795 pci_set_power_state(pci, PCI_D0);
796 pci_restore_state(pci);
797 if (pci_enable_device(pci) < 0) {
798 dev_err(dev, "cannot reenable device");
799 snd_card_disconnect(card);
800 return -EIO;
801 }
802 pci_set_master(pci);
803
804 oxygen_write16(chip, OXYGEN_DMA_STATUS, 0); 789 oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
805 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0); 790 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
806 for (i = 0; i < OXYGEN_IO_SIZE; ++i) 791 for (i = 0; i < OXYGEN_IO_SIZE; ++i)
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 121f2c09d7a7..a1521047e619 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1153,7 +1153,6 @@ static void riptide_handleirq(unsigned long dev_id)
1153#ifdef CONFIG_PM_SLEEP 1153#ifdef CONFIG_PM_SLEEP
1154static int riptide_suspend(struct device *dev) 1154static int riptide_suspend(struct device *dev)
1155{ 1155{
1156 struct pci_dev *pci = to_pci_dev(dev);
1157 struct snd_card *card = dev_get_drvdata(dev); 1156 struct snd_card *card = dev_get_drvdata(dev);
1158 struct snd_riptide *chip = card->private_data; 1157 struct snd_riptide *chip = card->private_data;
1159 1158
@@ -1161,27 +1160,14 @@ static int riptide_suspend(struct device *dev)
1161 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 1160 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
1162 snd_pcm_suspend_all(chip->pcm); 1161 snd_pcm_suspend_all(chip->pcm);
1163 snd_ac97_suspend(chip->ac97); 1162 snd_ac97_suspend(chip->ac97);
1164 pci_disable_device(pci);
1165 pci_save_state(pci);
1166 pci_set_power_state(pci, PCI_D3hot);
1167 return 0; 1163 return 0;
1168} 1164}
1169 1165
1170static int riptide_resume(struct device *dev) 1166static int riptide_resume(struct device *dev)
1171{ 1167{
1172 struct pci_dev *pci = to_pci_dev(dev);
1173 struct snd_card *card = dev_get_drvdata(dev); 1168 struct snd_card *card = dev_get_drvdata(dev);
1174 struct snd_riptide *chip = card->private_data; 1169 struct snd_riptide *chip = card->private_data;
1175 1170
1176 pci_set_power_state(pci, PCI_D0);
1177 pci_restore_state(pci);
1178 if (pci_enable_device(pci) < 0) {
1179 printk(KERN_ERR "riptide: pci_enable_device failed, "
1180 "disabling device\n");
1181 snd_card_disconnect(card);
1182 return -EIO;
1183 }
1184 pci_set_master(pci);
1185 snd_riptide_initialize(chip); 1171 snd_riptide_initialize(chip);
1186 snd_ac97_resume(chip->ac97); 1172 snd_ac97_resume(chip->ac97);
1187 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 1173 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 2f1a85185a16..e33e79eadf83 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -2358,7 +2358,6 @@ snd_rme96_create_switches(struct snd_card *card,
2358 2358
2359static int rme96_suspend(struct device *dev) 2359static int rme96_suspend(struct device *dev)
2360{ 2360{
2361 struct pci_dev *pci = to_pci_dev(dev);
2362 struct snd_card *card = dev_get_drvdata(dev); 2361 struct snd_card *card = dev_get_drvdata(dev);
2363 struct rme96 *rme96 = card->private_data; 2362 struct rme96 *rme96 = card->private_data;
2364 2363
@@ -2381,26 +2380,14 @@ static int rme96_suspend(struct device *dev)
2381 /* disable the DAC */ 2380 /* disable the DAC */
2382 rme96->areg &= ~RME96_AR_DAC_EN; 2381 rme96->areg &= ~RME96_AR_DAC_EN;
2383 writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG); 2382 writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
2384
2385 pci_disable_device(pci);
2386 pci_save_state(pci);
2387
2388 return 0; 2383 return 0;
2389} 2384}
2390 2385
2391static int rme96_resume(struct device *dev) 2386static int rme96_resume(struct device *dev)
2392{ 2387{
2393 struct pci_dev *pci = to_pci_dev(dev);
2394 struct snd_card *card = dev_get_drvdata(dev); 2388 struct snd_card *card = dev_get_drvdata(dev);
2395 struct rme96 *rme96 = card->private_data; 2389 struct rme96 *rme96 = card->private_data;
2396 2390
2397 pci_restore_state(pci);
2398 if (pci_enable_device(pci) < 0) {
2399 dev_err(dev, "pci_enable_device failed, disabling device\n");
2400 snd_card_disconnect(card);
2401 return -EIO;
2402 }
2403
2404 /* reset playback and record buffer pointers */ 2391 /* reset playback and record buffer pointers */
2405 writel(0, rme96->iobase + RME96_IO_SET_PLAY_POS 2392 writel(0, rme96->iobase + RME96_IO_SET_PLAY_POS
2406 + rme96->playback_pointer); 2393 + rme96->playback_pointer);
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 5e9437ba6eec..efe669b80256 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1208,7 +1208,6 @@ static int sis_chip_init(struct sis7019 *sis)
1208#ifdef CONFIG_PM_SLEEP 1208#ifdef CONFIG_PM_SLEEP
1209static int sis_suspend(struct device *dev) 1209static int sis_suspend(struct device *dev)
1210{ 1210{
1211 struct pci_dev *pci = to_pci_dev(dev);
1212 struct snd_card *card = dev_get_drvdata(dev); 1211 struct snd_card *card = dev_get_drvdata(dev);
1213 struct sis7019 *sis = card->private_data; 1212 struct sis7019 *sis = card->private_data;
1214 void __iomem *ioaddr = sis->ioaddr; 1213 void __iomem *ioaddr = sis->ioaddr;
@@ -1237,9 +1236,6 @@ static int sis_suspend(struct device *dev)
1237 ioaddr += 4096; 1236 ioaddr += 4096;
1238 } 1237 }
1239 1238
1240 pci_disable_device(pci);
1241 pci_save_state(pci);
1242 pci_set_power_state(pci, PCI_D3hot);
1243 return 0; 1239 return 0;
1244} 1240}
1245 1241
@@ -1251,14 +1247,6 @@ static int sis_resume(struct device *dev)
1251 void __iomem *ioaddr = sis->ioaddr; 1247 void __iomem *ioaddr = sis->ioaddr;
1252 int i; 1248 int i;
1253 1249
1254 pci_set_power_state(pci, PCI_D0);
1255 pci_restore_state(pci);
1256
1257 if (pci_enable_device(pci) < 0) {
1258 dev_err(&pci->dev, "unable to re-enable device\n");
1259 goto error;
1260 }
1261
1262 if (sis_chip_init(sis)) { 1250 if (sis_chip_init(sis)) {
1263 dev_err(&pci->dev, "unable to re-init controller\n"); 1251 dev_err(&pci->dev, "unable to re-init controller\n");
1264 goto error; 1252 goto error;
@@ -1281,7 +1269,6 @@ static int sis_resume(struct device *dev)
1281 memset(sis->suspend_state[0], 0, 4096); 1269 memset(sis->suspend_state[0], 0, 4096);
1282 1270
1283 sis->irq = pci->irq; 1271 sis->irq = pci->irq;
1284 pci_set_master(pci);
1285 1272
1286 if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT) 1273 if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT)
1287 snd_ac97_resume(sis->ac97[0]); 1274 snd_ac97_resume(sis->ac97[0]);
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index c380c99407c0..2870cbf8cee0 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3911,7 +3911,6 @@ static void snd_trident_clear_voices(struct snd_trident * trident, unsigned shor
3911#ifdef CONFIG_PM_SLEEP 3911#ifdef CONFIG_PM_SLEEP
3912static int snd_trident_suspend(struct device *dev) 3912static int snd_trident_suspend(struct device *dev)
3913{ 3913{
3914 struct pci_dev *pci = to_pci_dev(dev);
3915 struct snd_card *card = dev_get_drvdata(dev); 3914 struct snd_card *card = dev_get_drvdata(dev);
3916 struct snd_trident *trident = card->private_data; 3915 struct snd_trident *trident = card->private_data;
3917 3916
@@ -3923,28 +3922,14 @@ static int snd_trident_suspend(struct device *dev)
3923 3922
3924 snd_ac97_suspend(trident->ac97); 3923 snd_ac97_suspend(trident->ac97);
3925 snd_ac97_suspend(trident->ac97_sec); 3924 snd_ac97_suspend(trident->ac97_sec);
3926
3927 pci_disable_device(pci);
3928 pci_save_state(pci);
3929 pci_set_power_state(pci, PCI_D3hot);
3930 return 0; 3925 return 0;
3931} 3926}
3932 3927
3933static int snd_trident_resume(struct device *dev) 3928static int snd_trident_resume(struct device *dev)
3934{ 3929{
3935 struct pci_dev *pci = to_pci_dev(dev);
3936 struct snd_card *card = dev_get_drvdata(dev); 3930 struct snd_card *card = dev_get_drvdata(dev);
3937 struct snd_trident *trident = card->private_data; 3931 struct snd_trident *trident = card->private_data;
3938 3932
3939 pci_set_power_state(pci, PCI_D0);
3940 pci_restore_state(pci);
3941 if (pci_enable_device(pci) < 0) {
3942 dev_err(dev, "pci_enable_device failed, disabling device\n");
3943 snd_card_disconnect(card);
3944 return -EIO;
3945 }
3946 pci_set_master(pci);
3947
3948 switch (trident->device) { 3933 switch (trident->device) {
3949 case TRIDENT_DEVICE_ID_DX: 3934 case TRIDENT_DEVICE_ID_DX:
3950 snd_trident_4d_dx_init(trident); 3935 snd_trident_4d_dx_init(trident);
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index e088467fb736..120fccbb2461 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -2271,7 +2271,6 @@ static int snd_via82xx_chip_init(struct via82xx *chip)
2271 */ 2271 */
2272static int snd_via82xx_suspend(struct device *dev) 2272static int snd_via82xx_suspend(struct device *dev)
2273{ 2273{
2274 struct pci_dev *pci = to_pci_dev(dev);
2275 struct snd_card *card = dev_get_drvdata(dev); 2274 struct snd_card *card = dev_get_drvdata(dev);
2276 struct via82xx *chip = card->private_data; 2275 struct via82xx *chip = card->private_data;
2277 int i; 2276 int i;
@@ -2291,28 +2290,15 @@ static int snd_via82xx_suspend(struct device *dev)
2291 chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); 2290 chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10);
2292 } 2291 }
2293 2292
2294 pci_disable_device(pci);
2295 pci_save_state(pci);
2296 pci_set_power_state(pci, PCI_D3hot);
2297 return 0; 2293 return 0;
2298} 2294}
2299 2295
2300static int snd_via82xx_resume(struct device *dev) 2296static int snd_via82xx_resume(struct device *dev)
2301{ 2297{
2302 struct pci_dev *pci = to_pci_dev(dev);
2303 struct snd_card *card = dev_get_drvdata(dev); 2298 struct snd_card *card = dev_get_drvdata(dev);
2304 struct via82xx *chip = card->private_data; 2299 struct via82xx *chip = card->private_data;
2305 int i; 2300 int i;
2306 2301
2307 pci_set_power_state(pci, PCI_D0);
2308 pci_restore_state(pci);
2309 if (pci_enable_device(pci) < 0) {
2310 dev_err(dev, "pci_enable_device failed, disabling device\n");
2311 snd_card_disconnect(card);
2312 return -EIO;
2313 }
2314 pci_set_master(pci);
2315
2316 snd_via82xx_chip_init(chip); 2302 snd_via82xx_chip_init(chip);
2317 2303
2318 if (chip->chip_type == TYPE_VIA686) { 2304 if (chip->chip_type == TYPE_VIA686) {
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index fd46ffe12e4f..884f49eea495 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -1031,7 +1031,6 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
1031 */ 1031 */
1032static int snd_via82xx_suspend(struct device *dev) 1032static int snd_via82xx_suspend(struct device *dev)
1033{ 1033{
1034 struct pci_dev *pci = to_pci_dev(dev);
1035 struct snd_card *card = dev_get_drvdata(dev); 1034 struct snd_card *card = dev_get_drvdata(dev);
1036 struct via82xx_modem *chip = card->private_data; 1035 struct via82xx_modem *chip = card->private_data;
1037 int i; 1036 int i;
@@ -1043,29 +1042,15 @@ static int snd_via82xx_suspend(struct device *dev)
1043 snd_via82xx_channel_reset(chip, &chip->devs[i]); 1042 snd_via82xx_channel_reset(chip, &chip->devs[i]);
1044 synchronize_irq(chip->irq); 1043 synchronize_irq(chip->irq);
1045 snd_ac97_suspend(chip->ac97); 1044 snd_ac97_suspend(chip->ac97);
1046
1047 pci_disable_device(pci);
1048 pci_save_state(pci);
1049 pci_set_power_state(pci, PCI_D3hot);
1050 return 0; 1045 return 0;
1051} 1046}
1052 1047
1053static int snd_via82xx_resume(struct device *dev) 1048static int snd_via82xx_resume(struct device *dev)
1054{ 1049{
1055 struct pci_dev *pci = to_pci_dev(dev);
1056 struct snd_card *card = dev_get_drvdata(dev); 1050 struct snd_card *card = dev_get_drvdata(dev);
1057 struct via82xx_modem *chip = card->private_data; 1051 struct via82xx_modem *chip = card->private_data;
1058 int i; 1052 int i;
1059 1053
1060 pci_set_power_state(pci, PCI_D0);
1061 pci_restore_state(pci);
1062 if (pci_enable_device(pci) < 0) {
1063 dev_err(dev, "pci_enable_device failed, disabling device\n");
1064 snd_card_disconnect(card);
1065 return -EIO;
1066 }
1067 pci_set_master(pci);
1068
1069 snd_via82xx_chip_init(chip); 1054 snd_via82xx_chip_init(chip);
1070 1055
1071 snd_ac97_resume(chip->ac97); 1056 snd_ac97_resume(chip->ac97);
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index c5a25e39e3a8..ecbaf473fc1e 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -259,32 +259,17 @@ static void snd_vx222_remove(struct pci_dev *pci)
259#ifdef CONFIG_PM_SLEEP 259#ifdef CONFIG_PM_SLEEP
260static int snd_vx222_suspend(struct device *dev) 260static int snd_vx222_suspend(struct device *dev)
261{ 261{
262 struct pci_dev *pci = to_pci_dev(dev);
263 struct snd_card *card = dev_get_drvdata(dev); 262 struct snd_card *card = dev_get_drvdata(dev);
264 struct snd_vx222 *vx = card->private_data; 263 struct snd_vx222 *vx = card->private_data;
265 int err;
266 264
267 err = snd_vx_suspend(&vx->core); 265 return snd_vx_suspend(&vx->core);
268 pci_disable_device(pci);
269 pci_save_state(pci);
270 pci_set_power_state(pci, PCI_D3hot);
271 return err;
272} 266}
273 267
274static int snd_vx222_resume(struct device *dev) 268static int snd_vx222_resume(struct device *dev)
275{ 269{
276 struct pci_dev *pci = to_pci_dev(dev);
277 struct snd_card *card = dev_get_drvdata(dev); 270 struct snd_card *card = dev_get_drvdata(dev);
278 struct snd_vx222 *vx = card->private_data; 271 struct snd_vx222 *vx = card->private_data;
279 272
280 pci_set_power_state(pci, PCI_D0);
281 pci_restore_state(pci);
282 if (pci_enable_device(pci) < 0) {
283 dev_err(dev, "pci_enable_device failed, disabling device\n");
284 snd_card_disconnect(card);
285 return -EIO;
286 }
287 pci_set_master(pci);
288 return snd_vx_resume(&vx->core); 273 return snd_vx_resume(&vx->core);
289} 274}
290 275
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index de7f06fb3f92..227d5c9dfe09 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2299,7 +2299,6 @@ static int saved_regs_index[] = {
2299 2299
2300static int snd_ymfpci_suspend(struct device *dev) 2300static int snd_ymfpci_suspend(struct device *dev)
2301{ 2301{
2302 struct pci_dev *pci = to_pci_dev(dev);
2303 struct snd_card *card = dev_get_drvdata(dev); 2302 struct snd_card *card = dev_get_drvdata(dev);
2304 struct snd_ymfpci *chip = card->private_data; 2303 struct snd_ymfpci *chip = card->private_data;
2305 unsigned int i; 2304 unsigned int i;
@@ -2320,9 +2319,6 @@ static int snd_ymfpci_suspend(struct device *dev)
2320 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); 2319 snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0);
2321 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); 2320 snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0);
2322 snd_ymfpci_disable_dsp(chip); 2321 snd_ymfpci_disable_dsp(chip);
2323 pci_disable_device(pci);
2324 pci_save_state(pci);
2325 pci_set_power_state(pci, PCI_D3hot);
2326 return 0; 2322 return 0;
2327} 2323}
2328 2324
@@ -2333,14 +2329,6 @@ static int snd_ymfpci_resume(struct device *dev)
2333 struct snd_ymfpci *chip = card->private_data; 2329 struct snd_ymfpci *chip = card->private_data;
2334 unsigned int i; 2330 unsigned int i;
2335 2331
2336 pci_set_power_state(pci, PCI_D0);
2337 pci_restore_state(pci);
2338 if (pci_enable_device(pci) < 0) {
2339 dev_err(dev, "pci_enable_device failed, disabling device\n");
2340 snd_card_disconnect(card);
2341 return -EIO;
2342 }
2343 pci_set_master(pci);
2344 snd_ymfpci_aclink_reset(pci); 2332 snd_ymfpci_aclink_reset(pci);
2345 snd_ymfpci_codec_ready(chip, 0); 2333 snd_ymfpci_codec_ready(chip, 0);
2346 snd_ymfpci_download_image(chip); 2334 snd_ymfpci_download_image(chip);