mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 23:23:55 +08:00
SPI: designware: pci: Switch over to MSI interrupts
Some devices support MSI interrupts. Let's at least try to use them in platforms that provide MSI capability. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Link: https://lore.kernel.org/r/20191001081405.764161-1-felipe.balbi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
16c3e05803
commit
8f5c285f3e
@ -57,13 +57,18 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||||||
|
|
||||||
/* Get basic io resource and map it */
|
/* Get basic io resource and map it */
|
||||||
dws->paddr = pci_resource_start(pdev, pci_bar);
|
dws->paddr = pci_resource_start(pdev, pci_bar);
|
||||||
|
pci_set_master(pdev);
|
||||||
|
|
||||||
ret = pcim_iomap_regions(pdev, 1 << pci_bar, pci_name(pdev));
|
ret = pcim_iomap_regions(pdev, 1 << pci_bar, pci_name(pdev));
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
dws->regs = pcim_iomap_table(pdev)[pci_bar];
|
dws->regs = pcim_iomap_table(pdev)[pci_bar];
|
||||||
dws->irq = pdev->irq;
|
dws->irq = pci_irq_vector(pdev, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Specific handling for platforms, like dma setup,
|
* Specific handling for platforms, like dma setup,
|
||||||
@ -80,12 +85,15 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
pci_free_irq_vectors(pdev);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = dw_spi_add_host(&pdev->dev, dws);
|
ret = dw_spi_add_host(&pdev->dev, dws);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
pci_free_irq_vectors(pdev);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* PCI hook and SPI hook use the same drv data */
|
/* PCI hook and SPI hook use the same drv data */
|
||||||
pci_set_drvdata(pdev, dws);
|
pci_set_drvdata(pdev, dws);
|
||||||
@ -101,6 +109,7 @@ static void spi_pci_remove(struct pci_dev *pdev)
|
|||||||
struct dw_spi *dws = pci_get_drvdata(pdev);
|
struct dw_spi *dws = pci_get_drvdata(pdev);
|
||||||
|
|
||||||
dw_spi_remove_host(dws);
|
dw_spi_remove_host(dws);
|
||||||
|
pci_free_irq_vectors(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
Loading…
Reference in New Issue
Block a user