1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * drivers/usb/gadget/dwc2_udc.h
4 * Designware DWC2 on-chip full/high speed USB device controllers
5 * Copyright (C) 2005 for Samsung Electronics
8 #ifndef __DWC2_USB_GADGET
9 #define __DWC2_USB_GADGET
11 #include <dm/ofnode.h>
13 #define PHY0_SLEEP (1 << 5)
14 #define DWC2_MAX_HW_ENDPOINTS 16
16 struct dwc2_plat_otg_data {
19 int (*phy_control)(int on);
22 unsigned int usb_phy_ctrl;
23 unsigned int usb_flags;
24 unsigned int usb_gusbcfg;
25 unsigned int rx_fifo_sz;
26 unsigned int np_tx_fifo_sz;
27 unsigned int tx_fifo_sz;
28 unsigned int tx_fifo_sz_array[DWC2_MAX_HW_ENDPOINTS];
29 unsigned char tx_fifo_sz_nb;
30 bool force_b_session_valid;
31 bool force_vbus_detection;
32 bool activate_stm_id_vb_detection;
35 int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata);
37 int dwc2_udc_B_session_valid(struct udevice *dev);
39 #endif /* __DWC2_USB_GADGET */