diff options
author | Rakesh Bodla <rbodla@nvidia.com> | 2011-08-19 13:30:13 +0530 |
---|---|---|
committer | Annamaria Pyreddy <apyreddy@nvidia.com> | 2011-08-25 11:12:35 -0700 |
commit | d35e6c8557eabf864cfda4fbc1644d3fd7767850 (patch) | |
tree | a3ece545fddd227c2f1b4354afe473b1e3b80939 /drivers | |
parent | f092fc6c56675bc1cf3396bb6a0b439d8a13d3e8 (diff) |
usb: gadget: fsl: add proper handling of udc pullup
pull up of usb device controller should be done only
in device mode.
Bug 863320
Change-Id: Ie9d1a30c529f75119edcd3b4297a1e004b1c3142
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-on: http://git-master/r/48605
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index ae02816b080d..e188e71ae0fa 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -1281,13 +1281,16 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on) udc = container_of(gadget, struct fsl_udc, gadget); udc->softconnect = (is_on != 0); - if (can_pullup(udc)) - fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP), - &dr_regs->usbcmd); - else - fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP), - &dr_regs->usbcmd); - + if (udc_controller->transceiver) { + if (udc_controller->transceiver->state == OTG_STATE_B_PERIPHERAL) { + if (can_pullup(udc)) + fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP), + &dr_regs->usbcmd); + else + fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP), + &dr_regs->usbcmd); + } + } return 0; } |