summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-08-14 12:44:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-14 12:37:20 -0700
commit4a64783b66bbeed06a1f10ab56a1dd401dd5bfba (patch)
tree828fd98e8de7898115f586a2b36b14e01151d6e0
parentd268e9bc23f5df4a2f4167da246d277c2a468d3d (diff)
downloadop-kernel-dev-4a64783b66bbeed06a1f10ab56a1dd401dd5bfba.zip
op-kernel-dev-4a64783b66bbeed06a1f10ab56a1dd401dd5bfba.tar.gz
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>
-rw-r--r--drivers/usb/chipidea/udc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 90c3572..6b4c2f2 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/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);
+ if (!ci->vbus_active)
+ return -EOPNOTSUPP;
+
if (is_on)
hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
else
OpenPOWER on IntegriCloud