浏览代码

USB: Fix speed detection on EHCI cntr with root hub transaction translators

This patch fixes an issue that the speed of USB devices was not detected
correctly on some EHCI controllers. This will be used on the upcoming VCT
EHCI support.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
Stefan Roese 16 年之前
父节点
当前提交
597eb28bd9
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. 16 1
      drivers/usb/usb_ehci_core.c

+ 16 - 1
drivers/usb/usb_ehci_core.c

@@ -546,7 +546,22 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 		}
 		}
 		if (reg & EHCI_PS_PP)
 		if (reg & EHCI_PS_PP)
 			tmpbuf[1] |= USB_PORT_STAT_POWER >> 8;
 			tmpbuf[1] |= USB_PORT_STAT_POWER >> 8;
-		tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8;
+
+		if (ehci_is_TDI()) {
+			switch ((reg >> 26) & 3) {
+			case 0:
+				break;
+			case 1:
+				tmpbuf[1] |= USB_PORT_STAT_LOW_SPEED >> 8;
+				break;
+			case 2:
+			default:
+				tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8;
+				break;
+			}
+		} else {
+			tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8;
+		}
 
 
 		if (reg & EHCI_PS_CSC)
 		if (reg & EHCI_PS_CSC)
 			tmpbuf[2] |= USB_PORT_STAT_C_CONNECTION;
 			tmpbuf[2] |= USB_PORT_STAT_C_CONNECTION;