aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/udc.c
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2016-08-16 07:19:11 -0400
committerPeter Chen <peter.chen@nxp.com>2016-08-18 21:27:07 -0400
commitc4e94174983a86c935be1537a73e496b778b0287 (patch)
tree352061f2bb21d7c4ea8b2fa7c6f288b815a9abdd /drivers/usb/chipidea/udc.c
parentf1f6d9a8b540df22b87a5bf6bc104edaade81f47 (diff)
usb: chipidea: udc: don't touch DP when controller is in host mode
When the controller is configured to be dual role and it's in host mode, if bind udc and gadgt driver, those gadget operations will do gadget disconnect and finally pull down DP line, which will break host function. Cc: <stable@vger.kernel.org> # 4.1+ Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r--drivers/usb/chipidea/udc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 065f5d97aa67..dfec5a176315 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1596,8 +1596,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
1596{ 1596{
1597 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget); 1597 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1598 1598
1599 /* Data+ pullup controlled by OTG state machine in OTG fsm mode */ 1599 /*
1600 if (ci_otg_is_fsm_mode(ci)) 1600 * Data+ pullup controlled by OTG state machine in OTG fsm mode;
1601 * and don't touch Data+ in host mode for dual role config.
1602 */
1603 if (ci_otg_is_fsm_mode(ci) || ci->role == CI_ROLE_HOST)
1601 return 0; 1604 return 0;
1602 1605
1603 pm_runtime_get_sync(&ci->gadget.dev); 1606 pm_runtime_get_sync(&ci->gadget.dev);