[PATCH 3/4] USB: OHCI: add MSI support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the callbacks to enable message-signaled interrupts for OHCI
controllers.  At the moment, this must be explicitly enabled with
a module parameter.

Signed-off-by: Clemens Ladisch <clemens@xxxxxxxxxx>
---
 drivers/usb/host/ohci-pci.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -22,6 +22,11 @@
 #include <linux/io.h>
 
 
+static int enable_msi;
+module_param(enable_msi, int, 0444);
+MODULE_PARM_DESC(enable_msi,
+		 "enable message-signaled interrupts, 0=no, 1=yes");
+
 /* constants used to work around PM-related transfer
  * glitches in some AMD 700 series southbridges
  */
@@ -358,6 +363,22 @@ static const struct pci_device_id ohci_p
 	{},
 };
 
+static int ohci_pci_prepare_irq(struct usb_hcd *hcd)
+{
+	struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
+
+	if (enable_msi)
+		pci_enable_msi(pdev);
+	return 0;
+}
+
+static void ohci_pci_cleanup_irq(struct usb_hcd *hcd)
+{
+	struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
+
+	pci_disable_msi(pdev);
+}
+
 static int ohci_pci_reset (struct usb_hcd *hcd)
 {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
@@ -468,6 +489,9 @@ static const struct hc_driver ohci_pci_h
 	.irq =			ohci_irq,
 	.flags =		HCD_MEMORY | HCD_USB11,
 
+	.pci_prepare_irq =	ohci_pci_prepare_irq,
+	.pci_cleanup_irq =	ohci_pci_cleanup_irq,
+
 	/*
 	 * basic lifecycle operations
 	 */
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux