#ifndef __DRIVERS_USB_DWC3_CORE_H
#define __DRIVERS_USB_DWC3_CORE_H
#include <linux/device.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/ioport.h>
#include <linux/list.h>
#include <linux/bitops.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/debugfs.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
#include <linux/usb/role.h>
#include <linux/ulpi/interface.h>
#include <linux/phy/phy.h>
#include <linux/power_supply.h>
#define DWC3_USB2_MAX_PORTS …
#define DWC3_USB3_MAX_PORTS …
#define DWC3_MSG_MAX …
#define DWC3_PULL_UP_TIMEOUT …
#define DWC3_BOUNCE_SIZE …
#define DWC3_EP0_SETUP_SIZE …
#define DWC3_ENDPOINTS_NUM …
#define DWC3_XHCI_RESOURCES_NUM …
#define DWC3_ISOC_MAX_RETRIES …
#define DWC3_SCRATCHBUF_SIZE …
#define DWC3_EVENT_BUFFERS_SIZE …
#define DWC3_EVENT_TYPE_MASK …
#define DWC3_EVENT_TYPE_DEV …
#define DWC3_EVENT_TYPE_CARKIT …
#define DWC3_EVENT_TYPE_I2C …
#define DWC3_DEVICE_EVENT_DISCONNECT …
#define DWC3_DEVICE_EVENT_RESET …
#define DWC3_DEVICE_EVENT_CONNECT_DONE …
#define DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE …
#define DWC3_DEVICE_EVENT_WAKEUP …
#define DWC3_DEVICE_EVENT_HIBER_REQ …
#define DWC3_DEVICE_EVENT_SUSPEND …
#define DWC3_DEVICE_EVENT_SOF …
#define DWC3_DEVICE_EVENT_ERRATIC_ERROR …
#define DWC3_DEVICE_EVENT_CMD_CMPL …
#define DWC3_DEVICE_EVENT_OVERFLOW …
#define DWC3_OTG_ROLE_IDLE …
#define DWC3_OTG_ROLE_HOST …
#define DWC3_OTG_ROLE_DEVICE …
#define DWC3_GEVNTCOUNT_MASK …
#define DWC3_GEVNTCOUNT_EHB …
#define DWC3_GSNPSID_MASK …
#define DWC3_GSNPSREV_MASK …
#define DWC3_GSNPS_ID(p) …
#define DWC3_XHCI_REGS_START …
#define DWC3_XHCI_REGS_END …
#define DWC3_GLOBALS_REGS_START …
#define DWC3_GLOBALS_REGS_END …
#define DWC3_DEVICE_REGS_START …
#define DWC3_DEVICE_REGS_END …
#define DWC3_OTG_REGS_START …
#define DWC3_OTG_REGS_END …
#define DWC3_RTK_RTD_GLOBALS_REGS_START …
#define DWC3_GSBUSCFG0 …
#define DWC3_GSBUSCFG1 …
#define DWC3_GTXTHRCFG …
#define DWC3_GRXTHRCFG …
#define DWC3_GCTL …
#define DWC3_GEVTEN …
#define DWC3_GSTS …
#define DWC3_GUCTL1 …
#define DWC3_GSNPSID …
#define DWC3_GGPIO …
#define DWC3_GUID …
#define DWC3_GUCTL …
#define DWC3_GBUSERRADDR0 …
#define DWC3_GBUSERRADDR1 …
#define DWC3_GPRTBIMAP0 …
#define DWC3_GPRTBIMAP1 …
#define DWC3_GHWPARAMS0 …
#define DWC3_GHWPARAMS1 …
#define DWC3_GHWPARAMS2 …
#define DWC3_GHWPARAMS3 …
#define DWC3_GHWPARAMS4 …
#define DWC3_GHWPARAMS5 …
#define DWC3_GHWPARAMS6 …
#define DWC3_GHWPARAMS7 …
#define DWC3_GDBGFIFOSPACE …
#define DWC3_GDBGLTSSM …
#define DWC3_GDBGBMU …
#define DWC3_GDBGLSPMUX …
#define DWC3_GDBGLSP …
#define DWC3_GDBGEPINFO0 …
#define DWC3_GDBGEPINFO1 …
#define DWC3_GPRTBIMAP_HS0 …
#define DWC3_GPRTBIMAP_HS1 …
#define DWC3_GPRTBIMAP_FS0 …
#define DWC3_GPRTBIMAP_FS1 …
#define DWC3_GUCTL2 …
#define DWC3_VER_NUMBER …
#define DWC3_VER_TYPE …
#define DWC3_GUSB2PHYCFG(n) …
#define DWC3_GUSB2I2CCTL(n) …
#define DWC3_GUSB2PHYACC(n) …
#define DWC3_GUSB3PIPECTL(n) …
#define DWC3_GTXFIFOSIZ(n) …
#define DWC3_GRXFIFOSIZ(n) …
#define DWC3_GEVNTADRLO(n) …
#define DWC3_GEVNTADRHI(n) …
#define DWC3_GEVNTSIZ(n) …
#define DWC3_GEVNTCOUNT(n) …
#define DWC3_GHWPARAMS8 …
#define DWC3_GUCTL3 …
#define DWC3_GFLADJ …
#define DWC3_GHWPARAMS9 …
#define DWC3_DCFG …
#define DWC3_DCTL …
#define DWC3_DEVTEN …
#define DWC3_DSTS …
#define DWC3_DGCMDPAR …
#define DWC3_DGCMD …
#define DWC3_DALEPENA …
#define DWC3_DCFG1 …
#define DWC3_DEP_BASE(n) …
#define DWC3_DEPCMDPAR2 …
#define DWC3_DEPCMDPAR1 …
#define DWC3_DEPCMDPAR0 …
#define DWC3_DEPCMD …
#define DWC3_DEV_IMOD(n) …
#define DWC3_OCFG …
#define DWC3_OCTL …
#define DWC3_OEVT …
#define DWC3_OEVTEN …
#define DWC3_OSTS …
#define DWC3_LLUCTL …
#define DWC3_GSBUSCFG0_INCR256BRSTENA …
#define DWC3_GSBUSCFG0_INCR128BRSTENA …
#define DWC3_GSBUSCFG0_INCR64BRSTENA …
#define DWC3_GSBUSCFG0_INCR32BRSTENA …
#define DWC3_GSBUSCFG0_INCR16BRSTENA …
#define DWC3_GSBUSCFG0_INCR8BRSTENA …
#define DWC3_GSBUSCFG0_INCR4BRSTENA …
#define DWC3_GSBUSCFG0_INCRBRSTENA …
#define DWC3_GSBUSCFG0_INCRBRST_MASK …
#define DWC3_GSBUSCFG0_REQINFO(n) …
#define DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED …
#define DWC3_GDBGLSPMUX_ENDBC …
#define DWC3_GDBGLSPMUX_HOSTSELECT(n) …
#define DWC3_GDBGLSPMUX_DEVSELECT(n) …
#define DWC3_GDBGLSPMUX_EPSELECT(n) …
#define DWC3_GDBGFIFOSPACE_NUM(n) …
#define DWC3_GDBGFIFOSPACE_TYPE(n) …
#define DWC3_GDBGFIFOSPACE_SPACE_AVAILABLE(n) …
#define DWC3_TXFIFO …
#define DWC3_RXFIFO …
#define DWC3_TXREQQ …
#define DWC3_RXREQQ …
#define DWC3_RXINFOQ …
#define DWC3_PSTATQ …
#define DWC3_DESCFETCHQ …
#define DWC3_EVENTQ …
#define DWC3_AUXEVENTQ …
#define DWC3_GRXTHRCFG_MAXRXBURSTSIZE(n) …
#define DWC3_GRXTHRCFG_RXPKTCNT(n) …
#define DWC3_GRXTHRCFG_PKTCNTSEL …
#define DWC3_GTXTHRCFG_MAXTXBURSTSIZE(n) …
#define DWC3_GTXTHRCFG_TXPKTCNT(n) …
#define DWC3_GTXTHRCFG_PKTCNTSEL …
#define DWC31_GRXTHRCFG_MAXRXBURSTSIZE(n) …
#define DWC31_GRXTHRCFG_RXPKTCNT(n) …
#define DWC31_GRXTHRCFG_PKTCNTSEL …
#define DWC31_RXTHRNUMPKTSEL_HS_PRD …
#define DWC31_RXTHRNUMPKT_HS_PRD(n) …
#define DWC31_RXTHRNUMPKTSEL_PRD …
#define DWC31_RXTHRNUMPKT_PRD(n) …
#define DWC31_MAXRXBURSTSIZE_PRD(n) …
#define DWC31_GTXTHRCFG_MAXTXBURSTSIZE(n) …
#define DWC31_GTXTHRCFG_TXPKTCNT(n) …
#define DWC31_GTXTHRCFG_PKTCNTSEL …
#define DWC31_TXTHRNUMPKTSEL_HS_PRD …
#define DWC31_TXTHRNUMPKT_HS_PRD(n) …
#define DWC31_TXTHRNUMPKTSEL_PRD …
#define DWC31_TXTHRNUMPKT_PRD(n) …
#define DWC31_MAXTXBURSTSIZE_PRD(n) …
#define DWC3_GCTL_PWRDNSCALE(n) …
#define DWC3_GCTL_PWRDNSCALE_MASK …
#define DWC3_GCTL_U2RSTECN …
#define DWC3_GCTL_RAMCLKSEL(x) …
#define DWC3_GCTL_CLK_BUS …
#define DWC3_GCTL_CLK_PIPE …
#define DWC3_GCTL_CLK_PIPEHALF …
#define DWC3_GCTL_CLK_MASK …
#define DWC3_GCTL_PRTCAP(n) …
#define DWC3_GCTL_PRTCAPDIR(n) …
#define DWC3_GCTL_PRTCAP_HOST …
#define DWC3_GCTL_PRTCAP_DEVICE …
#define DWC3_GCTL_PRTCAP_OTG …
#define DWC3_GCTL_CORESOFTRESET …
#define DWC3_GCTL_SOFITPSYNC …
#define DWC3_GCTL_SCALEDOWN(n) …
#define DWC3_GCTL_SCALEDOWN_MASK …
#define DWC3_GCTL_DISSCRAMBLE …
#define DWC3_GCTL_U2EXIT_LFPS …
#define DWC3_GCTL_GBLHIBERNATIONEN …
#define DWC3_GCTL_DSBLCLKGTNG …
#define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT …
#define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS …
#define DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK …
#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW …
#define DWC3_GUCTL1_PARKMODE_DISABLE_SS …
#define DWC3_GUCTL1_PARKMODE_DISABLE_HS …
#define DWC3_GUCTL1_RESUME_OPMODE_HS_HOST …
#define DWC3_GSTS_OTG_IP …
#define DWC3_GSTS_BC_IP …
#define DWC3_GSTS_ADP_IP …
#define DWC3_GSTS_HOST_IP …
#define DWC3_GSTS_DEVICE_IP …
#define DWC3_GSTS_CSR_TIMEOUT …
#define DWC3_GSTS_BUS_ERR_ADDR_VLD …
#define DWC3_GSTS_CURMOD(n) …
#define DWC3_GSTS_CURMOD_DEVICE …
#define DWC3_GSTS_CURMOD_HOST …
#define DWC3_GUSB2PHYCFG_PHYSOFTRST …
#define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS …
#define DWC3_GUSB2PHYCFG_ULPIEXTVBUSDRV …
#define DWC3_GUSB2PHYCFG_SUSPHY …
#define DWC3_GUSB2PHYCFG_ULPI_UTMI …
#define DWC3_GUSB2PHYCFG_ENBLSLPM …
#define DWC3_GUSB2PHYCFG_PHYIF(n) …
#define DWC3_GUSB2PHYCFG_PHYIF_MASK …
#define DWC3_GUSB2PHYCFG_USBTRDTIM(n) …
#define DWC3_GUSB2PHYCFG_USBTRDTIM_MASK …
#define USBTRDTIM_UTMI_8_BIT …
#define USBTRDTIM_UTMI_16_BIT …
#define UTMI_PHYIF_16_BIT …
#define UTMI_PHYIF_8_BIT …
#define DWC3_GUSB2PHYACC_NEWREGREQ …
#define DWC3_GUSB2PHYACC_DONE …
#define DWC3_GUSB2PHYACC_BUSY …
#define DWC3_GUSB2PHYACC_WRITE …
#define DWC3_GUSB2PHYACC_ADDR(n) …
#define DWC3_GUSB2PHYACC_EXTEND_ADDR(n) …
#define DWC3_GUSB2PHYACC_DATA(n) …
#define DWC3_GUSB3PIPECTL_PHYSOFTRST …
#define DWC3_GUSB3PIPECTL_U2SSINP3OK …
#define DWC3_GUSB3PIPECTL_DISRXDETINP3 …
#define DWC3_GUSB3PIPECTL_UX_EXIT_PX …
#define DWC3_GUSB3PIPECTL_REQP1P2P3 …
#define DWC3_GUSB3PIPECTL_DEP1P2P3(n) …
#define DWC3_GUSB3PIPECTL_DEP1P2P3_MASK …
#define DWC3_GUSB3PIPECTL_DEP1P2P3_EN …
#define DWC3_GUSB3PIPECTL_DEPOCHANGE …
#define DWC3_GUSB3PIPECTL_SUSPHY …
#define DWC3_GUSB3PIPECTL_LFPSFILT …
#define DWC3_GUSB3PIPECTL_RX_DETOPOLL …
#define DWC3_GUSB3PIPECTL_TX_DEEPH_MASK …
#define DWC3_GUSB3PIPECTL_TX_DEEPH(n) …
#define DWC31_GTXFIFOSIZ_TXFRAMNUM …
#define DWC31_GTXFIFOSIZ_TXFDEP(n) …
#define DWC3_GTXFIFOSIZ_TXFDEP(n) …
#define DWC3_GTXFIFOSIZ_TXFSTADDR(n) …
#define DWC31_GRXFIFOSIZ_RXFDEP(n) …
#define DWC3_GRXFIFOSIZ_RXFDEP(n) …
#define DWC3_GEVNTSIZ_INTMASK …
#define DWC3_GEVNTSIZ_SIZE(n) …
#define DWC3_GHWPARAMS0_MODE(n) …
#define DWC3_GHWPARAMS0_MODE_GADGET …
#define DWC3_GHWPARAMS0_MODE_HOST …
#define DWC3_GHWPARAMS0_MODE_DRD …
#define DWC3_GHWPARAMS0_MBUS_TYPE(n) …
#define DWC3_GHWPARAMS0_SBUS_TYPE(n) …
#define DWC3_GHWPARAMS0_MDWIDTH(n) …
#define DWC3_GHWPARAMS0_SDWIDTH(n) …
#define DWC3_GHWPARAMS0_AWIDTH(n) …
#define DWC3_GHWPARAMS1_EN_PWROPT(n) …
#define DWC3_GHWPARAMS1_EN_PWROPT_NO …
#define DWC3_GHWPARAMS1_EN_PWROPT_CLK …
#define DWC3_GHWPARAMS1_EN_PWROPT_HIB …
#define DWC3_GHWPARAMS1_PWROPT(n) …
#define DWC3_GHWPARAMS1_PWROPT_MASK …
#define DWC3_GHWPARAMS1_ENDBC …
#define DWC3_GHWPARAMS3_SSPHY_IFC(n) …
#define DWC3_GHWPARAMS3_SSPHY_IFC_DIS …
#define DWC3_GHWPARAMS3_SSPHY_IFC_GEN1 …
#define DWC3_GHWPARAMS3_SSPHY_IFC_GEN2 …
#define DWC3_GHWPARAMS3_HSPHY_IFC(n) …
#define DWC3_GHWPARAMS3_HSPHY_IFC_DIS …
#define DWC3_GHWPARAMS3_HSPHY_IFC_UTMI …
#define DWC3_GHWPARAMS3_HSPHY_IFC_ULPI …
#define DWC3_GHWPARAMS3_HSPHY_IFC_UTMI_ULPI …
#define DWC3_GHWPARAMS3_FSPHY_IFC(n) …
#define DWC3_GHWPARAMS3_FSPHY_IFC_DIS …
#define DWC3_GHWPARAMS3_FSPHY_IFC_ENA …
#define DWC3_GHWPARAMS4_HIBER_SCRATCHBUFS(n) …
#define DWC3_MAX_HIBER_SCRATCHBUFS …
#define DWC3_GHWPARAMS6_BCSUPPORT …
#define DWC3_GHWPARAMS6_OTG3SUPPORT …
#define DWC3_GHWPARAMS6_ADPSUPPORT …
#define DWC3_GHWPARAMS6_HNPSUPPORT …
#define DWC3_GHWPARAMS6_SRPSUPPORT …
#define DWC3_GHWPARAMS6_EN_FPGA …
#define DWC3_GHWPARAMS6_MDWIDTH(n) …
#define DWC3_GHWPARAMS7_RAM1_DEPTH(n) …
#define DWC3_GHWPARAMS7_RAM2_DEPTH(n) …
#define DWC3_GHWPARAMS9_DEV_TXF_FLUSH_BYPASS …
#define DWC3_GHWPARAMS9_DEV_MST …
#define DWC3_GFLADJ_30MHZ_SDBND_SEL …
#define DWC3_GFLADJ_30MHZ_MASK …
#define DWC3_GFLADJ_REFCLK_FLADJ_MASK …
#define DWC3_GFLADJ_REFCLK_LPM_SEL …
#define DWC3_GFLADJ_240MHZDECR …
#define DWC3_GFLADJ_240MHZDECR_PLS1 …
#define DWC3_GUCTL_REFCLKPER_MASK …
#define DWC3_GUCTL_REFCLKPER_SEL …
#define DWC3_GUCTL2_RST_ACTBITLATER …
#define DWC3_GUCTL3_SPLITDISABLE …
#define DWC3_DCFG_NUMLANES(n) …
#define DWC3_DCFG_DEVADDR(addr) …
#define DWC3_DCFG_DEVADDR_MASK …
#define DWC3_DCFG_SPEED_MASK …
#define DWC3_DCFG_SUPERSPEED_PLUS …
#define DWC3_DCFG_SUPERSPEED …
#define DWC3_DCFG_HIGHSPEED …
#define DWC3_DCFG_FULLSPEED …
#define DWC3_DCFG_NUMP_SHIFT …
#define DWC3_DCFG_NUMP(n) …
#define DWC3_DCFG_NUMP_MASK …
#define DWC3_DCFG_LPM_CAP …
#define DWC3_DCFG_IGNSTRMPP …
#define DWC3_DCTL_RUN_STOP …
#define DWC3_DCTL_CSFTRST …
#define DWC3_DCTL_LSFTRST …
#define DWC3_DCTL_HIRD_THRES_MASK …
#define DWC3_DCTL_HIRD_THRES(n) …
#define DWC3_DCTL_APPL1RES …
#define DWC3_DCTL_TRGTULST_MASK …
#define DWC3_DCTL_TRGTULST(n) …
#define DWC3_DCTL_TRGTULST_U2 …
#define DWC3_DCTL_TRGTULST_U3 …
#define DWC3_DCTL_TRGTULST_SS_DIS …
#define DWC3_DCTL_TRGTULST_RX_DET …
#define DWC3_DCTL_TRGTULST_SS_INACT …
#define DWC3_DCTL_NYET_THRES(n) …
#define DWC3_DCTL_KEEP_CONNECT …
#define DWC3_DCTL_L1_HIBER_EN …
#define DWC3_DCTL_CRS …
#define DWC3_DCTL_CSS …
#define DWC3_DCTL_INITU2ENA …
#define DWC3_DCTL_ACCEPTU2ENA …
#define DWC3_DCTL_INITU1ENA …
#define DWC3_DCTL_ACCEPTU1ENA …
#define DWC3_DCTL_TSTCTRL_MASK …
#define DWC3_DCTL_ULSTCHNGREQ_MASK …
#define DWC3_DCTL_ULSTCHNGREQ(n) …
#define DWC3_DCTL_ULSTCHNG_NO_ACTION …
#define DWC3_DCTL_ULSTCHNG_SS_DISABLED …
#define DWC3_DCTL_ULSTCHNG_RX_DETECT …
#define DWC3_DCTL_ULSTCHNG_SS_INACTIVE …
#define DWC3_DCTL_ULSTCHNG_RECOVERY …
#define DWC3_DCTL_ULSTCHNG_COMPLIANCE …
#define DWC3_DCTL_ULSTCHNG_LOOPBACK …
#define DWC3_DEVTEN_VNDRDEVTSTRCVEDEN …
#define DWC3_DEVTEN_EVNTOVERFLOWEN …
#define DWC3_DEVTEN_CMDCMPLTEN …
#define DWC3_DEVTEN_ERRTICERREN …
#define DWC3_DEVTEN_SOFEN …
#define DWC3_DEVTEN_U3L2L1SUSPEN …
#define DWC3_DEVTEN_HIBERNATIONREQEVTEN …
#define DWC3_DEVTEN_WKUPEVTEN …
#define DWC3_DEVTEN_ULSTCNGEN …
#define DWC3_DEVTEN_CONNECTDONEEN …
#define DWC3_DEVTEN_USBRSTEN …
#define DWC3_DEVTEN_DISCONNEVTEN …
#define DWC3_DSTS_CONNLANES(n) …
#define DWC3_DSTS_DCNRD …
#define DWC3_DSTS_PWRUPREQ …
#define DWC3_DSTS_RSS …
#define DWC3_DSTS_SSS …
#define DWC3_DSTS_COREIDLE …
#define DWC3_DSTS_DEVCTRLHLT …
#define DWC3_DSTS_USBLNKST_MASK …
#define DWC3_DSTS_USBLNKST(n) …
#define DWC3_DSTS_RXFIFOEMPTY …
#define DWC3_DSTS_SOFFN_MASK …
#define DWC3_DSTS_SOFFN(n) …
#define DWC3_DSTS_CONNECTSPD …
#define DWC3_DSTS_SUPERSPEED_PLUS …
#define DWC3_DSTS_SUPERSPEED …
#define DWC3_DSTS_HIGHSPEED …
#define DWC3_DSTS_FULLSPEED …
#define DWC3_DGCMD_SET_LMP …
#define DWC3_DGCMD_SET_PERIODIC_PAR …
#define DWC3_DGCMD_XMIT_FUNCTION …
#define DWC3_DGCMD_SET_SCRATCHPAD_ADDR_LO …
#define DWC3_DGCMD_SET_SCRATCHPAD_ADDR_HI …
#define DWC3_DGCMD_SELECTED_FIFO_FLUSH …
#define DWC3_DGCMD_ALL_FIFO_FLUSH …
#define DWC3_DGCMD_SET_ENDPOINT_NRDY …
#define DWC3_DGCMD_SET_ENDPOINT_PRIME …
#define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK …
#define DWC3_DGCMD_DEV_NOTIFICATION …
#define DWC3_DGCMD_STATUS(n) …
#define DWC3_DGCMD_CMDACT …
#define DWC3_DGCMD_CMDIOC …
#define DWC3_DGCMDPAR_FORCE_LINKPM_ACCEPT …
#define DWC3_DGCMDPAR_FIFO_NUM(n) …
#define DWC3_DGCMDPAR_RX_FIFO …
#define DWC3_DGCMDPAR_TX_FIFO …
#define DWC3_DGCMDPAR_LOOPBACK_DIS …
#define DWC3_DGCMDPAR_LOOPBACK_ENA …
#define DWC3_DGCMDPAR_DN_FUNC_WAKE …
#define DWC3_DGCMDPAR_INTF_SEL(n) …
#define DWC3_DEPCMD_PARAM_SHIFT …
#define DWC3_DEPCMD_PARAM(x) …
#define DWC3_DEPCMD_GET_RSC_IDX(x) …
#define DWC3_DEPCMD_STATUS(x) …
#define DWC3_DEPCMD_HIPRI_FORCERM …
#define DWC3_DEPCMD_CLEARPENDIN …
#define DWC3_DEPCMD_CMDACT …
#define DWC3_DEPCMD_CMDIOC …
#define DWC3_DEPCMD_DEPSTARTCFG …
#define DWC3_DEPCMD_ENDTRANSFER …
#define DWC3_DEPCMD_UPDATETRANSFER …
#define DWC3_DEPCMD_STARTTRANSFER …
#define DWC3_DEPCMD_CLEARSTALL …
#define DWC3_DEPCMD_SETSTALL …
#define DWC3_DEPCMD_GETSEQNUMBER …
#define DWC3_DEPCMD_GETEPSTATE …
#define DWC3_DEPCMD_SETTRANSFRESOURCE …
#define DWC3_DEPCMD_SETEPCONFIG …
#define DWC3_DEPCMD_CMD(x) …
#define DWC3_DALEPENA_EP(n) …
#define DWC3_DCFG1_DIS_MST_ENH …
#define DWC3_DEPCMD_TYPE_CONTROL …
#define DWC3_DEPCMD_TYPE_ISOC …
#define DWC3_DEPCMD_TYPE_BULK …
#define DWC3_DEPCMD_TYPE_INTR …
#define DWC3_DEV_IMOD_COUNT_SHIFT …
#define DWC3_DEV_IMOD_COUNT_MASK …
#define DWC3_DEV_IMOD_INTERVAL_SHIFT …
#define DWC3_DEV_IMOD_INTERVAL_MASK …
#define DWC3_OCFG_DISPWRCUTTOFF …
#define DWC3_OCFG_HIBDISMASK …
#define DWC3_OCFG_SFTRSTMASK …
#define DWC3_OCFG_OTGVERSION …
#define DWC3_OCFG_HNPCAP …
#define DWC3_OCFG_SRPCAP …
#define DWC3_OCTL_OTG3GOERR …
#define DWC3_OCTL_PERIMODE …
#define DWC3_OCTL_PRTPWRCTL …
#define DWC3_OCTL_HNPREQ …
#define DWC3_OCTL_SESREQ …
#define DWC3_OCTL_TERMSELIDPULSE …
#define DWC3_OCTL_DEVSETHNPEN …
#define DWC3_OCTL_HSTSETHNPEN …
#define DWC3_OEVT_DEVICEMODE …
#define DWC3_OEVT_XHCIRUNSTPSET …
#define DWC3_OEVT_DEVRUNSTPSET …
#define DWC3_OEVT_HIBENTRY …
#define DWC3_OEVT_CONIDSTSCHNG …
#define DWC3_OEVT_HRRCONFNOTIF …
#define DWC3_OEVT_HRRINITNOTIF …
#define DWC3_OEVT_ADEVIDLE …
#define DWC3_OEVT_ADEVBHOSTEND …
#define DWC3_OEVT_ADEVHOST …
#define DWC3_OEVT_ADEVHNPCHNG …
#define DWC3_OEVT_ADEVSRPDET …
#define DWC3_OEVT_ADEVSESSENDDET …
#define DWC3_OEVT_BDEVBHOSTEND …
#define DWC3_OEVT_BDEVHNPCHNG …
#define DWC3_OEVT_BDEVSESSVLDDET …
#define DWC3_OEVT_BDEVVBUSCHNG …
#define DWC3_OEVT_BSESSVLD …
#define DWC3_OEVT_HSTNEGSTS …
#define DWC3_OEVT_SESREQSTS …
#define DWC3_OEVT_ERROR …
#define DWC3_OEVTEN_XHCIRUNSTPSETEN …
#define DWC3_OEVTEN_DEVRUNSTPSETEN …
#define DWC3_OEVTEN_HIBENTRYEN …
#define DWC3_OEVTEN_CONIDSTSCHNGEN …
#define DWC3_OEVTEN_HRRCONFNOTIFEN …
#define DWC3_OEVTEN_HRRINITNOTIFEN …
#define DWC3_OEVTEN_ADEVIDLEEN …
#define DWC3_OEVTEN_ADEVBHOSTENDEN …
#define DWC3_OEVTEN_ADEVHOSTEN …
#define DWC3_OEVTEN_ADEVHNPCHNGEN …
#define DWC3_OEVTEN_ADEVSRPDETEN …
#define DWC3_OEVTEN_ADEVSESSENDDETEN …
#define DWC3_OEVTEN_BDEVBHOSTENDEN …
#define DWC3_OEVTEN_BDEVHNPCHNGEN …
#define DWC3_OEVTEN_BDEVSESSVLDDETEN …
#define DWC3_OEVTEN_BDEVVBUSCHNGEN …
#define DWC3_OSTS_DEVRUNSTP …
#define DWC3_OSTS_XHCIRUNSTP …
#define DWC3_OSTS_PERIPHERALSTATE …
#define DWC3_OSTS_XHCIPRTPOWER …
#define DWC3_OSTS_BSESVLD …
#define DWC3_OSTS_VBUSVLD …
#define DWC3_OSTS_CONIDSTS …
#define DWC3_LLUCTL_FORCE_GEN1 …
struct dwc3_trb;
struct dwc3_event_buffer { … };
#define DWC3_EP_FLAG_STALLED …
#define DWC3_EP_FLAG_WEDGED …
#define DWC3_EP_DIRECTION_TX …
#define DWC3_EP_DIRECTION_RX …
#define DWC3_TRB_NUM …
struct dwc3_ep { … };
enum dwc3_phy { … };
enum dwc3_ep0_next { … };
enum dwc3_ep0_state { … };
enum dwc3_link_state { … };
#define DWC3_TRB_SIZE_MASK …
#define DWC3_TRB_SIZE_LENGTH(n) …
#define DWC3_TRB_SIZE_PCM1(n) …
#define DWC3_TRB_SIZE_TRBSTS(n) …
#define DWC3_TRBSTS_OK …
#define DWC3_TRBSTS_MISSED_ISOC …
#define DWC3_TRBSTS_SETUP_PENDING …
#define DWC3_TRB_STS_XFER_IN_PROG …
#define DWC3_TRB_CTRL_HWO …
#define DWC3_TRB_CTRL_LST …
#define DWC3_TRB_CTRL_CHN …
#define DWC3_TRB_CTRL_CSP …
#define DWC3_TRB_CTRL_TRBCTL(n) …
#define DWC3_TRB_CTRL_ISP_IMI …
#define DWC3_TRB_CTRL_IOC …
#define DWC3_TRB_CTRL_SID_SOFN(n) …
#define DWC3_TRB_CTRL_GET_SID_SOFN(n) …
#define DWC3_TRBCTL_TYPE(n) …
#define DWC3_TRBCTL_NORMAL …
#define DWC3_TRBCTL_CONTROL_SETUP …
#define DWC3_TRBCTL_CONTROL_STATUS2 …
#define DWC3_TRBCTL_CONTROL_STATUS3 …
#define DWC3_TRBCTL_CONTROL_DATA …
#define DWC3_TRBCTL_ISOCHRONOUS_FIRST …
#define DWC3_TRBCTL_ISOCHRONOUS …
#define DWC3_TRBCTL_LINK_TRB …
struct dwc3_trb { … } __packed;
struct dwc3_hwparams { … };
#define DWC3_MODE(n) …
#define DWC3_NUM_INT(n) …
#define DWC3_NUM_IN_EPS_MASK …
#define DWC3_NUM_EPS_MASK …
#define DWC3_NUM_EPS(p) …
#define DWC3_NUM_IN_EPS(p) …
#define DWC3_RAM1_DEPTH(n) …
#define DWC3_MST_CAPABLE(p) …
struct dwc3_request { … };
struct dwc3_scratchpad_array { … };
struct dwc3 { … };
#define INCRX_BURST_MODE …
#define INCRX_UNDEF_LENGTH_BURST_MODE …
#define work_to_dwc(w) …
struct dwc3_event_type { … } __packed;
#define DWC3_DEPEVT_XFERCOMPLETE …
#define DWC3_DEPEVT_XFERINPROGRESS …
#define DWC3_DEPEVT_XFERNOTREADY …
#define DWC3_DEPEVT_RXTXFIFOEVT …
#define DWC3_DEPEVT_STREAMEVT …
#define DWC3_DEPEVT_EPCMDCMPLT …
struct dwc3_event_depevt { … } __packed;
struct dwc3_event_devt { … } __packed;
struct dwc3_event_gevt { … } __packed;
dwc3_event;
struct dwc3_gadget_ep_cmd_params { … };
#define DWC3_HAS_PERIPHERAL …
#define DWC3_HAS_XHCI …
#define DWC3_HAS_OTG …
void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode);
void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type);
#define DWC3_IP_IS(_ip) …
#define DWC3_VER_IS(_ip, _ver) …
#define DWC3_VER_IS_PRIOR(_ip, _ver) …
#define DWC3_VER_IS_WITHIN(_ip, _from, _to) …
#define DWC3_VER_TYPE_IS_WITHIN(_ip, _ver, _from, _to) …
static inline u32 dwc3_mdwidth(struct dwc3 *dwc)
{ … }
bool dwc3_has_imod(struct dwc3 *dwc);
int dwc3_event_buffers_setup(struct dwc3 *dwc);
void dwc3_event_buffers_cleanup(struct dwc3 *dwc);
int dwc3_core_soft_reset(struct dwc3 *dwc);
void dwc3_enable_susphy(struct dwc3 *dwc, bool enable);
#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_host_init(struct dwc3 *dwc);
void dwc3_host_exit(struct dwc3 *dwc);
#else
static inline int dwc3_host_init(struct dwc3 *dwc)
{ return 0; }
static inline void dwc3_host_exit(struct dwc3 *dwc)
{ }
#endif
#if IS_ENABLED(CONFIG_USB_DWC3_GADGET) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_gadget_init(struct dwc3 *dwc);
void dwc3_gadget_exit(struct dwc3 *dwc);
int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode);
int dwc3_gadget_get_link_state(struct dwc3 *dwc);
int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state);
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_gadget_clear_tx_fifos(struct dwc3 *dwc);
void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status);
#else
static inline int dwc3_gadget_init(struct dwc3 *dwc)
{ return 0; }
static inline void dwc3_gadget_exit(struct dwc3 *dwc)
{ }
static inline int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
{ return 0; }
static inline int dwc3_gadget_get_link_state(struct dwc3 *dwc)
{ return 0; }
static inline int dwc3_gadget_set_link_state(struct dwc3 *dwc,
enum dwc3_link_state state)
{ return 0; }
static inline int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
struct dwc3_gadget_ep_cmd_params *params)
{ return 0; }
static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
int cmd, u32 param)
{ return 0; }
static inline void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc)
{ }
#endif
#if IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_drd_init(struct dwc3 *dwc);
void dwc3_drd_exit(struct dwc3 *dwc);
void dwc3_otg_init(struct dwc3 *dwc);
void dwc3_otg_exit(struct dwc3 *dwc);
void dwc3_otg_update(struct dwc3 *dwc, bool ignore_idstatus);
void dwc3_otg_host_init(struct dwc3 *dwc);
#else
static inline int dwc3_drd_init(struct dwc3 *dwc)
{ return 0; }
static inline void dwc3_drd_exit(struct dwc3 *dwc)
{ }
static inline void dwc3_otg_init(struct dwc3 *dwc)
{ }
static inline void dwc3_otg_exit(struct dwc3 *dwc)
{ }
static inline void dwc3_otg_update(struct dwc3 *dwc, bool ignore_idstatus)
{ }
static inline void dwc3_otg_host_init(struct dwc3 *dwc)
{ }
#endif
#if !IS_ENABLED(CONFIG_USB_DWC3_HOST)
int dwc3_gadget_suspend(struct dwc3 *dwc);
int dwc3_gadget_resume(struct dwc3 *dwc);
void dwc3_gadget_process_pending_events(struct dwc3 *dwc);
#else
static inline int dwc3_gadget_suspend(struct dwc3 *dwc)
{
return 0;
}
static inline int dwc3_gadget_resume(struct dwc3 *dwc)
{
return 0;
}
static inline void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
{
}
#endif
#if IS_ENABLED(CONFIG_USB_DWC3_ULPI)
int dwc3_ulpi_init(struct dwc3 *dwc);
void dwc3_ulpi_exit(struct dwc3 *dwc);
#else
static inline int dwc3_ulpi_init(struct dwc3 *dwc)
{ return 0; }
static inline void dwc3_ulpi_exit(struct dwc3 *dwc)
{ }
#endif
#endif