aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio/cs5535audio_pm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-08 06:45:43 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-09 10:24:20 -0500
commitb8375122b59b1362e94ccd8502cff3cfef4cf168 (patch)
tree177c451c3b45d86131caa454025113a1cd9522a5 /sound/pci/cs5535audio/cs5535audio_pm.c
parent319184680d7ecbea5718fa1ab73105ef8abb478f (diff)
ALSA: cs5535audio: 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. 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.c18
1 files changed, 0 insertions, 18 deletions
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