From 97618148cec392dd81aedbef03504c90b5ddaf26 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 18 Aug 2017 16:59:33 -0700 Subject: [PATCH] usb: host: xhci: Add helper function to return controller id Function provides controller id used by a remote entity to identify which usb controller to program to initiate data transfer. Change-Id: Ie700363c1a4a19aeb6b51305c97298f3b4d6e387 Signed-off-by: Hemant Kumar --- drivers/usb/host/xhci.c | 8 ++++++++ drivers/usb/host/xhci.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 641e0280ad5a..be9258c6efda 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5031,6 +5031,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", @@ -5095,6 +5102,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, diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index f583cefecee0..ac637dc6e3cc 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1948,6 +1948,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength); 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_get_core_id(struct usb_hcd *hcd); #ifdef CONFIG_PM int xhci_bus_suspend(struct usb_hcd *hcd); -- 2.11.0