aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-08 06:49:13 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-09 11:28:27 -0500
commit2d6b2e59eda2d77c16f9189073adb0484503d168 (patch)
tree120146ee27a28579925a6f44cc83352cd9cc9721 /sound/pci/oxygen
parentfc9b6061cf9c42460e482f7a5947ee8120ff0960 (diff)
ALSA: oxygen: Simplify PM callbacks
This is a similar cleanup like the commit [3db084fd0af5: ALSA: fm801: PCI core handles power state for us]. Since pci_set_power_state(), pci_save_state() and pci_restore_state() are already done in the PCI core side, so we don't need to it doubly. Also, pci_enable_device(), pci_disable_device() and pci_set_master() calls in PM callbacks are superfluous nowadays, too, so get rid of them as well. Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen')
-rw-r--r--sound/pci/oxygen/oxygen_lib.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index b67e30602473..366723cf6d7a 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;
@@ -753,10 +752,6 @@ static int oxygen_pci_suspend(struct device *dev)
753 flush_work(&chip->spdif_input_bits_work); 752 flush_work(&chip->spdif_input_bits_work);
754 flush_work(&chip->gpio_work); 753 flush_work(&chip->gpio_work);
755 chip->interrupt_mask = saved_interrupt_mask; 754 chip->interrupt_mask = saved_interrupt_mask;
756
757 pci_disable_device(pci);
758 pci_save_state(pci);
759 pci_set_power_state(pci, PCI_D3hot);
760 return 0; 755 return 0;
761} 756}
762 757
@@ -788,20 +783,10 @@ static void oxygen_restore_ac97(struct oxygen *chip, unsigned int codec)
788 783
789static int oxygen_pci_resume(struct device *dev) 784static int oxygen_pci_resume(struct device *dev)
790{ 785{
791 struct pci_dev *pci = to_pci_dev(dev);
792 struct snd_card *card = dev_get_drvdata(dev); 786 struct snd_card *card = dev_get_drvdata(dev);
793 struct oxygen *chip = card->private_data; 787 struct oxygen *chip = card->private_data;
794 unsigned int i; 788 unsigned int i;
795 789
796 pci_set_power_state(pci, PCI_D0);
797 pci_restore_state(pci);
798 if (pci_enable_device(pci) < 0) {
799 dev_err(dev, "cannot reenable device");
800 snd_card_disconnect(card);
801 return -EIO;
802 }
803 pci_set_master(pci);
804
805 oxygen_write16(chip, OXYGEN_DMA_STATUS, 0); 790 oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
806 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0); 791 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
807 for (i = 0; i < OXYGEN_IO_SIZE; ++i) 792 for (i = 0; i < OXYGEN_IO_SIZE; ++i)