dwc2_udc.h 944 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  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
  6. */
  7. #ifndef __DWC2_USB_GADGET
  8. #define __DWC2_USB_GADGET
  9. #include <dm/ofnode.h>
  10. #define PHY0_SLEEP (1 << 5)
  11. #define DWC2_MAX_HW_ENDPOINTS 16
  12. struct dwc2_plat_otg_data {
  13. void *priv;
  14. ofnode phy_of_node;
  15. int (*phy_control)(int on);
  16. uintptr_t regs_phy;
  17. uintptr_t regs_otg;
  18. unsigned int usb_phy_ctrl;
  19. unsigned int usb_flags;
  20. unsigned int usb_gusbcfg;
  21. unsigned int rx_fifo_sz;
  22. unsigned int np_tx_fifo_sz;
  23. unsigned int tx_fifo_sz;
  24. unsigned int tx_fifo_sz_array[DWC2_MAX_HW_ENDPOINTS];
  25. unsigned char tx_fifo_sz_nb;
  26. bool force_b_session_valid;
  27. bool activate_stm_id_vb_detection;
  28. };
  29. int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata);
  30. int dwc2_udc_B_session_valid(struct udevice *dev);
  31. #endif /* __DWC2_USB_GADGET */