summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2019-04-24 00:57:15 -0400
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2019-05-30 10:34:54 -0400
commitc7ddfd3514f2702a70e9ff86504cafa856dd16b2 (patch)
tree29c44e3c33e571e59b4006bde2ab805701af48e0
parentec15c4d0d5d2e431169fbdf6c6bcf0c8ff71ef22 (diff)
PCI: altera-msi: Allow building as module
Altera MSI IP is a soft IP and is only available after an FPGA image (with design containing it) is programmed. Make driver modulable to support use case FPGA image is programmed the after kernel has booted, so that the driver can be loaded upon request. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r--drivers/pci/controller/Kconfig2
-rw-r--r--drivers/pci/controller/pcie-altera-msi.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
index 89906351bd3f..fe9f9f13ce11 100644
--- a/drivers/pci/controller/Kconfig
+++ b/drivers/pci/controller/Kconfig
@@ -181,7 +181,7 @@ config PCIE_ALTERA
181 FPGA. 181 FPGA.
182 182
183config PCIE_ALTERA_MSI 183config PCIE_ALTERA_MSI
184 bool "Altera PCIe MSI feature" 184 tristate "Altera PCIe MSI feature"
185 depends on PCIE_ALTERA 185 depends on PCIE_ALTERA
186 depends on PCI_MSI_IRQ_DOMAIN 186 depends on PCI_MSI_IRQ_DOMAIN
187 help 187 help
diff --git a/drivers/pci/controller/pcie-altera-msi.c b/drivers/pci/controller/pcie-altera-msi.c
index 025ef7d9a046..16d938920ca5 100644
--- a/drivers/pci/controller/pcie-altera-msi.c
+++ b/drivers/pci/controller/pcie-altera-msi.c
@@ -10,6 +10,7 @@
10#include <linux/interrupt.h> 10#include <linux/interrupt.h>
11#include <linux/irqchip/chained_irq.h> 11#include <linux/irqchip/chained_irq.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/module.h>
13#include <linux/msi.h> 14#include <linux/msi.h>
14#include <linux/of_address.h> 15#include <linux/of_address.h>
15#include <linux/of_irq.h> 16#include <linux/of_irq.h>
@@ -288,4 +289,13 @@ static int __init altera_msi_init(void)
288{ 289{
289 return platform_driver_register(&altera_msi_driver); 290 return platform_driver_register(&altera_msi_driver);
290} 291}
292
293static void __exit altera_msi_exit(void)
294{
295 platform_driver_unregister(&altera_msi_driver);
296}
297
291subsys_initcall(altera_msi_init); 298subsys_initcall(altera_msi_init);
299MODULE_DEVICE_TABLE(of, altera_msi_of_match);
300module_exit(altera_msi_exit);
301MODULE_LICENSE("GPL v2");