diff mbox series

[U-Boot,v2,7/9] usb: add usb_int_msg_nonblock

Message ID a0d1d75ddb240be9cc5132f73021db338b6721b9.1562090082.git.msuchanek@suse.de
State Superseded
Delegated to: Marek Vasut
Headers show
Series [U-Boot,v2,1/9] usb: r8a66597: return -ENOTSUPP from unimplemented submit_int_msg | expand

Commit Message

Michal Suchánek July 2, 2019, 5:55 p.m. UTC
Variant of the int_msg wrapper that does not introduce excessive retry
delay on error.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
v2: usb_submit_int_msg -> usb_int_msg
---
 common/usb.c  | 9 +++++++++
 include/usb.h | 2 ++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/common/usb.c b/common/usb.c
index f57c0e8cdf57..1bd60b24a555 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -200,6 +200,15 @@  int usb_int_msg(struct usb_device *dev, unsigned long pipe,
 	return submit_int_msg(dev, pipe, buffer, transfer_len, interval, false);
 }
 
+/*
+ * submits an Interrupt Message without retry
+ */
+int usb_int_msg_nonblock(struct usb_device *dev, unsigned long pipe,
+			void *buffer, int transfer_len, int interval)
+{
+	return submit_int_msg(dev, pipe, buffer, transfer_len, interval, true);
+}
+
 /*
  * submits a control message and waits for comletion (at least timeout * 1ms)
  * If timeout is 0, we don't wait for completion (used as example to set and
diff --git a/include/usb.h b/include/usb.h
index 6ca2eb30d08a..b0a079766652 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -263,6 +263,8 @@  int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
 			void *data, int len, int *actual_length, int timeout);
 int usb_int_msg(struct usb_device *dev, unsigned long pipe,
 			void *buffer, int transfer_len, int interval);
+int usb_int_msg_nonblock(struct usb_device *dev, unsigned long pipe,
+			void *buffer, int transfer_len, int interval);
 int usb_disable_asynch(int disable);
 int usb_maxpacket(struct usb_device *dev, unsigned long pipe);
 int usb_get_configuration_no(struct usb_device *dev, int cfgno,