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>
Esse commit está contido em:
@@ -356,8 +356,9 @@ static struct pci_driver ymfpci_driver = {
|
||||
.probe = snd_card_ymfpci_probe,
|
||||
.remove = __devexit_p(snd_card_ymfpci_remove),
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = snd_ymfpci_suspend,
|
||||
.resume = snd_ymfpci_resume,
|
||||
.driver = {
|
||||
.pm = &snd_ymfpci_pm,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@@ -2302,9 +2302,10 @@ static int saved_regs_index[] = {
|
||||
};
|
||||
#define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index)
|
||||
|
||||
int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
|
||||
static int snd_ymfpci_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 snd_ymfpci *chip = card->private_data;
|
||||
unsigned int i;
|
||||
|
||||
@@ -2326,13 +2327,14 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
|
||||
snd_ymfpci_disable_dsp(chip);
|
||||
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;
|
||||
}
|
||||
|
||||
int snd_ymfpci_resume(struct pci_dev *pci)
|
||||
static int snd_ymfpci_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 snd_ymfpci *chip = card->private_data;
|
||||
unsigned int i;
|
||||
|
||||
@@ -2370,6 +2372,8 @@ int snd_ymfpci_resume(struct pci_dev *pci)
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
SIMPLE_DEV_PM_OPS(snd_ymfpci_pm, snd_ymfpci_suspend, snd_ymfpci_resume);
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
int __devinit snd_ymfpci_create(struct snd_card *card,
|
||||
|
Referência em uma nova issue
Block a user