Browse Source

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>
imx_3.10.17_1.0.0_ga
Takashi Iwai 8 years ago
parent
commit
68cb2b5592
59 changed files with 496 additions and 325 deletions
  1. +1
    -2
      include/sound/cs46xx.h
  2. +1
    -2
      include/sound/trident.h
  3. +1
    -1
      include/sound/vx_core.h
  4. +1
    -2
      include/sound/ymfpci.h
  5. +1
    -1
      sound/drivers/vx/vx_core.c
  6. +15
    -9
      sound/pci/ali5451/ali5451.c
  7. +15
    -9
      sound/pci/als300.c
  8. +15
    -10
      sound/pci/als4000.c
  9. +15
    -9
      sound/pci/atiixp.c
  10. +15
    -10
      sound/pci/atiixp_modem.c
  11. +15
    -10
      sound/pci/azt3328.c
  12. +15
    -9
      sound/pci/ca0106/ca0106_main.c
  13. +15
    -9
      sound/pci/cmipci.c
  14. +15
    -9
      sound/pci/cs4281.c
  15. +3
    -2
      sound/pci/cs46xx/cs46xx.c
  16. +9
    -5
      sound/pci/cs46xx/cs46xx_lib.c
  17. +3
    -2
      sound/pci/cs5535audio/cs5535audio.c
  18. +1
    -4
      sound/pci/cs5535audio/cs5535audio.h
  19. +8
    -5
      sound/pci/cs5535audio/cs5535audio_pm.c
  20. +2
    -2
      sound/pci/ctxfi/ctatc.c
  21. +1
    -1
      sound/pci/ctxfi/ctatc.h
  22. +1
    -1
      sound/pci/ctxfi/cthardware.h
  23. +2
    -2
      sound/pci/ctxfi/cthw20k1.c
  24. +2
    -2
      sound/pci/ctxfi/cthw20k2.c
  25. +13
    -9
      sound/pci/ctxfi/xfi.c
  26. +13
    -9
      sound/pci/echoaudio/echoaudio.c
  27. +16
    -10
      sound/pci/emu10k1/emu10k1.c
  28. +15
    -10
      sound/pci/ens1370.c
  29. +15
    -9
      sound/pci/es1938.c
  30. +15
    -9
      sound/pci/es1968.c
  31. +16
    -10
      sound/pci/fm801.c
  32. +1
    -1
      sound/pci/hda/hda_codec.c
  33. +1
    -1
      sound/pci/hda/hda_codec.h
  34. +18
    -11
      sound/pci/hda/hda_intel.c
  35. +1
    -1
      sound/pci/hda/patch_analog.c
  36. +1
    -1
      sound/pci/hda/patch_cirrus.c
  37. +1
    -1
      sound/pci/hda/patch_conexant.c
  38. +1
    -1
      sound/pci/hda/patch_realtek.c
  39. +1
    -1
      sound/pci/hda/patch_sigmatel.c
  40. +1
    -1
      sound/pci/hda/patch_via.c
  41. +16
    -10
      sound/pci/ice1712/ice1724.c
  42. +15
    -9
      sound/pci/intel8x0.c
  43. +15
    -9
      sound/pci/intel8x0m.c
  44. +15
    -9
      sound/pci/maestro3.c
  45. +15
    -9
      sound/pci/nm256/nm256.c
  46. +3
    -2
      sound/pci/oxygen/oxygen.c
  47. +1
    -2
      sound/pci/oxygen/oxygen.h
  48. +10
    -7
      sound/pci/oxygen/oxygen_lib.c
  49. +3
    -2
      sound/pci/oxygen/virtuoso.c
  50. +16
    -10
      sound/pci/riptide/riptide.c
  51. +15
    -10
      sound/pci/sis7019.c
  52. +3
    -2
      sound/pci/trident/trident.c
  53. +9
    -5
      sound/pci/trident/trident_main.c
  54. +15
    -9
      sound/pci/via82xx.c
  55. +15
    -9
      sound/pci/via82xx_modem.c
  56. +16
    -10
      sound/pci/vx222/vx222.c
  57. +3
    -2
      sound/pci/ymfpci/ymfpci.c
  58. +9
    -5
      sound/pci/ymfpci/ymfpci_main.c
  59. +1
    -1
      sound/pcmcia/vx/vxpocket.c

+ 1
- 2
include/sound/cs46xx.h View File

@ -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);


+ 1
- 2
include/sound/trident.h View File

@ -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,


+ 1
- 1
include/sound/vx_core.h View File

@ -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);
/*


+ 1
- 2
include/sound/ymfpci.h View File

@ -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);


+ 1
- 1
sound/drivers/vx/vx_core.c View File

@ -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;


+ 15
- 9
sound/pci/ali5451/ali5451.c View File

@ -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);

+ 15
- 9
sound/pci/als300.c View File

@ -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);

+ 15
- 10
sound/pci/als4000.c View File

@ -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);

+ 15
- 9
sound/pci/atiixp.c View File

@ -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);

+ 15
- 10
sound/pci/atiixp_modem.c View File

@ -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);

+ 15
- 10
sound/pci/azt3328.c View File

@ -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);

+ 15
- 9
sound/pci/ca0106/ca0106_main.c View File

@ -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);

+ 15
- 9
sound/pci/cmipci.c View File

@ -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);

+ 15
- 9
sound/pci/cs4281.c View File

@ -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);

+ 3
- 2
sound/pci/cs46xx/cs46xx.c View File

@ -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
};


+ 9
- 5
sound/pci/cs46xx/cs46xx_lib.c View File

@ -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 */


+ 3
- 2
sound/pci/cs5535audio/cs5535audio.c View File

@ -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
};


+ 1
- 4
sound/pci/cs5535audio/cs5535audio.h View File

@ -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,


+ 8
- 5
sound/pci/cs5535audio/cs5535audio_pm.c View File

@ -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);

+ 2
- 2
sound/pci/ctxfi/ctatc.c View File

@ -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;
}


+ 1
- 1
sound/pci/ctxfi/ctatc.h View File

@ -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];


+ 1
- 1
sound/pci/ctxfi/cthardware.h View File

@ -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 *hw, struct card_conf *info);
#endif
int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source);


+ 2
- 2
sound/pci/ctxfi/cthw20k1.c View File

@ -2086,7 +2086,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
}
#ifdef CONFIG_PM
static int hw_suspend(struct hw *hw, pm_message_t state)
static int hw_suspend(struct hw *hw)
{
struct pci_dev *pci = hw->pci;
@ -2099,7 +2099,7 @@ static int hw_suspend(struct hw *hw, 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;
}


+ 2
- 2
sound/pci/ctxfi/cthw20k2.c View File

@ -2202,7 +2202,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
}
#ifdef CONFIG_PM
static int hw_suspend(struct hw *hw, pm_message_t state)
static int hw_suspend(struct hw *hw)
{
struct pci_dev *pci = hw->pci;
@ -2210,7 +2210,7 @@ static int hw_suspend(struct hw *hw, 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;
}


+ 13
- 9
sound/pci/ctxfi/xfi.c View File

@ -126,21 +126,26 @@ static void __devexit ct_card_remove(struct pci_dev *pci)
}
#ifdef CONFIG_PM
static int ct_card_suspend(struct pci_dev *pci, pm_message_t state)
static int ct_card_suspend(struct device *dev)
{
struct snd_card *card = pci_get_drvdata(pci);
struct snd_card *card = dev_get_drvdata(dev);
struct ct_atc *atc = card->private_data;
return atc->suspend(atc, state);
return atc->suspend(atc);
}
static int ct_card_resume(struct pci_dev *pci)
static int ct_card_resume(struct device *dev)
{
struct snd_card *card = pci_get_drvdata(pci);
struct snd_card *card = dev_get_drvdata(dev);
struct ct_atc *atc = card->private_data;
return atc->resume(atc);
}
static SIMPLE_DEV_PM_OPS(ct_card_pm, ct_card_suspend, ct_card_resume);
#define CT_CARD_PM_OPS &ct_card_pm
#else
#define CT_CARD_PM_OPS NULL
#endif
static struct pci_driver ct_driver = {
@ -148,10 +153,9 @@ static struct pci_driver ct_driver = {
.id_table = ct_pci_dev_ids,
.probe = ct_card_probe,
.remove = __devexit_p(ct_card_remove),
#ifdef CONFIG_PM
.suspend = ct_card_suspend,
.resume = ct_card_resume,
#endif
.driver = {
.pm = CT_CARD_PM_OPS,
},
};
module_pci_driver(ct_driver);

+ 13
- 9
sound/pci/echoaudio/echoaudio.c View File

@ -2205,9 +2205,10 @@ ctl_error:
#if defined(CONFIG_PM)
static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_echo_suspend(struct device *dev)
{
struct echoaudio *chip = pci_get_drvdata(pci);
struct pci_dev *pci = to_pci_dev(dev);
struct echoaudio *chip = dev_get_drvdata(dev);
DE_INIT(("suspend start\n"));
snd_pcm_suspend_all(chip->analog_pcm);
@ -2242,9 +2243,10 @@ static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_echo_resume(struct pci_dev *pci)
static int snd_echo_resume(struct device *dev)
{
struct echoaudio *chip = pci_get_drvdata(pci);
struct pci_dev *pci = to_pci_dev(dev);
struct echoaudio *chip = dev_get_drvdata(dev);
struct comm_page *commpage, *commpage_bak;
u32 pipe_alloc_mask;
int err;
@ -2307,10 +2309,13 @@ static int snd_echo_resume(struct pci_dev *pci)
return 0;
}
static SIMPLE_DEV_PM_OPS(snd_echo_pm, snd_echo_suspend, snd_echo_resume);
#define SND_ECHO_PM_OPS &snd_echo_pm
#else
#define SND_ECHO_PM_OPS NULL
#endif /* CONFIG_PM */
static void __devexit snd_echo_remove(struct pci_dev *pci)
{
struct echoaudio *chip;
@ -2333,10 +2338,9 @@ static struct pci_driver echo_driver = {
.id_table = snd_echo_ids,
.probe = snd_echo_probe,
.remove = __devexit_p(snd_echo_remove),
#ifdef CONFIG_PM
.suspend = snd_echo_suspend,
.resume = snd_echo_resume,
#endif /* CONFIG_PM */
.driver = {
.pm = SND_ECHO_PM_OPS,
},
};
module_pci_driver(echo_driver);

+ 16
- 10
sound/pci/emu10k1/emu10k1.c View File

@ -207,9 +207,10 @@ static void __devexit snd_card_emu10k1_remove(struct pci_dev *pci)
#ifdef CONFIG_PM
static int snd_emu10k1_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_emu10k1_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_emu10k1 *emu = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@ -231,13 +232,14 @@ static int snd_emu10k1_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_emu10k1_resume(struct pci_dev *pci)
static int snd_emu10k1_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_emu10k1 *emu = card->private_data;
pci_set_power_state(pci, PCI_D0);
@ -261,17 +263,21 @@ static int snd_emu10k1_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(snd_emu10k1_pm, snd_emu10k1_suspend, snd_emu10k1_resume);
#define SND_EMU10K1_PM_OPS &snd_emu10k1_pm
#else
#define SND_EMU10K1_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver emu10k1_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_emu10k1_ids,
.probe = snd_card_emu10k1_probe,
.remove = __devexit_p(snd_card_emu10k1_remove),
#ifdef CONFIG_PM
.suspend = snd_emu10k1_suspend,
.resume = snd_emu10k1_resume,
#endif
.driver = {
.pm = SND_EMU10K1_PM_OPS,
},
};
module_pci_driver(emu10k1_driver);

+ 15
- 10
sound/pci/ens1370.c View File

@ -2033,9 +2033,10 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq)
}
#ifdef CONFIG_PM
static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_ensoniq_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 ensoniq *ensoniq = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@ -2058,13 +2059,14 @@ static int snd_ensoniq_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_ensoniq_resume(struct pci_dev *pci)
static int snd_ensoniq_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 ensoniq *ensoniq = card->private_data;
pci_set_power_state(pci, PCI_D0);
@ -2087,8 +2089,12 @@ static int snd_ensoniq_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_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume);
#define SND_ENSONIQ_PM_OPS &snd_ensoniq_pm
#else
#define SND_ENSONIQ_PM_OPS NULL
#endif /* CONFIG_PM */
static int __devinit snd_ensoniq_create(struct snd_card *card,
struct pci_dev *pci,
@ -2493,10 +2499,9 @@ static struct pci_driver ens137x_driver = {
.id_table = snd_audiopci_ids,
.probe = snd_audiopci_probe,
.remove = __devexit_p(snd_audiopci_remove),
#ifdef CONFIG_PM
.suspend = snd_ensoniq_suspend,
.resume = snd_ensoniq_resume,
#endif
.driver = {
.pm = SND_ENSONIQ_PM_OPS,
},
};
module_pci_driver(ens137x_driver);

+ 15
- 9
sound/pci/es1938.c View File

@ -1474,9 +1474,10 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = {
};
static int es1938_suspend(struct pci_dev *pci, pm_message_t state)
static int es1938_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 es1938 *chip = card->private_data;
unsigned char *s, *d;
@ -1494,13 +1495,14 @@ static int es1938_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 es1938_resume(struct pci_dev *pci)
static int es1938_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 es1938 *chip = card->private_data;
unsigned char *s, *d;
@ -1534,6 +1536,11 @@ static int es1938_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume);
#define ES1938_PM_OPS &es1938_pm
#else
#define ES1938_PM_OPS NULL
#endif /* CONFIG_PM */
#ifdef SUPPORT_JOYSTICK
@ -1887,10 +1894,9 @@ static struct pci_driver es1938_driver = {
.id_table = snd_es1938_ids,
.probe = snd_es1938_probe,
.remove = __devexit_p(snd_es1938_remove),
#ifdef CONFIG_PM
.suspend = es1938_suspend,
.resume = es1938_resume,
#endif
.driver = {
.pm = ES1938_PM_OPS,
},
};
module_pci_driver(es1938_driver);

+ 15
- 9
sound/pci/es1968.c View File

@ -2381,9 +2381,10 @@ static void snd_es1968_start_irq(struct es1968 *chip)
/*
* PM support
*/
static int es1968_suspend(struct pci_dev *pci, pm_message_t state)
static int es1968_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 es1968 *chip = card->private_data;
if (! chip->do_pm)
@ -2398,13 +2399,14 @@ static int es1968_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 es1968_resume(struct pci_dev *pci)
static int es1968_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 es1968 *chip = card->private_data;
struct esschan *es;
@ -2454,6 +2456,11 @@ static int es1968_resume(struct pci_dev *pci)
chip->in_suspend = 0;
return 0;
}
static SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume);
#define ES1968_PM_OPS &es1968_pm
#else
#define ES1968_PM_OPS NULL
#endif /* CONFIG_PM */
#ifdef SUPPORT_JOYSTICK
@ -2903,10 +2910,9 @@ static struct pci_driver es1968_driver = {
.id_table = snd_es1968_ids,
.probe = snd_es1968_probe,
.remove = __devexit_p(snd_es1968_remove),
#ifdef CONFIG_PM
.suspend = es1968_suspend,
.resume = es1968_resume,
#endif
.driver = {
.pm = ES1968_PM_OPS,
},
};
module_pci_driver(es1968_driver);

+ 16
- 10
sound/pci/fm801.c View File

@ -1369,9 +1369,10 @@ static unsigned char saved_regs[] = {
FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL,
};
static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state)
static int snd_fm801_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 fm801 *chip = card->private_data;
int i;
@ -1385,13 +1386,14 @@ static int snd_fm801_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_fm801_resume(struct pci_dev *pci)
static int snd_fm801_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 fm801 *chip = card->private_data;
int i;
@ -1414,17 +1416,21 @@ static int snd_fm801_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume);
#define SND_FM801_PM_OPS &snd_fm801_pm
#else
#define SND_FM801_PM_OPS NULL
#endif /* CONFIG_PM */
static struct pci_driver fm801_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_fm801_ids,
.probe = snd_card_fm801_probe,
.remove = __devexit_p(snd_card_fm801_remove),
#ifdef CONFIG_PM
.suspend = snd_fm801_suspend,
.resume = snd_fm801_resume,
#endif
.driver = {
.pm = SND_FM801_PM_OPS,
},
};
module_pci_driver(fm801_driver);

+ 1
- 1
sound/pci/hda/hda_codec.c View File

@ -3545,7 +3545,7 @@ static inline void hda_exec_init_verbs(struct hda_codec *codec) {}
static void hda_call_codec_suspend(struct hda_codec *codec)
{
if (codec->patch_ops.suspend)
codec->patch_ops.suspend(codec, PMSG_SUSPEND);
codec->patch_ops.suspend(codec);
hda_cleanup_all_streams(codec);
hda_set_power_state(codec,
codec->afg ? codec->afg : codec->mfg,


+ 1
- 1
sound/pci/hda/hda_codec.h View File

@ -703,7 +703,7 @@ struct hda_codec_ops {
void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state);
#ifdef CONFIG_PM
int (*suspend)(struct hda_codec *codec, pm_message_t state);
int (*suspend)(struct hda_codec *codec);
int (*resume)(struct hda_codec *codec);
#endif
#ifdef CONFIG_SND_HDA_POWER_SAVE


+ 18
- 11
sound/pci/hda/hda_intel.c View File

@ -2403,9 +2403,10 @@ static void azx_power_notify(struct hda_bus *bus)
* power management
*/
static int azx_suspend(struct pci_dev *pci, pm_message_t state)
static int azx_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 azx *chip = card->private_data;
struct azx_pcm *p;
@ -2424,13 +2425,14 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
pci_disable_msi(chip->pci);
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 azx_resume(struct pci_dev *pci)
static int azx_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 azx *chip = card->private_data;
pci_set_power_state(pci, PCI_D0);
@ -2455,6 +2457,12 @@ static int azx_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
static SIMPLE_DEV_PM_OPS(azx_pm, azx_suspend, azx_resume);
#define AZX_PM_OPS &azx_pm
#else
#define azx_suspend(dev)
#define azx_resume(dev)
#define AZX_PM_OPS NULL
#endif /* CONFIG_PM */
@ -2521,13 +2529,13 @@ static void azx_vs_set_state(struct pci_dev *pci,
disabled ? "Disabling" : "Enabling",
pci_name(chip->pci));
if (disabled) {
azx_suspend(pci, PMSG_FREEZE);
azx_suspend(&pci->dev);
chip->disabled = true;
snd_hda_lock_devices(chip->bus);
} else {
snd_hda_unlock_devices(chip->bus);
chip->disabled = false;
azx_resume(pci);
azx_resume(&pci->dev);
}
}
}
@ -3398,10 +3406,9 @@ static struct pci_driver azx_driver = {
.id_table = azx_ids,
.probe = azx_probe,
.remove = __devexit_p(azx_remove),
#ifdef CONFIG_PM
.suspend = azx_suspend,
.resume = azx_resume,
#endif
.driver = {
.pm = AZX_PM_OPS,
},
};
module_pci_driver(azx_driver);

+ 1
- 1
sound/pci/hda/patch_analog.c View File

@ -642,7 +642,7 @@ static void ad198x_free(struct hda_codec *codec)
}
#ifdef CONFIG_PM
static int ad198x_suspend(struct hda_codec *codec, pm_message_t state)
static int ad198x_suspend(struct hda_codec *codec)
{
ad198x_shutup(codec);
return 0;


+ 1
- 1
sound/pci/hda/patch_cirrus.c View File

@ -1892,7 +1892,7 @@ static int cs421x_parse_auto_config(struct hda_codec *codec)
Manage PDREF, when transitioning to D3hot
(DAC,ADC) -> D3, PDREF=1, AFG->D3
*/
static int cs421x_suspend(struct hda_codec *codec, pm_message_t state)
static int cs421x_suspend(struct hda_codec *codec)
{
struct cs_spec *spec = codec->spec;
unsigned int coef;


+ 1
- 1
sound/pci/hda/patch_conexant.c View File

@ -554,7 +554,7 @@ static int conexant_build_controls(struct hda_codec *codec)
}
#ifdef CONFIG_SND_HDA_POWER_SAVE
static int conexant_suspend(struct hda_codec *codec, pm_message_t state)
static int conexant_suspend(struct hda_codec *codec)
{
snd_hda_shutup_pins(codec);
return 0;


+ 1
- 1
sound/pci/hda/patch_realtek.c View File

@ -2300,7 +2300,7 @@ static void alc_power_eapd(struct hda_codec *codec)
alc_auto_setup_eapd(codec, false);
}
static int alc_suspend(struct hda_codec *codec, pm_message_t state)
static int alc_suspend(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
alc_shutup(codec);


+ 1
- 1
sound/pci/hda/patch_sigmatel.c View File

@ -4997,7 +4997,7 @@ static int stac92xx_resume(struct hda_codec *codec)
return 0;
}
static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
static int stac92xx_suspend(struct hda_codec *codec)
{
stac92xx_shutup(codec);
return 0;


+ 1
- 1
sound/pci/hda/patch_via.c View File

@ -1748,7 +1748,7 @@ static void via_unsol_event(struct hda_codec *codec,
}
#ifdef CONFIG_PM
static int via_suspend(struct hda_codec *codec, pm_message_t state)
static int via_suspend(struct hda_codec *codec)
{
struct via_spec *spec = codec->spec;
vt1708_stop_hp_work(spec);


+ 16
- 10
sound/pci/ice1712/ice1724.c View File