]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: dwc3: ep0: make dwc3 ep0 build in uboot
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 23 Feb 2015 13:10:00 +0000 (18:40 +0530)
committerMarek Vasut <marex@denx.de>
Tue, 14 Apr 2015 03:48:09 +0000 (05:48 +0200)
*) Changed the included header files to that used in u-boot.
*) added dwc3_ep_event_string() used in ep0.c
*) Fixed other misc warnings

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/linux-compat.h

index 97f71ad93f1d155b448224a20c56cccbe75b3af9..0ffcb7d7332068d5624c7c21fff4fa19a7ac7741 100644 (file)
@@ -840,6 +840,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)
index 1751b1d0d9522ba2b3bd887b0f7dc056c3dd5bf8..803ba5198bf666fccc887b63418d6e4cb5fede67 100644 (file)
  */
 
 #include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
 #include <linux/list.h>
-#include <linux/dma-mapping.h>
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/composite.h>
 
 #include "core.h"
-#include "debug.h"
 #include "gadget.h"
 #include "io.h"
 
+#include "linux-compat.h"
+
 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep);
 static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
                struct dwc3_ep *dep, struct dwc3_request *req);
@@ -277,8 +271,6 @@ int __dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
 
 int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
 {
-       struct dwc3_ep                  *dep = to_dwc3_ep(ep);
-       struct dwc3                     *dwc = dep->dwc;
        unsigned long                   flags;
        int                             ret;
 
@@ -632,12 +624,10 @@ static int dwc3_ep0_set_sel(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
        struct dwc3_ep  *dep;
        enum usb_device_state state = dwc->gadget.state;
        u16             wLength;
-       u16             wValue;
 
        if (state == USB_STATE_DEFAULT)
                return -EINVAL;
 
-       wValue = le16_to_cpu(ctrl->wValue);
        wLength = le16_to_cpu(ctrl->wLength);
 
        if (wLength != 6) {
index 719e82e8fc2529a6c834a9d284833ffff856c1fc..cbfb946ad32bbe0e4f98d5e57f9dafc86fec306e 100644 (file)
@@ -14,6 +14,7 @@
 
 #define pr_debug(format)                debug(format)
 #define WARN(val, format, arg...)      debug(format, ##arg)
+#define dev_WARN(dev, format, arg...)  debug(format, ##arg)
 #define WARN_ON_ONCE(val)              debug("Error %d\n", val)
 
 #define BUILD_BUG_ON_NOT_POWER_OF_2(n)