Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24149152 authored by Weitao Wang's avatar Weitao Wang Committed by Greg Kroah-Hartman
Browse files

USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value



commit dddb342b5b9e482bb213aecc08cbdb201ea4f8da upstream.

OverCurrent condition is not standardized in the UHCI spec.
Zhaoxin UHCI controllers report OverCurrent bit active off.
In order to handle OverCurrent condition correctly, the uhci-hcd
driver needs to be told to expect the active-off behavior.

Suggested-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarWeitao Wang <WeitaoWang-oc@zhaoxin.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230423105952.4526-1-WeitaoWang-oc@zhaoxin.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f36dc41
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -119,11 +119,13 @@ static int uhci_pci_init(struct usb_hcd *hcd)

	uhci->rh_numports = uhci_count_ports(hcd);

	/* 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.)
	/*
	 * Intel controllers report the OverCurrent bit active on.  VIA
	 * and ZHAOXIN 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)
	if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA ||
			to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN)
		uhci->oc_low = 1;

	/* HP's server management chip requires a longer port reset delay. */