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

Commit ffd4b4fc authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman
Browse files

xhci: Add helper to get xhci roothub from hcd



quick way to get the xhci roothub and thus all the ports
belonging to a certain hcd

Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9ea95ecc
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -554,6 +554,15 @@ static int xhci_get_ports(struct usb_hcd *hcd, __le32 __iomem ***port_array)
	return max_ports;
	return max_ports;
}
}


struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
{
	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);

	if (hcd->speed >= HCD_USB3)
		return &xhci->usb3_rhub;
	return &xhci->usb2_rhub;
}

static __le32 __iomem *xhci_get_port_io_addr(struct usb_hcd *hcd, int index)
static __le32 __iomem *xhci_get_port_io_addr(struct usb_hcd *hcd, int index)
{
{
	__le32 __iomem **port_array;
	__le32 __iomem **port_array;
+2 −0
Original line number Original line Diff line number Diff line
@@ -2110,6 +2110,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
		char *buf, u16 wLength);
		char *buf, u16 wLength);
int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);

void xhci_hc_died(struct xhci_hcd *xhci);
void xhci_hc_died(struct xhci_hcd *xhci);


#ifdef CONFIG_PM
#ifdef CONFIG_PM