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

Commit 4e3173f8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: host: xhci: Add helper function to return controller id"

parents 8bf748e4 436c1406
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2301,6 +2301,16 @@ usb_hcd_get_xfer_ring_dma_addr(struct usb_device *udev,
	return hcd->driver->get_xfer_ring_dma_addr(hcd, udev, ep);
}

int usb_hcd_get_controller_id(struct usb_device *udev)
{
	struct usb_hcd	*hcd = bus_to_hcd(udev->bus);

	if (!HCD_RH_RUNNING(hcd))
		return -EINVAL;

	return hcd->driver->get_core_id(hcd);
}

#ifdef	CONFIG_PM

int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg)
+9 −0
Original line number Diff line number Diff line
@@ -872,6 +872,15 @@ dma_addr_t usb_get_xfer_ring_dma_addr(struct usb_device *dev,
}
EXPORT_SYMBOL(usb_get_xfer_ring_dma_addr);

int usb_get_controller_id(struct usb_device *dev)
{
	if (dev->state == USB_STATE_NOTATTACHED)
		return -EINVAL;

	return usb_hcd_get_controller_id(dev);
}
EXPORT_SYMBOL(usb_get_controller_id);

/*-------------------------------------------------------------------*/
/*
 * __usb_get_extra_descriptor() finds a descriptor of specific type in the
+8 −0
Original line number Diff line number Diff line
@@ -4961,6 +4961,13 @@ dma_addr_t xhci_get_xfer_ring_dma_addr(struct usb_hcd *hcd,
	return 0;
}

int xhci_get_core_id(struct usb_hcd *hcd)
{
	struct xhci_hcd *xhci = hcd_to_xhci(hcd);

	return xhci->core_id;
}

static const struct hc_driver xhci_hc_driver = {
	.description =		"xhci-hcd",
	.product_desc =		"xHCI Host Controller",
@@ -5025,6 +5032,7 @@ static const struct hc_driver xhci_hc_driver = {
	.get_sec_event_ring_dma_addr =	xhci_get_sec_event_ring_dma_addr,
	.get_xfer_ring_dma_addr =	xhci_get_xfer_ring_dma_addr,
	.get_dcba_dma_addr =		xhci_get_dcba_dma_addr,
	.get_core_id =			xhci_get_core_id,
};

void xhci_init_driver(struct hc_driver *drv,
+1 −0
Original line number Diff line number Diff line
@@ -2096,6 +2096,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
void xhci_hc_died(struct xhci_hcd *xhci);
int xhci_get_core_id(struct usb_hcd *hcd);

#ifdef CONFIG_PM
int xhci_bus_suspend(struct usb_hcd *hcd);
+1 −0
Original line number Diff line number Diff line
@@ -816,6 +816,7 @@ extern dma_addr_t usb_get_sec_event_ring_dma_addr(struct usb_device *dev,
extern dma_addr_t usb_get_dcba_dma_addr(struct usb_device *dev);
extern dma_addr_t usb_get_xfer_ring_dma_addr(struct usb_device *dev,
	struct usb_host_endpoint *ep);
extern int usb_get_controller_id(struct usb_device *dev);

/* Sets up a group of bulk endpoints to support multiple stream IDs. */
extern int usb_alloc_streams(struct usb_interface *interface,
Loading