forked from Minki/linux
Merge branch 'topic/pci-cleanup' into for-next
This commit is contained in:
commit
9e5947465d
@ -1873,7 +1873,6 @@ static int snd_ali_mixer(struct snd_ali *codec)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int ali_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -1914,16 +1913,11 @@ static int ali_suspend(struct device *dev)
|
||||
outl(0xffffffff, ALI_REG(chip, ALI_STOP));
|
||||
|
||||
spin_unlock_irq(&chip->reg_lock);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ali_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -1933,15 +1927,6 @@ static int ali_resume(struct device *dev)
|
||||
if (!im)
|
||||
return 0;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
spin_lock_irq(&chip->reg_lock);
|
||||
|
||||
for (i = 0; i < ALI_CHANNELS; i++) {
|
||||
|
@ -728,35 +728,20 @@ static int snd_als300_create(struct snd_card *card,
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_als300_suspend(struct device *dev)
|
||||
{
|
||||
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);
|
||||
snd_pcm_suspend_all(chip->pcm);
|
||||
snd_ac97_suspend(chip->ac97);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_als300_resume(struct device *dev)
|
||||
{
|
||||
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);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_als300_init(chip);
|
||||
snd_ac97_resume(chip->ac97);
|
||||
|
||||
|
@ -988,7 +988,6 @@ static void snd_card_als4000_remove(struct pci_dev *pci)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_als4000_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -997,29 +996,15 @@ static int snd_als4000_suspend(struct device *dev)
|
||||
|
||||
snd_pcm_suspend_all(chip->pcm);
|
||||
snd_sbmixer_suspend(chip);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_als4000_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_als4000_configure(chip);
|
||||
snd_sbdsp_reset(chip);
|
||||
snd_sbmixer_resume(chip);
|
||||
|
@ -1474,7 +1474,6 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock,
|
||||
*/
|
||||
static int snd_atiixp_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct atiixp *chip = card->private_data;
|
||||
int i;
|
||||
@ -1492,29 +1491,15 @@ static int snd_atiixp_suspend(struct device *dev)
|
||||
snd_ac97_suspend(chip->ac97[i]);
|
||||
snd_atiixp_aclink_down(chip);
|
||||
snd_atiixp_chip_stop(chip);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_atiixp_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct atiixp *chip = card->private_data;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_atiixp_aclink_reset(chip);
|
||||
snd_atiixp_chip_start(chip);
|
||||
|
||||
|
@ -1120,7 +1120,6 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
|
||||
*/
|
||||
static int snd_atiixp_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -1132,29 +1131,15 @@ static int snd_atiixp_suspend(struct device *dev)
|
||||
snd_ac97_suspend(chip->ac97[i]);
|
||||
snd_atiixp_aclink_down(chip);
|
||||
snd_atiixp_chip_stop(chip);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_atiixp_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_atiixp_aclink_reset(chip);
|
||||
snd_atiixp_chip_start(chip);
|
||||
|
||||
|
@ -2694,7 +2694,6 @@ snd_azf3328_resume_ac97(const struct snd_azf3328 *chip)
|
||||
static int
|
||||
snd_azf3328_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -2720,29 +2719,15 @@ snd_azf3328_suspend(struct device *dev)
|
||||
ARRAY_SIZE(chip->saved_regs_mpu), chip->saved_regs_mpu);
|
||||
snd_azf3328_suspend_regs(chip, chip->opl3_io,
|
||||
ARRAY_SIZE(chip->saved_regs_opl3), chip->saved_regs_opl3);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
snd_azf3328_resume(struct device *dev)
|
||||
{
|
||||
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);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_azf3328_resume_regs(chip, chip->saved_regs_game, chip->game_io,
|
||||
ARRAY_SIZE(chip->saved_regs_game));
|
||||
snd_azf3328_resume_regs(chip, chip->saved_regs_mpu, chip->mpu_io,
|
||||
|
@ -1910,7 +1910,6 @@ static void snd_ca0106_remove(struct pci_dev *pci)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_ca0106_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -1923,30 +1922,15 @@ static int snd_ca0106_suspend(struct device *dev)
|
||||
snd_ca0106_mixer_suspend(chip);
|
||||
|
||||
ca0106_stop_chip(chip);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ca0106_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
pci_set_master(pci);
|
||||
|
||||
ca0106_init_chip(chip, 1);
|
||||
|
||||
if (chip->details->ac97)
|
||||
|
@ -3347,7 +3347,6 @@ static unsigned char saved_mixers[] = {
|
||||
|
||||
static int snd_cmipci_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct cmipci *cm = card->private_data;
|
||||
int i;
|
||||
@ -3366,29 +3365,15 @@ static int snd_cmipci_suspend(struct device *dev)
|
||||
|
||||
/* disable ints */
|
||||
snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_cmipci_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct cmipci *cm = card->private_data;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
/* reset / initialize to a sane state */
|
||||
snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
|
||||
snd_cmipci_ch_reset(cm, CM_CH_PLAY);
|
||||
|
@ -1996,7 +1996,6 @@ static int saved_regs[SUSPEND_REGISTERS] = {
|
||||
|
||||
static int cs4281_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct cs4281 *chip = card->private_data;
|
||||
u32 ulCLK;
|
||||
@ -2035,30 +2034,16 @@ static int cs4281_suspend(struct device *dev)
|
||||
ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
|
||||
ulCLK &= ~CLKCR1_CKRA;
|
||||
snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs4281_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
|
||||
ulCLK |= CLKCR1_CKRA;
|
||||
snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
|
||||
|
@ -3774,7 +3774,6 @@ static unsigned int saved_regs[] = {
|
||||
|
||||
static int snd_cs46xx_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -3799,16 +3798,11 @@ static int snd_cs46xx_suspend(struct device *dev)
|
||||
/* disable CLKRUN */
|
||||
chip->active_ctrl(chip, -chip->amplifier);
|
||||
chip->amplifier = amp_saved; /* restore the status */
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_cs46xx_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -3817,15 +3811,6 @@ static int snd_cs46xx_resume(struct device *dev)
|
||||
#endif
|
||||
unsigned int tmp;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
amp_saved = chip->amplifier;
|
||||
chip->amplifier = 0;
|
||||
chip->active_ctrl(chip, 1); /* force to on */
|
||||
|
@ -57,7 +57,6 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
|
||||
|
||||
static int snd_cs5535audio_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct cs5535audio *cs5535au = card->private_data;
|
||||
int i;
|
||||
@ -72,34 +71,17 @@ static int snd_cs5535audio_suspend(struct device *dev)
|
||||
}
|
||||
/* save important regs, then disable aclink in hw */
|
||||
snd_cs5535audio_stop_hardware(cs5535au);
|
||||
|
||||
if (pci_save_state(pci)) {
|
||||
dev_err(dev, "pci_save_state failed!\n");
|
||||
return -EIO;
|
||||
}
|
||||
pci_disable_device(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_cs5535audio_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
/* set LNK_WRM_RST to reset AC link */
|
||||
cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_WRM_RST);
|
||||
|
||||
|
@ -2096,20 +2096,11 @@ static int hw_suspend(struct hw *hw)
|
||||
pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0);
|
||||
}
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hw_resume(struct hw *hw, struct card_conf *info)
|
||||
{
|
||||
struct pci_dev *pci = hw->pci;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
|
||||
/* Re-initialize card hardware. */
|
||||
return hw_card_init(hw, info);
|
||||
}
|
||||
|
@ -2206,24 +2206,12 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int hw_suspend(struct hw *hw)
|
||||
{
|
||||
struct pci_dev *pci = hw->pci;
|
||||
|
||||
hw_card_stop(hw);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hw_resume(struct hw *hw, struct card_conf *info)
|
||||
{
|
||||
struct pci_dev *pci = hw->pci;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
|
||||
/* Re-initialize card hardware. */
|
||||
return hw_card_init(hw, info);
|
||||
}
|
||||
|
@ -2158,7 +2158,6 @@ ctl_error:
|
||||
|
||||
static int snd_echo_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct echoaudio *chip = dev_get_drvdata(dev);
|
||||
|
||||
snd_pcm_suspend_all(chip->analog_pcm);
|
||||
@ -2184,9 +2183,6 @@ static int snd_echo_suspend(struct device *dev)
|
||||
chip->dsp_code = NULL;
|
||||
free_irq(chip->irq, chip);
|
||||
chip->irq = -1;
|
||||
pci_save_state(pci);
|
||||
pci_disable_device(pci);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2200,7 +2196,6 @@ static int snd_echo_resume(struct device *dev)
|
||||
u32 pipe_alloc_mask;
|
||||
int err;
|
||||
|
||||
pci_restore_state(pci);
|
||||
commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL);
|
||||
if (commpage_bak == NULL)
|
||||
return -ENOMEM;
|
||||
|
@ -210,7 +210,6 @@ static void snd_card_emu10k1_remove(struct pci_dev *pci)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_emu10k1_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_emu10k1 *emu = card->private_data;
|
||||
|
||||
@ -232,28 +231,14 @@ static int snd_emu10k1_suspend(struct device *dev)
|
||||
snd_p16v_suspend(emu);
|
||||
|
||||
snd_emu10k1_done(emu);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_emu10k1_resume(struct device *dev)
|
||||
{
|
||||
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);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_emu10k1_resume_init(emu);
|
||||
snd_emu10k1_efx_resume(emu);
|
||||
snd_ac97_resume(emu->ac97);
|
||||
|
@ -2033,7 +2033,6 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_ensoniq_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct ensoniq *ensoniq = card->private_data;
|
||||
|
||||
@ -2054,28 +2053,14 @@ static int snd_ensoniq_suspend(struct device *dev)
|
||||
udelay(100);
|
||||
snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
|
||||
#endif
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ensoniq_resume(struct device *dev)
|
||||
{
|
||||
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);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_ensoniq_chip_init(ensoniq);
|
||||
|
||||
#ifdef CHIP1371
|
||||
|
@ -1454,7 +1454,6 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = {
|
||||
|
||||
static int es1938_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -1471,9 +1470,6 @@ static int es1938_suspend(struct device *dev)
|
||||
free_irq(chip->irq, chip);
|
||||
chip->irq = -1;
|
||||
}
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1484,14 +1480,6 @@ static int es1938_resume(struct device *dev)
|
||||
struct es1938 *chip = card->private_data;
|
||||
unsigned char *s, *d;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (request_irq(pci->irq, snd_es1938_interrupt,
|
||||
IRQF_SHARED, KBUILD_MODNAME, chip)) {
|
||||
dev_err(dev, "unable to grab IRQ %d, disabling device\n",
|
||||
|
@ -2383,7 +2383,6 @@ static void snd_es1968_start_irq(struct es1968 *chip)
|
||||
*/
|
||||
static int es1968_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct es1968 *chip = card->private_data;
|
||||
|
||||
@ -2396,16 +2395,11 @@ static int es1968_suspend(struct device *dev)
|
||||
snd_pcm_suspend_all(chip->pcm);
|
||||
snd_ac97_suspend(chip->ac97);
|
||||
snd_es1968_bob_stop(chip);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int es1968_resume(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -2413,16 +2407,6 @@ static int es1968_resume(struct device *dev)
|
||||
if (! chip->do_pm)
|
||||
return 0;
|
||||
|
||||
/* restore all our config */
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_es1968_chip_init(chip);
|
||||
|
||||
/* need to restore the base pointers.. */
|
||||
|
@ -1367,7 +1367,6 @@ static unsigned char saved_regs[] = {
|
||||
|
||||
static int snd_fm801_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct fm801 *chip = card->private_data;
|
||||
int i;
|
||||
@ -1379,29 +1378,15 @@ static int snd_fm801_suspend(struct device *dev)
|
||||
for (i = 0; i < ARRAY_SIZE(saved_regs); i++)
|
||||
chip->saved_regs[i] = inw(chip->port + saved_regs[i]);
|
||||
/* FIXME: tea575x suspend */
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_fm801_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct fm801 *chip = card->private_data;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_fm801_chip_init(chip, 1);
|
||||
snd_ac97_resume(chip->ac97);
|
||||
snd_ac97_resume(chip->ac97_sec);
|
||||
|
@ -795,7 +795,6 @@ static int param_set_xint(const char *val, const struct kernel_param *kp)
|
||||
*/
|
||||
static int azx_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct azx *chip;
|
||||
struct hda_intel *hda;
|
||||
@ -824,9 +823,6 @@ static int azx_suspend(struct device *dev)
|
||||
|
||||
if (chip->msi)
|
||||
pci_disable_msi(chip->pci);
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
|
||||
hda_display_power(false);
|
||||
return 0;
|
||||
@ -851,15 +847,6 @@ static int azx_resume(struct device *dev)
|
||||
hda_display_power(true);
|
||||
haswell_set_bclk(chip);
|
||||
}
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(chip->card->dev,
|
||||
"pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
if (chip->msi)
|
||||
if (pci_enable_msi(pci) < 0)
|
||||
chip->msi = 0;
|
||||
|
@ -2784,7 +2784,6 @@ static void snd_ice1712_remove(struct pci_dev *pci)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_ice1712_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_ice1712 *ice = card->private_data;
|
||||
|
||||
@ -2806,16 +2805,11 @@ static int snd_ice1712_suspend(struct device *dev)
|
||||
|
||||
if (ice->pm_suspend)
|
||||
ice->pm_suspend(ice);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ice1712_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_ice1712 *ice = card->private_data;
|
||||
int rate;
|
||||
@ -2823,16 +2817,6 @@ static int snd_ice1712_resume(struct device *dev)
|
||||
if (!ice->pm_suspend_enabled)
|
||||
return 0;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
pci_set_master(pci);
|
||||
|
||||
if (ice->cur_rate)
|
||||
rate = ice->cur_rate;
|
||||
else
|
||||
|
@ -2798,7 +2798,6 @@ static void snd_vt1724_remove(struct pci_dev *pci)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_vt1724_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_ice1712 *ice = card->private_data;
|
||||
|
||||
@ -2821,32 +2820,17 @@ static int snd_vt1724_suspend(struct device *dev)
|
||||
|
||||
if (ice->pm_suspend)
|
||||
ice->pm_suspend(ice);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_vt1724_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_ice1712 *ice = card->private_data;
|
||||
|
||||
if (!ice->pm_suspend_enabled)
|
||||
return 0;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_vt1724_chip_reset(ice);
|
||||
|
||||
if (snd_vt1724_chip_init(ice) < 0) {
|
||||
|
@ -2654,7 +2654,6 @@ static int snd_intel8x0_free(struct intel8x0 *chip)
|
||||
*/
|
||||
static int intel8x0_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct intel8x0 *chip = card->private_data;
|
||||
int i;
|
||||
@ -2682,12 +2681,6 @@ static int intel8x0_suspend(struct device *dev)
|
||||
free_irq(chip->irq, chip);
|
||||
chip->irq = -1;
|
||||
}
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
/* The call below may disable built-in speaker on some laptops
|
||||
* after S2RAM. So, don't touch it.
|
||||
*/
|
||||
/* pci_set_power_state(pci, PCI_D3hot); */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2698,14 +2691,6 @@ static int intel8x0_resume(struct device *dev)
|
||||
struct intel8x0 *chip = card->private_data;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
snd_intel8x0_chip_init(chip, 0);
|
||||
if (request_irq(pci->irq, snd_intel8x0_interrupt,
|
||||
IRQF_SHARED, KBUILD_MODNAME, chip)) {
|
||||
|
@ -1023,7 +1023,6 @@ static int snd_intel8x0m_free(struct intel8x0m *chip)
|
||||
*/
|
||||
static int intel8x0m_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct intel8x0m *chip = card->private_data;
|
||||
int i;
|
||||
@ -1036,9 +1035,6 @@ static int intel8x0m_suspend(struct device *dev)
|
||||
free_irq(chip->irq, chip);
|
||||
chip->irq = -1;
|
||||
}
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1048,14 +1044,6 @@ static int intel8x0m_resume(struct device *dev)
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct intel8x0m *chip = card->private_data;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
if (request_irq(pci->irq, snd_intel8x0m_interrupt,
|
||||
IRQF_SHARED, KBUILD_MODNAME, chip)) {
|
||||
dev_err(dev, "unable to grab IRQ %d, disabling device\n",
|
||||
|
@ -2395,7 +2395,6 @@ static int snd_m3_free(struct snd_m3 *chip)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int m3_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_m3 *chip = card->private_data;
|
||||
int i, dsp_index;
|
||||
@ -2421,16 +2420,11 @@ static int m3_suspend(struct device *dev)
|
||||
for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
|
||||
chip->suspend_mem[dsp_index++] =
|
||||
snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int m3_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_m3 *chip = card->private_data;
|
||||
int i, dsp_index;
|
||||
@ -2438,15 +2432,6 @@ static int m3_resume(struct device *dev)
|
||||
if (chip->suspend_mem == NULL)
|
||||
return 0;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
/* first lets just bring everything back. .*/
|
||||
snd_m3_outw(chip, 0, 0x54);
|
||||
snd_m3_outw(chip, 0, 0x56);
|
||||
|
@ -1392,7 +1392,6 @@ snd_nm256_peek_for_sig(struct nm256 *chip)
|
||||
*/
|
||||
static int nm256_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct nm256 *chip = card->private_data;
|
||||
|
||||
@ -1400,15 +1399,11 @@ static int nm256_suspend(struct device *dev)
|
||||
snd_pcm_suspend_all(chip->pcm);
|
||||
snd_ac97_suspend(chip->ac97);
|
||||
chip->coeffs_current = 0;
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nm256_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct nm256 *chip = card->private_data;
|
||||
int i;
|
||||
@ -1416,15 +1411,6 @@ static int nm256_resume(struct device *dev)
|
||||
/* Perform a full reset on the hardware */
|
||||
chip->in_resume = 1;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_nm256_init_chip(chip);
|
||||
|
||||
/* restore ac97 */
|
||||
|
@ -728,7 +728,6 @@ EXPORT_SYMBOL(oxygen_pci_remove);
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int oxygen_pci_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct oxygen *chip = card->private_data;
|
||||
unsigned int i, saved_interrupt_mask;
|
||||
@ -752,10 +751,6 @@ static int oxygen_pci_suspend(struct device *dev)
|
||||
flush_work(&chip->spdif_input_bits_work);
|
||||
flush_work(&chip->gpio_work);
|
||||
chip->interrupt_mask = saved_interrupt_mask;
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -787,20 +782,10 @@ static void oxygen_restore_ac97(struct oxygen *chip, unsigned int codec)
|
||||
|
||||
static int oxygen_pci_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct oxygen *chip = card->private_data;
|
||||
unsigned int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "cannot reenable device");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
|
||||
oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
|
||||
for (i = 0; i < OXYGEN_IO_SIZE; ++i)
|
||||
|
@ -1153,7 +1153,6 @@ static void riptide_handleirq(unsigned long dev_id)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int riptide_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_riptide *chip = card->private_data;
|
||||
|
||||
@ -1161,27 +1160,14 @@ static int riptide_suspend(struct device *dev)
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
|
||||
snd_pcm_suspend_all(chip->pcm);
|
||||
snd_ac97_suspend(chip->ac97);
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int riptide_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_riptide *chip = card->private_data;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
printk(KERN_ERR "riptide: pci_enable_device failed, "
|
||||
"disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
snd_riptide_initialize(chip);
|
||||
snd_ac97_resume(chip->ac97);
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
|
||||
|
@ -2358,7 +2358,6 @@ snd_rme96_create_switches(struct snd_card *card,
|
||||
|
||||
static int rme96_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct rme96 *rme96 = card->private_data;
|
||||
|
||||
@ -2381,26 +2380,14 @@ static int rme96_suspend(struct device *dev)
|
||||
/* disable the DAC */
|
||||
rme96->areg &= ~RME96_AR_DAC_EN;
|
||||
writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rme96_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct rme96 *rme96 = card->private_data;
|
||||
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* reset playback and record buffer pointers */
|
||||
writel(0, rme96->iobase + RME96_IO_SET_PLAY_POS
|
||||
+ rme96->playback_pointer);
|
||||
|
@ -1208,7 +1208,6 @@ static int sis_chip_init(struct sis7019 *sis)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int sis_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct sis7019 *sis = card->private_data;
|
||||
void __iomem *ioaddr = sis->ioaddr;
|
||||
@ -1237,9 +1236,6 @@ static int sis_suspend(struct device *dev)
|
||||
ioaddr += 4096;
|
||||
}
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1251,14 +1247,6 @@ static int sis_resume(struct device *dev)
|
||||
void __iomem *ioaddr = sis->ioaddr;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(&pci->dev, "unable to re-enable device\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (sis_chip_init(sis)) {
|
||||
dev_err(&pci->dev, "unable to re-init controller\n");
|
||||
goto error;
|
||||
@ -1281,7 +1269,6 @@ static int sis_resume(struct device *dev)
|
||||
memset(sis->suspend_state[0], 0, 4096);
|
||||
|
||||
sis->irq = pci->irq;
|
||||
pci_set_master(pci);
|
||||
|
||||
if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT)
|
||||
snd_ac97_resume(sis->ac97[0]);
|
||||
|
@ -3911,7 +3911,6 @@ static void snd_trident_clear_voices(struct snd_trident * trident, unsigned shor
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_trident_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_trident *trident = card->private_data;
|
||||
|
||||
@ -3923,28 +3922,14 @@ static int snd_trident_suspend(struct device *dev)
|
||||
|
||||
snd_ac97_suspend(trident->ac97);
|
||||
snd_ac97_suspend(trident->ac97_sec);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_trident_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_trident *trident = card->private_data;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
switch (trident->device) {
|
||||
case TRIDENT_DEVICE_ID_DX:
|
||||
snd_trident_4d_dx_init(trident);
|
||||
|
@ -2271,7 +2271,6 @@ static int snd_via82xx_chip_init(struct via82xx *chip)
|
||||
*/
|
||||
static int snd_via82xx_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct via82xx *chip = card->private_data;
|
||||
int i;
|
||||
@ -2291,28 +2290,15 @@ static int snd_via82xx_suspend(struct device *dev)
|
||||
chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10);
|
||||
}
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_via82xx_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct via82xx *chip = card->private_data;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_via82xx_chip_init(chip);
|
||||
|
||||
if (chip->chip_type == TYPE_VIA686) {
|
||||
|
@ -1031,7 +1031,6 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
|
||||
*/
|
||||
static int snd_via82xx_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct via82xx_modem *chip = card->private_data;
|
||||
int i;
|
||||
@ -1043,29 +1042,15 @@ static int snd_via82xx_suspend(struct device *dev)
|
||||
snd_via82xx_channel_reset(chip, &chip->devs[i]);
|
||||
synchronize_irq(chip->irq);
|
||||
snd_ac97_suspend(chip->ac97);
|
||||
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_via82xx_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct via82xx_modem *chip = card->private_data;
|
||||
int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
|
||||
snd_via82xx_chip_init(chip);
|
||||
|
||||
snd_ac97_resume(chip->ac97);
|
||||
|
@ -259,32 +259,17 @@ static void snd_vx222_remove(struct pci_dev *pci)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int snd_vx222_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_vx222 *vx = card->private_data;
|
||||
int err;
|
||||
|
||||
err = snd_vx_suspend(&vx->core);
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return err;
|
||||
return snd_vx_suspend(&vx->core);
|
||||
}
|
||||
|
||||
static int snd_vx222_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct snd_vx222 *vx = card->private_data;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
return snd_vx_resume(&vx->core);
|
||||
}
|
||||
|
||||
|
@ -2299,7 +2299,6 @@ static int saved_regs_index[] = {
|
||||
|
||||
static int snd_ymfpci_suspend(struct device *dev)
|
||||
{
|
||||
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;
|
||||
@ -2320,9 +2319,6 @@ static int snd_ymfpci_suspend(struct device *dev)
|
||||
snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0);
|
||||
snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0);
|
||||
snd_ymfpci_disable_dsp(chip);
|
||||
pci_disable_device(pci);
|
||||
pci_save_state(pci);
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2333,14 +2329,6 @@ static int snd_ymfpci_resume(struct device *dev)
|
||||
struct snd_ymfpci *chip = card->private_data;
|
||||
unsigned int i;
|
||||
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
pci_restore_state(pci);
|
||||
if (pci_enable_device(pci) < 0) {
|
||||
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||
snd_card_disconnect(card);
|
||||
return -EIO;
|
||||
}
|
||||
pci_set_master(pci);
|
||||
snd_ymfpci_aclink_reset(pci);
|
||||
snd_ymfpci_codec_ready(chip, 0);
|
||||
snd_ymfpci_download_image(chip);
|
||||
|
Loading…
Reference in New Issue
Block a user