summaryrefslogtreecommitdiff
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-10-22 22:14:57 +0200
committerFelipe Balbi <balbi@ti.com>2012-10-31 15:01:15 +0200
commitbcb2f99c6c43a8da6cb4002e8b0acf6f1275f3a8 (patch)
tree290cfa3262734c9010bd08dbf22cf45498e77bd9 /include/linux/usb/composite.h
parentfad8deb274edcef1c8ca38946338f5f4f8126fe2 (diff)
usb: gadget: use a computation macro for INT endpoint interval
The 5+4 magic for HS tries to aim 32ms which is also what is intended with 1 << 5 for FS. This little macro should make this easier to understand. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index f8dda0621800..8634a127bdd3 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -38,6 +38,7 @@
#include <linux/version.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
+#include <linux/log2.h>
/*
* USB function drivers should return USB_GADGET_DELAYED_STATUS if they
@@ -51,6 +52,7 @@
/* big enough to hold our biggest descriptor */
#define USB_COMP_EP0_BUFSIZ 1024
+#define USB_MS_TO_HS_INTERVAL(x) (ilog2((x * 1000 / 125)) + 1)
struct usb_configuration;
/**