ANDROID: usb: dwc3: gadget: Export dwc3_stop_active_transfer, dwc3_send_gadget_ep_cmd

Export dwc3_stop_active_transfer and dwc3_send_gadget_ep_cmd to allow
DWC3 glue layers to issue custom Start Transfer (DEPSTRTXFER) commands.

Bug: 175085986
Bug: 181326948
Bug: 177879761
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Change-Id: If402124ffa5d8d4b8b14d7502bbcd349e15295c7
This commit is contained in:
Daniel Mentz 2021-03-01 17:04:42 -08:00 committed by Saravana Kannan
parent aa88d3d644
commit 11f8c783df
2 changed files with 7 additions and 4 deletions

View File

@ -1485,6 +1485,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
struct dwc3_gadget_ep_cmd_params *params);
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int cmd,
u32 param);
void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool interrupt);
#else
static inline int dwc3_gadget_init(struct dwc3 *dwc)
{ return 0; }
@ -1504,6 +1505,9 @@ static inline int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
int cmd, u32 param)
{ return 0; }
static inline void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
bool interrupt)
{ }
#endif
#if IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)

View File

@ -406,6 +406,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
return ret;
}
EXPORT_SYMBOL_GPL(dwc3_send_gadget_ep_cmd);
static int dwc3_send_clear_stall_ep_cmd(struct dwc3_ep *dep)
{
@ -627,9 +628,6 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
return dwc3_send_gadget_ep_cmd(dep, DWC3_DEPCMD_SETEPCONFIG, &params);
}
static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
bool interrupt);
/**
* __dwc3_gadget_ep_enable - initializes a hw endpoint
* @dep: endpoint to be initialized
@ -3237,7 +3235,7 @@ static void dwc3_reset_gadget(struct dwc3 *dwc)
}
}
static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
bool interrupt)
{
struct dwc3_gadget_ep_cmd_params params;
@ -3297,6 +3295,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
else
dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
}
EXPORT_SYMBOL_GPL(dwc3_stop_active_transfer);
static void dwc3_clear_stall_all_ep(struct dwc3 *dwc)
{