Commit dfeca7a8 authored by Jan Andersson's avatar Jan Andersson Committed by Greg Kroah-Hartman

USB: UHCI: Remove PCI dependencies from uhci-hub

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: default avatarJan Andersson <jan@gaisler.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ea437f39
...@@ -546,6 +546,17 @@ static int uhci_init(struct usb_hcd *hcd) ...@@ -546,6 +546,17 @@ static int uhci_init(struct usb_hcd *hcd)
} }
uhci->rh_numports = port; 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 /* Kick BIOS off this hardware and reset if the controller
* isn't already safely quiescent. * isn't already safely quiescent.
*/ */
......
...@@ -415,6 +415,10 @@ struct uhci_hcd { ...@@ -415,6 +415,10 @@ struct uhci_hcd {
struct timer_list fsbr_timer; /* For turning off FBSR */ 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 */ /* Support for port suspend/resume/reset */
unsigned long port_c_suspend; /* Bit-arrays of ports */ unsigned long port_c_suspend; /* Bit-arrays of ports */
unsigned long resuming_ports; unsigned long resuming_ports;
......
...@@ -149,8 +149,7 @@ static void uhci_check_ports(struct uhci_hcd *uhci) ...@@ -149,8 +149,7 @@ static void uhci_check_ports(struct uhci_hcd *uhci)
/* HP's server management chip requires /* HP's server management chip requires
* a longer delay. */ * a longer delay. */
if (to_pci_dev(uhci_dev(uhci))->vendor == if (uhci->wait_for_hp)
PCI_VENDOR_ID_HP)
wait_for_HP(port_addr); wait_for_HP(port_addr);
/* If the port was enabled before, turning /* If the port was enabled before, turning
...@@ -266,8 +265,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -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 * VIA controllers report it active off, so we'll adjust the
* bit value. (It's not standardized in the UHCI spec.) * bit value. (It's not standardized in the UHCI spec.)
*/ */
if (to_pci_dev(hcd->self.controller)->vendor == if (uhci->oc_low)
PCI_VENDOR_ID_VIA)
status ^= USBPORTSC_OC; status ^= USBPORTSC_OC;
/* UHCI doesn't support C_RESET (always false) */ /* UHCI doesn't support C_RESET (always false) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment