[RFC/PATCH 10/12] usb: gadget: zero: add bos descriptor and caps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zero is the simplest gadget driver to change and
as such, the easiest to get something running.

Signed-off-by: Felipe Balbi <balbi@xxxxxx>
---
 drivers/usb/gadget/zero.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index e6092d3..931d3bf 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -132,6 +132,41 @@ static struct usb_device_descriptor device_desc = {
 	.bNumConfigurations =	2,
 };
 
+static struct usb_bos_descriptor zero_bos_desc = {
+	.bLength =		USB_DT_BOS_SIZE,
+	.bDescriptorType =	USB_DT_BOS,
+
+	/* .wTotalLength =	DYNAMIC, */
+	/* .bNumDeviceCaps =	DYNAMIC, */
+};
+
+static struct usb_ext_cap_descriptor zero_extension_desc = {
+	.bLength =		USB_DT_USB_EXT_CAP_SIZE,
+	.bDescriptorType =	USB_DT_DEVICE_CAPABILITY,
+	.bDevCapabilityType =	USB_CAP_TYPE_EXT,
+	.bmAttributes =		USB_LPM_SUPPORT,
+};
+
+static struct usb_ss_cap_descriptor zero_ss_cap_desc = {
+	.bLength =		USB_DT_USB_SS_CAP_SIZE,
+	.bDescriptorType =	USB_DT_DEVICE_CAPABILITY,
+	.bDevCapabilityType =	USB_SS_CAP_TYPE,
+	.bmAttributes =		USB_LTM_SUPPORT,
+	.wSpeedSupported =	USB_LOW_SPEED_OPERATION
+		| USB_FULL_SPEED_OPERATION
+		| USB_HIGH_SPEED_OPERATION
+		| USB_5GBPS_OPERATION,
+	.bFunctionalitySupport = USB_LOW_SPEED_OPERATION,
+	.bU1devExitLat =	0x04,	/* Change this to match your device */
+	.bU2DevExitLat =	0x04,	/* Change this to match your device */
+};
+
+const static struct usb_dev_cap_header *zero_capabilities[] = {
+	(struct usb_dev_cap_header *) &zero_extension_desc,
+	(struct usb_dev_cap_header *) &zero_ss_cap_desc,
+	NULL,
+};
+
 #ifdef CONFIG_USB_OTG
 static struct usb_otg_descriptor otg_descriptor = {
 	.bLength =		sizeof otg_descriptor,
@@ -339,6 +374,10 @@ static int zero_unbind(struct usb_composite_dev *cdev)
 static struct usb_composite_driver zero_driver = {
 	.name		= "zero",
 	.dev		= &device_desc,
+
+	.bos		= &zero_bos_desc,
+	.capabilities	= zero_capabilities,
+
 	.strings	= dev_strings,
 	.unbind		= zero_unbind,
 	.suspend	= zero_suspend,
-- 
1.7.4.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux