From: Michael Trimarchi Date: Thu, 18 Dec 2008 09:05:37 +0000 (+0100) Subject: USB change speed X-Git-Tag: v2009.03-rc1~146^2~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=366523c26b6320af171459b19e6e0e9e3baa83ca;p=u-boot USB change speed USB changes the speed according to the port status Signed-off-by: Michael Trimarchi Signed-off-by: Remy Bohmer --- diff --git a/common/usb.c b/common/usb.c index 313845234f..335012798c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -1061,10 +1061,12 @@ static int hub_port_reset(struct usb_device *dev, int port, } portstatus = le16_to_cpu(portsts.wPortStatus); portchange = le16_to_cpu(portsts.wPortChange); + USB_HUB_PRINTF("portstatus %x, change %x, %s\n", portstatus, portchange, - portstatus&(1<speed = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0; + + if (portstatus & USB_PORT_STAT_HIGH_SPEED) + usb->speed = USB_SPEED_HIGH; + else if (portstatus & USB_PORT_STAT_LOW_SPEED) + usb->speed = USB_SPEED_LOW; + else + usb->speed = USB_SPEED_FULL; dev->children[port] = usb; usb->parent = dev;