diff options
Diffstat (limited to 'sound/pci/intel8x0.c')
-rw-r--r-- | sound/pci/intel8x0.c | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 8eb966505d2d..0801083f32dd 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -69,7 +69,7 @@ static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | |||
69 | static int ac97_clock = 0; | 69 | static int ac97_clock = 0; |
70 | static char *ac97_quirk; | 70 | static char *ac97_quirk; |
71 | static int buggy_semaphore; | 71 | static int buggy_semaphore; |
72 | static int buggy_irq; | 72 | static int buggy_irq = -1; /* auto-check */ |
73 | static int xbox; | 73 | static int xbox; |
74 | 74 | ||
75 | module_param(index, int, 0444); | 75 | module_param(index, int, 0444); |
@@ -2636,12 +2636,6 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, | |||
2636 | pci->device == PCI_DEVICE_ID_INTEL_440MX) | 2636 | pci->device == PCI_DEVICE_ID_INTEL_440MX) |
2637 | chip->fix_nocache = 1; /* enable workaround */ | 2637 | chip->fix_nocache = 1; /* enable workaround */ |
2638 | 2638 | ||
2639 | /* some Nforce[2] and ICH boards have problems with IRQ handling. | ||
2640 | * Needs to return IRQ_HANDLED for unknown irqs. | ||
2641 | */ | ||
2642 | if (device_type == DEVICE_NFORCE) | ||
2643 | chip->buggy_irq = 1; | ||
2644 | |||
2645 | if ((err = pci_request_regions(pci, card->shortname)) < 0) { | 2639 | if ((err = pci_request_regions(pci, card->shortname)) < 0) { |
2646 | kfree(chip); | 2640 | kfree(chip); |
2647 | pci_disable_device(pci); | 2641 | pci_disable_device(pci); |
@@ -2682,15 +2676,6 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, | |||
2682 | } | 2676 | } |
2683 | 2677 | ||
2684 | port_inited: | 2678 | port_inited: |
2685 | if (request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) { | ||
2686 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); | ||
2687 | snd_intel8x0_free(chip); | ||
2688 | return -EBUSY; | ||
2689 | } | ||
2690 | chip->irq = pci->irq; | ||
2691 | pci_set_master(pci); | ||
2692 | synchronize_irq(chip->irq); | ||
2693 | |||
2694 | chip->bdbars_count = bdbars[device_type]; | 2679 | chip->bdbars_count = bdbars[device_type]; |
2695 | 2680 | ||
2696 | /* initialize offsets */ | 2681 | /* initialize offsets */ |
@@ -2741,13 +2726,27 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, | |||
2741 | int_sta_masks = 0; | 2726 | int_sta_masks = 0; |
2742 | for (i = 0; i < chip->bdbars_count; i++) { | 2727 | for (i = 0; i < chip->bdbars_count; i++) { |
2743 | ichdev = &chip->ichd[i]; | 2728 | ichdev = &chip->ichd[i]; |
2744 | ichdev->bdbar = ((u32 *)chip->bdbars.area) + (i * ICH_MAX_FRAGS * 2); | 2729 | ichdev->bdbar = ((u32 *)chip->bdbars.area) + |
2745 | ichdev->bdbar_addr = chip->bdbars.addr + (i * sizeof(u32) * ICH_MAX_FRAGS * 2); | 2730 | (i * ICH_MAX_FRAGS * 2); |
2731 | ichdev->bdbar_addr = chip->bdbars.addr + | ||
2732 | (i * sizeof(u32) * ICH_MAX_FRAGS * 2); | ||
2746 | int_sta_masks |= ichdev->int_sta_mask; | 2733 | int_sta_masks |= ichdev->int_sta_mask; |
2747 | } | 2734 | } |
2748 | chip->int_sta_reg = device_type == DEVICE_ALI ? ICH_REG_ALI_INTERRUPTSR : ICH_REG_GLOB_STA; | 2735 | chip->int_sta_reg = device_type == DEVICE_ALI ? |
2736 | ICH_REG_ALI_INTERRUPTSR : ICH_REG_GLOB_STA; | ||
2749 | chip->int_sta_mask = int_sta_masks; | 2737 | chip->int_sta_mask = int_sta_masks; |
2750 | 2738 | ||
2739 | /* request irq after initializaing int_sta_mask, etc */ | ||
2740 | if (request_irq(pci->irq, snd_intel8x0_interrupt, | ||
2741 | SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) { | ||
2742 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); | ||
2743 | snd_intel8x0_free(chip); | ||
2744 | return -EBUSY; | ||
2745 | } | ||
2746 | chip->irq = pci->irq; | ||
2747 | pci_set_master(pci); | ||
2748 | synchronize_irq(chip->irq); | ||
2749 | |||
2751 | if ((err = snd_intel8x0_chip_init(chip, 1)) < 0) { | 2750 | if ((err = snd_intel8x0_chip_init(chip, 1)) < 0) { |
2752 | snd_intel8x0_free(chip); | 2751 | snd_intel8x0_free(chip); |
2753 | return err; | 2752 | return err; |
@@ -2827,6 +2826,16 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci, | |||
2827 | } | 2826 | } |
2828 | } | 2827 | } |
2829 | 2828 | ||
2829 | if (buggy_irq < 0) { | ||
2830 | /* some Nforce[2] and ICH boards have problems with IRQ handling. | ||
2831 | * Needs to return IRQ_HANDLED for unknown irqs. | ||
2832 | */ | ||
2833 | if (pci_id->driver_data == DEVICE_NFORCE) | ||
2834 | buggy_irq = 1; | ||
2835 | else | ||
2836 | buggy_irq = 0; | ||
2837 | } | ||
2838 | |||
2830 | if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, | 2839 | if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, |
2831 | &chip)) < 0) { | 2840 | &chip)) < 0) { |
2832 | snd_card_free(card); | 2841 | snd_card_free(card); |