summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2012-10-17 11:36:21 +0530
committerMatthew Pedro <mapedro@nvidia.com>2013-01-14 11:28:51 -0800
commit364f8d1cf478a94acdb1bec96614372da0ec883b (patch)
tree48603b3c0a301a63d88834526d7eda21fcb9d58f
parent185f345ed930377d945397b2b710bf62d91f5fa4 (diff)
usb: gadget: tegra:change condition for vbus check
Changing the condition for vbus check. VBUS will be present when OTG cable is connected, hence vbus status will be reflected wrong. Correct status is tracked through vbus_active variable. Bug 1158853 Bug 1214802 Change-Id: Ic904beb5919ddafef5becf39ddac1767cdda79cd Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/145148 (cherry picked from commit 00777683b05af76f15daa0152fb014183a32fa28) Reviewed-on: http://git-master/r/190673 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Preetham Chandru <pchandru@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r--drivers/usb/gadget/tegra_udc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c
index 9af22ebe8b58..c130dae3a8e9 100644
--- a/drivers/usb/gadget/tegra_udc.c
+++ b/drivers/usb/gadget/tegra_udc.c
@@ -635,7 +635,7 @@ static int tegra_ep_disable(struct usb_ep *_ep)
ep_num = ep_index(ep);
/* Touch the registers if cable is connected and phy is on */
- if (vbus_enabled(udc)) {
+ if (udc->vbus_active) {
epctrl = udc_readl(udc, EP_CONTROL_REG_OFFSET + (ep_num * 4));
if (ep_is_in(ep))
epctrl &= ~EPCTRL_TX_ENABLE;
@@ -995,7 +995,7 @@ static int tegra_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
ep_num = ep_index(ep);
/* Touch the registers if cable is connected and phy is on */
- if (vbus_enabled(udc)) {
+ if (udc->vbus_active) {
epctrl = udc_readl(udc, EP_CONTROL_REG_OFFSET + (ep_num * 4));
if (ep_is_in(ep))
epctrl &= ~EPCTRL_TX_ENABLE;
@@ -1046,7 +1046,7 @@ static int tegra_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
/* Enable EP */
out:
/* Touch the registers if cable is connected and phy is on */
- if (vbus_enabled(udc)) {
+ if (udc->vbus_active) {
epctrl = udc_readl(udc, EP_CONTROL_REG_OFFSET + (ep_num * 4));
if (ep_is_in(ep))
epctrl |= EPCTRL_TX_ENABLE;
@@ -1168,7 +1168,7 @@ static void tegra_ep_fifo_flush(struct usb_ep *_ep)
bits = 1 << ep_num;
/* Touch the registers if cable is connected and phy is on */
- if (!vbus_enabled(udc))
+ if (!udc->vbus_active)
return;
timeout = jiffies + UDC_FLUSH_TIMEOUT_MS;
@@ -2363,14 +2363,13 @@ static int tegra_udc_start(struct usb_gadget_driver *driver,
goto out;
}
-
/* Enable DR IRQ reg and Set usbcmd reg Run bit */
if (vbus_enabled(udc)) {
dr_controller_run(udc);
udc->usb_state = USB_STATE_ATTACHED;
udc->ep0_state = WAIT_FOR_SETUP;
udc->ep0_dir = 0;
- udc->vbus_active = vbus_enabled(udc);
+ udc->vbus_active = 1;
}
printk(KERN_INFO "%s: bind to driver %s\n",