ANDROID: usb: host: export symbols for xhci hooks usage
Export symbols for xhci hooks usage: xhci_ring_free - Allow xhci hook to free xhci_ring. xhci_get_slot_ctx - Allow xhci hook to get slot_ctx from the xhci_container_ctx for getting the slot_ctx information to know which slot is offloading and compare the context in remote subsystem memory if needed. xhci_get_ep_ctx - Allow xhci hook to get ep_ctx from the xhci_container_ctx for getting the ep_ctx information to know which ep is offloading and comparing the context in remote subsystem memory if needed. Export below xhci symbols for vendor modules to manage additional secondary rings. These will be used to manage the secondary ring for usb audio offload. xhci_segment_free - Free a segment struct. xhci_remove_stream_mapping - Free for sram xhci_link_segments - Make the prev segment point to the next segment. xhci_initialze_ring_info - Initialze a ring struct. xhci_check_trb_in_td_math - Check TRB math for validation. xhci_address_device - Issue an address device command xhci_bus_suspend xhci_bus_resume - Suspend and resume for power scenario Change-Id: I2d99bded67024b2a7c625f934567e39ac03a6e5f Signed-off-by: Howard Yen <howardyen@google.com> Bug: 175358363 Bug: 183761108 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Daehwan Jung <dh10.jung@samsung.com> Signed-off-by: JaeHun Jung <jh0801.jung@samsung.com>
This commit is contained in:
parent
90ab8e7f98
commit
6496f6cfbb
@ -1829,6 +1829,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_bus_suspend);
|
||||
|
||||
/*
|
||||
* Workaround for missing Cold Attach Status (CAS) if device re-plugged in S3.
|
||||
@ -1973,6 +1974,7 @@ int xhci_bus_resume(struct usb_hcd *hcd)
|
||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_bus_resume);
|
||||
|
||||
unsigned long xhci_get_resuming_ports(struct usb_hcd *hcd)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci,
|
||||
return seg;
|
||||
}
|
||||
|
||||
static void xhci_segment_free(struct xhci_hcd *xhci, struct xhci_segment *seg)
|
||||
void xhci_segment_free(struct xhci_hcd *xhci, struct xhci_segment *seg)
|
||||
{
|
||||
if (seg->trbs) {
|
||||
dma_pool_free(xhci->segment_pool, seg->trbs, seg->dma);
|
||||
@ -74,8 +74,9 @@ static void xhci_segment_free(struct xhci_hcd *xhci, struct xhci_segment *seg)
|
||||
kfree(seg->bounce_buf);
|
||||
kfree(seg);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_segment_free);
|
||||
|
||||
static void xhci_free_segments_for_ring(struct xhci_hcd *xhci,
|
||||
void xhci_free_segments_for_ring(struct xhci_hcd *xhci,
|
||||
struct xhci_segment *first)
|
||||
{
|
||||
struct xhci_segment *seg;
|
||||
@ -96,9 +97,9 @@ static void xhci_free_segments_for_ring(struct xhci_hcd *xhci,
|
||||
* DMA address of the next segment. The caller needs to set any Link TRB
|
||||
* related flags, such as End TRB, Toggle Cycle, and no snoop.
|
||||
*/
|
||||
static void xhci_link_segments(struct xhci_segment *prev,
|
||||
struct xhci_segment *next,
|
||||
enum xhci_ring_type type, bool chain_links)
|
||||
void xhci_link_segments(struct xhci_segment *prev,
|
||||
struct xhci_segment *next,
|
||||
enum xhci_ring_type type, bool chain_links)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@ -118,6 +119,7 @@ static void xhci_link_segments(struct xhci_segment *prev,
|
||||
prev->trbs[TRBS_PER_SEGMENT-1].link.control = cpu_to_le32(val);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_link_segments);
|
||||
|
||||
/*
|
||||
* Link the ring to the new segments.
|
||||
@ -256,7 +258,7 @@ static int xhci_update_stream_segment_mapping(
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void xhci_remove_stream_mapping(struct xhci_ring *ring)
|
||||
void xhci_remove_stream_mapping(struct xhci_ring *ring)
|
||||
{
|
||||
struct xhci_segment *seg;
|
||||
|
||||
@ -269,6 +271,7 @@ static void xhci_remove_stream_mapping(struct xhci_ring *ring)
|
||||
seg = seg->next;
|
||||
} while (seg != ring->first_seg);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_remove_stream_mapping);
|
||||
|
||||
static int xhci_update_stream_mapping(struct xhci_ring *ring, gfp_t mem_flags)
|
||||
{
|
||||
@ -317,6 +320,7 @@ void xhci_initialize_ring_info(struct xhci_ring *ring,
|
||||
*/
|
||||
ring->num_trbs_free = ring->num_segs * (TRBS_PER_SEGMENT - 1) - 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_initialize_ring_info);
|
||||
|
||||
/* Allocate segments and link them for a ring */
|
||||
static int xhci_alloc_segments_for_ring(struct xhci_hcd *xhci,
|
||||
@ -585,6 +589,7 @@ struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci,
|
||||
return (struct xhci_slot_ctx *)
|
||||
(ctx->bytes + CTX_SIZE(xhci->hcc_params));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_get_slot_ctx);
|
||||
|
||||
struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci,
|
||||
struct xhci_container_ctx *ctx,
|
||||
@ -2067,7 +2072,7 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci,
|
||||
}
|
||||
|
||||
/* TRB math checks for xhci_trb_in_td(), using the command and event rings. */
|
||||
static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci)
|
||||
int xhci_check_trb_in_td_math(struct xhci_hcd *xhci)
|
||||
{
|
||||
struct {
|
||||
dma_addr_t input_dma;
|
||||
@ -2187,6 +2192,7 @@ static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci)
|
||||
xhci_dbg(xhci, "TRB math tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_check_trb_in_td_math);
|
||||
|
||||
static void xhci_set_hc_event_deq(struct xhci_hcd *xhci)
|
||||
{
|
||||
|
@ -4410,10 +4410,11 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
|
||||
int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
|
||||
{
|
||||
return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ADDRESS);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_address_device);
|
||||
|
||||
static int xhci_enable_device(struct usb_hcd *hcd, struct usb_device *udev)
|
||||
{
|
||||
|
@ -2083,6 +2083,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev,
|
||||
struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci,
|
||||
unsigned int num_segs, unsigned int cycle_state,
|
||||
enum xhci_ring_type type, unsigned int max_packet, gfp_t flags);
|
||||
void xhci_remove_stream_mapping(struct xhci_ring *ring);
|
||||
void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring);
|
||||
int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
|
||||
unsigned int num_trbs, gfp_t flags);
|
||||
@ -2144,6 +2145,7 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
|
||||
void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
|
||||
int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev,
|
||||
struct usb_tt *tt, gfp_t mem_flags);
|
||||
int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev);
|
||||
int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id);
|
||||
int xhci_ext_cap_init(struct xhci_hcd *xhci);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user