[PATCH 1/2] xHCI: print VIA xHCI host firmware version

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

 



add a method to print VIA xHCI host controller firmware version.

Signed-off-by: Elric Fu <elricfu1@xxxxxxxxx>
---
 drivers/usb/host/xhci-pci.c |   13 +++++++++++++
 drivers/usb/host/xhci.h     |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index ef98b38..872d024 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -35,6 +35,15 @@
 
 static const char hcd_name[] = "xhci_hcd";
 
+static void xhci_via_get_fw(struct xhci_hcd *xhci, struct pci_dev *pdev)
+{
+	u32 temp;
+
+	pci_read_config_dword(pdev, 0x260, &temp);
+	xhci_dbg(xhci, "VIA xHCI Host Firmware Version is %06x\n",
+			temp >> 8);
+}
+
 /* called after powerup, by probe or system-pm "wakeup" */
 static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
 {
@@ -95,6 +104,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		xhci->quirks |= XHCI_RESET_ON_RESUME;
 		xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
 	}
+	if (pdev->vendor == PCI_VENDOR_ID_VIA) {
+		xhci->quirks |= XHCI_VIA_HOST;
+		xhci_via_get_fw(xhci, pdev);
+	}
 }
 
 /* called during probe() after chip reset completes */
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index fb99c83..5b29d3c 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1462,6 +1462,7 @@ struct xhci_hcd {
 #define XHCI_RESET_ON_RESUME	(1 << 7)
 #define	XHCI_SW_BW_CHECKING	(1 << 8)
 #define XHCI_AMD_0x96_HOST	(1 << 9)
+#define XHCI_VIA_HOST		(1 << 10)
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
 	/* There are two roothubs to keep track of bus suspend info for */
-- 
1.7.1

--
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