Commit 68cb2b55 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 284e7ca7
......@@ -1730,8 +1730,7 @@ int snd_cs46xx_create(struct snd_card *card,
struct pci_dev *pci,
int external_amp, int thinkpad,
struct snd_cs46xx **rcodec);
int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state);
int snd_cs46xx_resume(struct pci_dev *pci);
extern const struct dev_pm_ops snd_cs46xx_pm;
int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
......
......@@ -430,8 +430,7 @@ void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voi
void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice);
void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice);
void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice);
int snd_trident_suspend(struct pci_dev *pci, pm_message_t state);
int snd_trident_resume(struct pci_dev *pci);
extern const struct dev_pm_ops snd_trident_pm;
/* TLB memory allocation */
struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident,
......
......@@ -341,7 +341,7 @@ int vx_change_frequency(struct vx_core *chip);
/*
* PM
*/
int snd_vx_suspend(struct vx_core *card, pm_message_t state);
int snd_vx_suspend(struct vx_core *card);
int snd_vx_resume(struct vx_core *card);
/*
......
......@@ -377,8 +377,7 @@ int snd_ymfpci_create(struct snd_card *card,
struct snd_ymfpci ** rcodec);
void snd_ymfpci_free_gameport(struct snd_ymfpci *chip);
int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state);
int snd_ymfpci_resume(struct pci_dev *pci);
extern const struct dev_pm_ops snd_ymfpci_pm;
int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
......
......@@ -725,7 +725,7 @@ EXPORT_SYMBOL(snd_vx_dsp_load);
/*
* suspend
*/
int snd_vx_suspend(struct vx_core *chip, pm_message_t state)
int snd_vx_suspend(struct vx_core *chip)
{
unsigned int i;
......
......@@ -1884,9 +1884,10 @@ static int __devinit snd_ali_mixer(struct snd_ali * codec)
}
#ifdef CONFIG_PM
static int ali_suspend(struct pci_dev *pci, pm_message_t state)
static int ali_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_ali *chip = card->private_data;
struct snd_ali_image *im;
int i, j;
......@@ -1929,13 +1930,14 @@ static int ali_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int ali_resume(struct pci_dev *pci)
static int ali_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_ali *chip = card->private_data;
struct snd_ali_image *im;
int i, j;
......@@ -1982,6 +1984,11 @@ static int ali_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume);
#define ALI_PM_OPS &ali_pm
#else
#define ALI_PM_OPS NULL
#endif /* CONFIG_PM */
static int snd_ali_free(struct snd_ali * codec)
......@@ -2299,10 +2306,9 @@ static struct pci_driver ali5451_driver = {
.id_table = snd_ali_ids,
.probe = snd_ali_probe,
.remove = __devexit_p(snd_ali_remove),
#ifdef CONFIG_PM
.suspend = ali_suspend,
.resume = ali_resume,
#endif
.driver = {
.pm = ALI_PM_OPS,
},
};
module_pci_driver(ali5451_driver);
......@@ -766,9 +766,10 @@ static int __devinit snd_als300_create(struct snd_card *card,
}
#ifdef CONFIG_PM
static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_als300_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_als300 *chip = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
......@@ -777,13 +778,14 @@ static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int snd_als300_resume(struct pci_dev *pci)
static int snd_als300_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_als300 *chip = card->private_data;
pci_set_power_state(pci, PCI_D0);
......@@ -802,6 +804,11 @@ static int snd_als300_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(snd_als300_pm, snd_als300_suspend, snd_als300_resume);
#define SND_ALS300_PM_OPS &snd_als300_pm
#else
#define SND_ALS300_PM_OPS NULL
#endif
static int __devinit snd_als300_probe(struct pci_dev *pci,
......@@ -857,10 +864,9 @@ static struct pci_driver als300_driver = {
.id_table = snd_als300_ids,
.probe = snd_als300_probe,
.remove = __devexit_p(snd_als300_remove),
#ifdef CONFIG_PM
.suspend = snd_als300_suspend,
.resume = snd_als300_resume,
#endif
.driver = {
.pm = SND_ALS300_PM_OPS,
},
};
module_pci_driver(als300_driver);
......@@ -988,9 +988,10 @@ static void __devexit snd_card_als4000_remove(struct pci_dev *pci)
}
#ifdef CONFIG_PM
static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_als4000_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_card_als4000 *acard = card->private_data;
struct snd_sb *chip = acard->chip;
......@@ -1001,13 +1002,14 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int snd_als4000_resume(struct pci_dev *pci)
static int snd_als4000_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_card_als4000 *acard = card->private_data;
struct snd_sb *chip = acard->chip;
......@@ -1033,18 +1035,21 @@ static int snd_als4000_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume);
#define SND_ALS4000_PM_OPS &snd_als4000_pm
#else
#define SND_ALS4000_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver als4000_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_als4000_ids,
.probe = snd_card_als4000_probe,
.remove = __devexit_p(snd_card_als4000_remove),
#ifdef CONFIG_PM
.suspend = snd_als4000_suspend,
.resume = snd_als4000_resume,
#endif
.driver = {
.pm = SND_ALS4000_PM_OPS,
},
};
module_pci_driver(als4000_driver);
......@@ -1462,9 +1462,10 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock,
/*
* power management
*/
static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_atiixp_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 atiixp *chip = card->private_data;
int i;
......@@ -1484,13 +1485,14 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int snd_atiixp_resume(struct pci_dev *pci)
static int snd_atiixp_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 atiixp *chip = card->private_data;
int i;
......@@ -1526,6 +1528,11 @@ static int snd_atiixp_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume);
#define SND_ATIIXP_PM_OPS &snd_atiixp_pm
#else
#define SND_ATIIXP_PM_OPS NULL
#endif /* CONFIG_PM */
......@@ -1705,10 +1712,9 @@ static struct pci_driver atiixp_driver = {
.id_table = snd_atiixp_ids,
.probe = snd_atiixp_probe,
.remove = __devexit_p(snd_atiixp_remove),
#ifdef CONFIG_PM
.suspend = snd_atiixp_suspend,
.resume = snd_atiixp_resume,
#endif
.driver = {
.pm = SND_ATIIXP_PM_OPS,
},
};
module_pci_driver(atiixp_driver);
......@@ -1117,9 +1117,10 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
/*
* power management
*/
static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_atiixp_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 atiixp_modem *chip = card->private_data;
int i;
......@@ -1133,13 +1134,14 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int snd_atiixp_resume(struct pci_dev *pci)
static int snd_atiixp_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 atiixp_modem *chip = card->private_data;
int i;
......@@ -1162,8 +1164,12 @@ static int snd_atiixp_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume);
#define SND_ATIIXP_PM_OPS &snd_atiixp_pm
#else
#define SND_ATIIXP_PM_OPS NULL
#endif /* CONFIG_PM */
#ifdef CONFIG_PROC_FS
/*
......@@ -1336,10 +1342,9 @@ static struct pci_driver atiixp_modem_driver = {
.id_table = snd_atiixp_ids,
.probe = snd_atiixp_probe,
.remove = __devexit_p(snd_atiixp_remove),
#ifdef CONFIG_PM
.suspend = snd_atiixp_suspend,
.resume = snd_atiixp_resume,
#endif
.driver = {
.pm = SND_ATIIXP_PM_OPS,
},
};
module_pci_driver(atiixp_modem_driver);
......@@ -2794,9 +2794,10 @@ snd_azf3328_resume_ac97(const struct snd_azf3328 *chip)
}
static int
snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state)
snd_azf3328_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_azf3328 *chip = card->private_data;
u16 *saved_regs_ctrl_u16;
......@@ -2824,14 +2825,15 @@ snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int
snd_azf3328_resume(struct pci_dev *pci)
snd_azf3328_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);
const struct snd_azf3328 *chip = card->private_data;
pci_set_power_state(pci, PCI_D0);
......@@ -2859,18 +2861,21 @@ snd_azf3328_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(snd_azf3328_pm, snd_azf3328_suspend, snd_azf3328_resume);
#define SND_AZF3328_PM_OPS &snd_azf3328_pm
#else
#define SND_AZF3328_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver azf3328_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_azf3328_ids,
.probe = snd_azf3328_probe,
.remove = __devexit_p(snd_azf3328_remove),
#ifdef CONFIG_PM
.suspend = snd_azf3328_suspend,
.resume = snd_azf3328_resume,
#endif
.driver = {
.pm = SND_AZF3328_PM_OPS,
},
};
module_pci_driver(azf3328_driver);
......@@ -1872,9 +1872,10 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci)
}
#ifdef CONFIG_PM
static int snd_ca0106_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_ca0106_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_ca0106 *chip = card->private_data;
int i;
......@@ -1889,13 +1890,14 @@ static int snd_ca0106_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int snd_ca0106_resume(struct pci_dev *pci)
static int snd_ca0106_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_ca0106 *chip = card->private_data;
int i;
......@@ -1922,6 +1924,11 @@ static int snd_ca0106_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(snd_ca0106_pm, snd_ca0106_suspend, snd_ca0106_resume);
#define SND_CA0106_PM_OPS &snd_ca0106_pm
#else
#define SND_CA0106_PM_OPS NULL
#endif
// PCI IDs
......@@ -1937,10 +1944,9 @@ static struct pci_driver ca0106_driver = {
.id_table = snd_ca0106_ids,
.probe = snd_ca0106_probe,
.remove = __devexit_p(snd_ca0106_remove),
#ifdef CONFIG_PM
.suspend = snd_ca0106_suspend,
.resume = snd_ca0106_resume,
#endif
.driver = {
.pm = SND_CA0106_PM_OPS,
},
};
module_pci_driver(ca0106_driver);
......@@ -3338,9 +3338,10 @@ static unsigned char saved_mixers[] = {
SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT,
};
static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_cmipci_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 cmipci *cm = card->private_data;
int i;
......@@ -3361,13 +3362,14 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int snd_cmipci_resume(struct pci_dev *pci)
static int snd_cmipci_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 cmipci *cm = card->private_data;
int i;
......@@ -3396,6 +3398,11 @@ static int snd_cmipci_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume);
#define SND_CMIPCI_PM_OPS &snd_cmipci_pm
#else
#define SND_CMIPCI_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver cmipci_driver = {
......@@ -3403,10 +3410,9 @@ static struct pci_driver cmipci_driver = {
.id_table = snd_cmipci_ids,
.probe = snd_cmipci_probe,
.remove = __devexit_p(snd_cmipci_remove),
#ifdef CONFIG_PM
.suspend = snd_cmipci_suspend,
.resume = snd_cmipci_resume,
#endif
.driver = {
.pm = SND_CMIPCI_PM_OPS,
},
};
module_pci_driver(cmipci_driver);
......@@ -1997,9 +1997,10 @@ static int saved_regs[SUSPEND_REGISTERS] = {
#define CLKCR1_CKRA 0x00010000L
static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)
static int cs4281_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 cs4281 *chip = card->private_data;
u32 ulCLK;
unsigned int i;
......@@ -2040,13 +2041,14 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)
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;
}
static int cs4281_resume(struct pci_dev *pci)
static int cs4281_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 cs4281 *chip = card->private_data;
unsigned int i;
u32 ulCLK;
......@@ -2082,6 +2084,11 @@ static int cs4281_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume);
#define CS4281_PM_OPS &cs4281_pm
#else
#define CS4281_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver cs4281_driver = {
......@@ -2089,10 +2096,9 @@ static struct pci_driver cs4281_driver = {
.id_table = snd_cs4281_ids,
.probe = snd_cs4281_probe,
.remove = __devexit_p(snd_cs4281_remove),
#ifdef CONFIG_PM
.suspend = cs4281_suspend,
.resume = cs4281_resume,
#endif
.driver = {
.pm = CS4281_PM_OPS,
},
};
module_pci_driver(cs4281_driver);
......@@ -167,8 +167,9 @@ static struct pci_driver cs46xx_driver = {
.probe = snd_card_cs46xx_probe,
.remove = __devexit_p(snd_card_cs46xx_remove),
#ifdef CONFIG_PM
.suspend = snd_cs46xx_suspend,
.resume = snd_cs46xx_resume,
.driver = {
.pm = &snd_cs46xx_pm,
},
#endif
};
......
......@@ -3599,9 +3599,10 @@ static unsigned int saved_regs[] = {
BA1_CVOL,
};
int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_cs46xx_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_cs46xx *chip = card->private_data;
int i, amp_saved;
......@@ -3628,13 +3629,14 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
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_cs46xx_resume(struct pci_dev *pci)
static int snd_cs46xx_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_cs46xx *chip = card->private_data;
int amp_saved;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
......@@ -3707,6 +3709,8 @@ int snd_cs46xx_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
SIMPLE_DEV_PM_OPS(snd_cs46xx_pm, snd_cs46xx_suspend, snd_cs46xx_resume);
#endif /* CONFIG_PM */
......
......@@ -400,8 +400,9 @@ static struct pci_driver cs5535audio_driver = {
.probe = snd_cs5535audio_probe,
.remove = __devexit_p(snd_cs5535audio_remove),
#ifdef CONFIG_PM
.suspend = snd_cs5535audio_suspend,
.resume = snd_cs5535audio_resume,
.driver = {
.pm = &snd_cs5535audio_pm,
},
#endif
};
......
......@@ -94,10 +94,7 @@ struct cs5535audio {
struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
};
#ifdef CONFIG_PM
int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state);
int snd_cs5535audio_resume(struct pci_dev *pci);
#endif
extern const struct dev_pm_ops snd_cs5535audio_pm;
#ifdef CONFIG_OLPC
void __devinit olpc_prequirks(struct snd_card *card,
......
......@@ -55,9 +55,10 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
}
int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_cs5535audio_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 cs5535audio *cs5535au = card->private_data;
int i;
......@@ -77,13 +78,14 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
return -EIO;
}
pci_disable_device(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
pci_set_power_state(pci, PCI_D3hot);
return 0;
}
int snd_cs5535audio_resume(struct pci_dev *pci)
static int snd_cs5535audio_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 cs5535audio *cs5535au = card->private_data;
u32 tmp;
int timeout;
......@@ -129,3 +131,4 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
return 0;
}
SIMPLE_DEV_PM_OPS(snd_cs5535audio_pm, snd_cs5535audio_suspend, snd_cs5535audio_resume);
......@@ -1537,7 +1537,7 @@ static void atc_connect_resources(struct ct_atc *atc)
}
#ifdef CONFIG_PM
static int atc_suspend(struct ct_atc *atc, pm_message_t state)
static int atc_suspend(struct ct_atc *atc)
{
int i;
struct hw *hw = atc->hw;
......@@ -1553,7 +1553,7 @@ static int atc_suspend(struct ct_atc *atc, pm_message_t state)
atc_release_resources(atc);
hw->suspend(hw, state);
hw->suspend(hw);
return 0;
}
......
......@@ -144,7 +144,7 @@ struct ct_atc {
struct ct_timer *timer;
#ifdef CONFIG_PM
int (*suspend)(struct ct_atc *atc, pm_message_t state);
int (*suspend)(struct ct_atc *atc);
int (*resume)(struct ct_atc *atc);
#define NUM_PCMS (NUM_CTALSADEVS - 1)
struct snd_pcm *pcms[NUM_PCMS];
......
......@@ -73,7 +73,7 @@ struct hw {
int (*card_stop)(struct hw *hw);
int (*pll_init)(struct hw *hw, unsigned int rsr);
#ifdef CONFIG_PM
int (*suspend)(struct hw *hw, pm_message_t state);
int (*suspend)(struct hw *hw);
int (*resume)(struct hw *