summaryrefslogtreecommitdiff
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 65ae0a3feb5b..f8dda0621800 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -34,6 +34,8 @@
* the composite model the host can use both functions at the same time.
*/
+#include <linux/bcd.h>
+#include <linux/version.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
@@ -418,6 +420,15 @@ struct usb_composite_overwrite {
void usb_composite_overwrite_options(struct usb_composite_dev *cdev,
struct usb_composite_overwrite *covr);
+static inline u16 get_default_bcdDevice(void)
+{
+ u16 bcdDevice;
+
+ bcdDevice = bin2bcd((LINUX_VERSION_CODE >> 16 & 0xff)) << 8;
+ bcdDevice |= bin2bcd((LINUX_VERSION_CODE >> 8 & 0xff));
+ return bcdDevice;
+}
+
/* messaging utils */
#define DBG(d, fmt, args...) \
dev_dbg(&(d)->gadget->dev , fmt , ## args)