summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorManan Aurora <maurora@google.com>2023-10-31 03:46:41 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-04 16:00:41 +0100
commit398aa9a7e77cf23c2a6f882ddd3dcd96f21771dc (patch)
tree1f876a8eabac27cd13b1eb1384482a9591c6c7ae /drivers/usb/dwc3/gadget.c
parentcd099cde4ed264403b434d8344994f97ac2a4349 (diff)
downloadlinux-stable-398aa9a7e77cf23c2a6f882ddd3dcd96f21771dc.tar.gz
linux-stable-398aa9a7e77cf23c2a6f882ddd3dcd96f21771dc.tar.bz2
linux-stable-398aa9a7e77cf23c2a6f882ddd3dcd96f21771dc.zip
usb: dwc3: Support EBC feature of DWC_usb31
Support configuration and use of bulk endpoints in the so-called EBC mode described in the DBC_usb31 databook (appendix E) Added a bit fifo_mode to usb_ep to indicate to the UDC driver that a specific endpoint is to operate in the EBC (or equivalent) mode when enabled Added macros for bits 15 and 14 of DEPCFG parameter 1 to indicate EBC mode and write back behaviour. These bits will be set to 1 when configuring an EBC endpoint as described in the programming guide Signed-off-by: Manan Aurora <maurora@google.com> Link: https://lore.kernel.org/r/20231031034641.660606-1-maurora@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 88d8d589f014..c15e965ea95a 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -673,6 +673,12 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
params.param1 |= DWC3_DEPCFG_BINTERVAL_M1(bInterval_m1);
}
+ if (dep->endpoint.fifo_mode) {
+ if (!(dwc->hwparams.hwparams4 & DWC3_EXT_BUFF_CONTROL))
+ return -EINVAL;
+ params.param1 |= DWC3_DEPCFG_EBC_HWO_NOWB | DWC3_DEPCFG_USE_EBC;
+ }
+
return dwc3_send_gadget_ep_cmd(dep, DWC3_DEPCMD_SETEPCONFIG, &params);
}