Merge branch '2020-05-15-kconfig-migrations'
[oweals/u-boot.git] / common / usb.c
index b70f614d244f56a2ea2c29b007f45158dc92818c..686f09a77d1ec7caf151b21dadaa17ec979f7f4e 100644 (file)
@@ -28,6 +28,7 @@
 #include <common.h>
 #include <command.h>
 #include <dm.h>
+#include <malloc.h>
 #include <memalign.h>
 #include <asm/processor.h>
 #include <linux/compiler.h>
@@ -171,6 +172,12 @@ int usb_detect_change(void)
        return change;
 }
 
+/* Lock or unlock async schedule on the controller */
+__weak int usb_lock_async(struct usb_device *dev, int lock)
+{
+       return 0;
+}
+
 /*
  * disables the asynch behaviour of the control message. This is used for data
  * transfers that uses the exclusiv access to the control and bulk messages.
@@ -192,12 +199,15 @@ int usb_disable_asynch(int disable)
  */
 
 /*
- * submits an Interrupt Message
+ * submits an Interrupt Message. Some drivers may implement non-blocking
+ * polling: when non-block is true and the device is not responding return
+ * -EAGAIN instead of waiting for device to respond.
  */
-int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe,
-                       void *buffer, int transfer_len, int interval)
+int usb_int_msg(struct usb_device *dev, unsigned long pipe,
+               void *buffer, int transfer_len, int interval, bool nonblock)
 {
-       return submit_int_msg(dev, pipe, buffer, transfer_len, interval);
+       return submit_int_msg(dev, pipe, buffer, transfer_len, interval,
+                             nonblock);
 }
 
 /*