]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: chipidea: udc: .pullup is valid only when vbus is there
authorPeter Chen <peter.chen@freescale.com>
Mon, 12 Aug 2013 01:22:59 +0000 (09:22 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:50 +0000 (09:54 +0800)
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>
drivers/usb/chipidea/udc.c

index 90c3572bd1b0c901f02112677122e1ced4140769..6b4c2f2eb94649c7da6fc577b54598d53ebdfec4 100644 (file)
@@ -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);
 
+       if (!ci->vbus_active)
+               return -EOPNOTSUPP;
+
        if (is_on)
                hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
        else