summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorVipin KUMAR <vipin.kumar@st.com>2012-03-26 15:38:06 +0530
committerMarek Vasut <marek.vasut@gmail.com>2012-03-28 16:31:08 +0200
commitf9da0f894328802cb8aaeb8a24660e37ff624d26 (patch)
tree5906cbda2eee776bc3200bf0e2c20e2378ddc42a /drivers/usb
parent7cb30b13f12077c7eec8ce2419cd96cd65ace8e2 (diff)
downloadu-boot-imx-f9da0f894328802cb8aaeb8a24660e37ff624d26.zip
u-boot-imx-f9da0f894328802cb8aaeb8a24660e37ff624d26.tar.gz
u-boot-imx-f9da0f894328802cb8aaeb8a24660e37ff624d26.tar.bz2
Enable high speed support for USB device framework and usbtty
This patch adds the support for high speed in usb device framework and usbtty driver. This feature has been kept within a macro CONFIG_USBD_HS, so the board configuration files have to define this macro to enable high speed support. Along with that specific peripheral drivers also need to define a function to let the framework know that the enumeration has happened at high speed. This function prototype is "int is_usbd_high_speed(void)" Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Amit Virdi <amit.virdi@st.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/core.c1
-rw-r--r--drivers/usb/gadget/ep0.c23
2 files changed, 19 insertions, 5 deletions
diff --git a/drivers/usb/gadget/core.c b/drivers/usb/gadget/core.c
index 4f2ebab..46ab3f6 100644
--- a/drivers/usb/gadget/core.c
+++ b/drivers/usb/gadget/core.c
@@ -212,7 +212,6 @@ struct usb_device_descriptor *usbd_device_device_descriptor (struct usb_device_i
return (device->device_descriptor);
}
-
/**
* usbd_device_configuration_descriptor
* @device: which device
diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
index 22499d3..aa8f916 100644
--- a/drivers/usb/gadget/ep0.c
+++ b/drivers/usb/gadget/ep0.c
@@ -338,12 +338,27 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
}
break;
case USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER:
+#if defined(CONFIG_USBD_HS)
{
- /* If a USB device supports both a full speed and low speed operation
- * we must send a Device_Qualifier descriptor here
- */
- return -1;
+ struct usb_qualifier_descriptor *qualifier_descriptor =
+ device->qualifier_descriptor;
+
+ if (!qualifier_descriptor)
+ return -1;
+
+ /* copy descriptor for this device */
+ copy_config(urb, qualifier_descriptor,
+ sizeof(struct usb_qualifier_descriptor),
+ max);
+
}
+ dbg_ep0(3, "copied qualifier descriptor, actual_length: 0x%x",
+ urb->actual_length);
+#else
+ return -1;
+#endif
+ break;
+
default:
return -1;
}