diff options
Diffstat (limited to 'sound/pci/intel8x0.c')
-rw-r--r-- | sound/pci/intel8x0.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index f4319b8d4644..7f22dab07240 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -2476,10 +2476,14 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | |||
2476 | if (chip->device_type == DEVICE_INTEL_ICH4) | 2476 | if (chip->device_type == DEVICE_INTEL_ICH4) |
2477 | chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); | 2477 | chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); |
2478 | 2478 | ||
2479 | if (chip->irq >= 0) | 2479 | if (chip->irq >= 0) { |
2480 | synchronize_irq(chip->irq); | ||
2480 | free_irq(chip->irq, chip); | 2481 | free_irq(chip->irq, chip); |
2482 | chip->irq = -1; | ||
2483 | } | ||
2481 | pci_disable_device(pci); | 2484 | pci_disable_device(pci); |
2482 | pci_save_state(pci); | 2485 | pci_save_state(pci); |
2486 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2483 | return 0; | 2487 | return 0; |
2484 | } | 2488 | } |
2485 | 2489 | ||
@@ -2489,11 +2493,22 @@ static int intel8x0_resume(struct pci_dev *pci) | |||
2489 | struct intel8x0 *chip = card->private_data; | 2493 | struct intel8x0 *chip = card->private_data; |
2490 | int i; | 2494 | int i; |
2491 | 2495 | ||
2496 | pci_set_power_state(pci, PCI_D0); | ||
2492 | pci_restore_state(pci); | 2497 | pci_restore_state(pci); |
2493 | pci_enable_device(pci); | 2498 | if (pci_enable_device(pci) < 0) { |
2499 | printk(KERN_ERR "intel8x0: pci_enable_device failed, " | ||
2500 | "disabling device\n"); | ||
2501 | snd_card_disconnect(card); | ||
2502 | return -EIO; | ||
2503 | } | ||
2494 | pci_set_master(pci); | 2504 | pci_set_master(pci); |
2495 | request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED, | 2505 | if (request_irq(pci->irq, snd_intel8x0_interrupt, |
2496 | card->shortname, chip); | 2506 | IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) { |
2507 | printk(KERN_ERR "intel8x0: unable to grab IRQ %d, " | ||
2508 | "disabling device\n", pci->irq); | ||
2509 | snd_card_disconnect(card); | ||
2510 | return -EIO; | ||
2511 | } | ||
2497 | chip->irq = pci->irq; | 2512 | chip->irq = pci->irq; |
2498 | synchronize_irq(chip->irq); | 2513 | synchronize_irq(chip->irq); |
2499 | snd_intel8x0_chip_init(chip, 0); | 2514 | snd_intel8x0_chip_init(chip, 0); |