浏览代码

usb: chipidea: udc: .pullup is valid only when vbus is there

For chipidea, the IP must know vbus before the controller
begins to run. So the .pullup should only be called when
the vbus is there.

Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Chen 12 年之前
父节点
当前提交
4a64783b66
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/usb/chipidea/udc.c

+ 3 - 0
drivers/usb/chipidea/udc.c

@@ -1511,6 +1511,9 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
 {
 {
 	struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
 	struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
 
 
+	if (!ci->vbus_active)
+		return -EOPNOTSUPP;
+
 	if (is_on)
 	if (is_on)
 		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
 		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
 	else
 	else