Skip to content

Commit 149cb7d

Browse files
hkallweittiwai
authored andcommitted
ALSA: hda: intel: Switch to pci_alloc_irq_vectors API
Switch from legacy pci_msi_enable()/pci_intx() API to the pci_alloc_irq_vectors API. Signed-off-by: Heiner Kallweit <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent cac99f7 commit 149cb7d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

sound/pci/hda/hda_intel.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,14 @@ static void azx_clear_irq_pending(struct azx *chip)
773773
static int azx_acquire_irq(struct azx *chip, int do_disconnect)
774774
{
775775
struct hdac_bus *bus = azx_bus(chip);
776+
int ret;
777+
778+
if (!chip->msi || pci_alloc_irq_vectors(chip->pci, 1, 1, PCI_IRQ_MSI) < 0) {
779+
ret = pci_alloc_irq_vectors(chip->pci, 1, 1, PCI_IRQ_INTX);
780+
if (ret < 0)
781+
return ret;
782+
chip->msi = 0;
783+
}
776784

777785
if (request_irq(chip->pci->irq, azx_interrupt,
778786
chip->msi ? 0 : IRQF_SHARED,
@@ -786,7 +794,6 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
786794
}
787795
bus->irq = chip->pci->irq;
788796
chip->card->sync_irq = bus->irq;
789-
pci_intx(chip->pci, !chip->msi);
790797
return 0;
791798
}
792799

@@ -1879,13 +1886,9 @@ static int azx_first_init(struct azx *chip)
18791886
chip->gts_present = true;
18801887
#endif
18811888

1882-
if (chip->msi) {
1883-
if (chip->driver_caps & AZX_DCAPS_NO_MSI64) {
1884-
dev_dbg(card->dev, "Disabling 64bit MSI\n");
1885-
pci->no_64bit_msi = true;
1886-
}
1887-
if (pci_enable_msi(pci) < 0)
1888-
chip->msi = 0;
1889+
if (chip->msi && chip->driver_caps & AZX_DCAPS_NO_MSI64) {
1890+
dev_dbg(card->dev, "Disabling 64bit MSI\n");
1891+
pci->no_64bit_msi = true;
18891892
}
18901893

18911894
pci_set_master(pci);
@@ -2037,7 +2040,7 @@ static int disable_msi_reset_irq(struct azx *chip)
20372040
free_irq(bus->irq, chip);
20382041
bus->irq = -1;
20392042
chip->card->sync_irq = -1;
2040-
pci_disable_msi(chip->pci);
2043+
pci_free_irq_vectors(chip->pci);
20412044
chip->msi = 0;
20422045
err = azx_acquire_irq(chip, 1);
20432046
if (err < 0)

0 commit comments

Comments
 (0)