]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/dwc3/core.h
musb: Update usb-compat to work with struct usb_device without a parent ptr
[u-boot] / drivers / usb / dwc3 / core.h
index a7a7082e52dcf427bf4073dd79c0d4b2c6db9c48..72d2fcdd3f42ff17538004d295d7d6067d73c956 100644 (file)
@@ -392,7 +392,7 @@ struct dwc3_event_buffer {
        unsigned int            count;
        unsigned int            flags;
 
-#define DWC3_EVENT_PENDING     BIT(0)
+#define DWC3_EVENT_PENDING     (1UL << 0)
 
        dma_addr_t              dma;
 
@@ -641,10 +641,6 @@ struct dwc3_scratchpad_array {
  * @maximum_speed: maximum speed requested (mainly for testing purposes)
  * @revision: revision register contents
  * @dr_mode: requested mode of operation
- * @usb2_phy: pointer to USB2 PHY
- * @usb3_phy: pointer to USB3 PHY
- * @usb2_generic_phy: pointer to USB2 PHY
- * @usb3_generic_phy: pointer to USB3 PHY
  * @dcfg: saved contents of DCFG register
  * @gctl: saved contents of GCTL register
  * @isoch_delay: wValue from Set Isochronous Delay request;
@@ -699,6 +695,8 @@ struct dwc3_scratchpad_array {
  *     1       - -3.5dB de-emphasis
  *     2       - No de-emphasis
  *     3       - Reserved
+ * @index: index of _this_ controller
+ * @list: to maintain the list of dwc3 controllers
  */
 struct dwc3 {
        struct usb_ctrlrequest  *ctrl_req;
@@ -726,12 +724,6 @@ struct dwc3 {
        struct usb_gadget       gadget;
        struct usb_gadget_driver *gadget_driver;
 
-       struct usb_phy          *usb2_phy;
-       struct usb_phy          *usb3_phy;
-
-       struct phy              *usb2_generic_phy;
-       struct phy              *usb3_generic_phy;
-
        void __iomem            *regs;
        size_t                  regs_size;
 
@@ -821,6 +813,8 @@ struct dwc3 {
 
        unsigned                tx_de_emphasis_quirk:1;
        unsigned                tx_de_emphasis:2;
+       int                     index;
+       struct list_head        list;
 };
 
 /* -------------------------------------------------------------------------- */
@@ -840,6 +834,30 @@ struct dwc3_event_type {
 #define DWC3_DEPEVT_STREAMEVT          0x06
 #define DWC3_DEPEVT_EPCMDCMPLT         0x07
 
+/**
+ * dwc3_ep_event_string - returns event name
+ * @event: then event code
+ */
+static inline const char *dwc3_ep_event_string(u8 event)
+{
+       switch (event) {
+       case DWC3_DEPEVT_XFERCOMPLETE:
+               return "Transfer Complete";
+       case DWC3_DEPEVT_XFERINPROGRESS:
+               return "Transfer In-Progress";
+       case DWC3_DEPEVT_XFERNOTREADY:
+               return "Transfer Not Ready";
+       case DWC3_DEPEVT_RXTXFIFOEVT:
+               return "FIFO";
+       case DWC3_DEPEVT_STREAMEVT:
+               return "Stream";
+       case DWC3_DEPEVT_EPCMDCMPLT:
+               return "Endpoint Command Complete";
+       }
+
+       return "UNKNOWN";
+}
+
 /**
  * struct dwc3_event_depvt - Device Endpoint Events
  * @one_bit: indicates this is an endpoint event (not used)
@@ -969,7 +987,6 @@ struct dwc3_gadget_ep_cmd_params {
 #define DWC3_HAS_OTG                   BIT(3)
 
 /* prototypes */
-void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
 int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);
 
 #ifdef CONFIG_USB_DWC3_HOST
@@ -1012,20 +1029,4 @@ static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
 { return 0; }
 #endif
 
-/* power management interface */
-#if !IS_ENABLED(CONFIG_USB_DWC3_HOST)
-int dwc3_gadget_suspend(struct dwc3 *dwc);
-int dwc3_gadget_resume(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;
-}
-#endif /* !IS_ENABLED(CONFIG_USB_DWC3_HOST) */
-
 #endif /* __DRIVERS_USB_DWC3_CORE_H */