]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: UHCI: Remove PCI dependencies from uhci-hub
authorJan Andersson <jan@gaisler.com>
Fri, 6 May 2011 10:00:12 +0000 (12:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 7 May 2011 01:23:59 +0000 (18:23 -0700)
This patch is part of a series that extend the UHCI HCD to support
non-PCI host controllers.

uhci-hub.c contained two PCI vendor checks for silicon quirks. Move
these checks into uhci-hcd.c and use bits in uhci_hcd structure to
mark that we need to use the quirks.

This patch is followed by other patches that will remove PCI
dependencies from uhci-hcd.c as well.

Signed-off-by: Jan Andersson <jan@gaisler.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/uhci-hcd.c
drivers/usb/host/uhci-hcd.h
drivers/usb/host/uhci-hub.c

index 83344d688ff045c8879b6db2ee0cab3d0006694b..214851a6244f2b0ab5d520d001fd2f565fc08a94 100644 (file)
@@ -546,6 +546,17 @@ static int uhci_init(struct usb_hcd *hcd)
        }
        uhci->rh_numports = port;
 
+       /* Intel controllers report the OverCurrent bit active on.
+        * VIA controllers report it active off, so we'll adjust the
+        * bit value.  (It's not standardized in the UHCI spec.)
+        */
+       if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA)
+               uhci->oc_low = 1;
+
+       /* HP's server management chip requires a longer port reset delay. */
+       if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_HP)
+               uhci->wait_for_hp = 1;
+
        /* Kick BIOS off this hardware and reset if the controller
         * isn't already safely quiescent.
         */
index 49bf2790f9c22233039ca89e0a61defa0cd3f448..f86db61cf085668f442299292f6ee4c927b758c7 100644 (file)
@@ -415,6 +415,10 @@ struct uhci_hcd {
 
        struct timer_list fsbr_timer;           /* For turning off FBSR */
 
+       /* Silicon quirks */
+       unsigned int oc_low:1;                  /* OverCurrent bit active low */
+       unsigned int wait_for_hp:1;             /* Wait for HP port reset */
+
        /* Support for port suspend/resume/reset */
        unsigned long port_c_suspend;           /* Bit-arrays of ports */
        unsigned long resuming_ports;
index 6d59c0f77f2500a757320a0bc6edfba0d084d1e4..75418265488d7e2734f339a204ace31b3af8627b 100644 (file)
@@ -149,8 +149,7 @@ static void uhci_check_ports(struct uhci_hcd *uhci)
 
                                /* HP's server management chip requires
                                 * a longer delay. */
-                               if (to_pci_dev(uhci_dev(uhci))->vendor ==
-                                               PCI_VENDOR_ID_HP)
+                               if (uhci->wait_for_hp)
                                        wait_for_HP(port_addr);
 
                                /* If the port was enabled before, turning
@@ -266,8 +265,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                 * VIA controllers report it active off, so we'll adjust the
                 * bit value.  (It's not standardized in the UHCI spec.)
                 */
-               if (to_pci_dev(hcd->self.controller)->vendor ==
-                               PCI_VENDOR_ID_VIA)
+               if (uhci->oc_low)
                        status ^= USBPORTSC_OC;
 
                /* UHCI doesn't support C_RESET (always false) */