]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: chipidea: udc: don't touch DP when controller is in host mode
authorLi Jun <jun.li@nxp.com>
Tue, 16 Aug 2016 11:19:11 +0000 (19:19 +0800)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 12 Sep 2016 13:33:21 +0000 (09:33 -0400)
[ Upstream commit c4e94174983a86c935be1537a73e496b778b0287 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/usb/chipidea/udc.c

index 92937c14f8189a6607e31c243c8b7969382f8e52..d93e43cfb6f8b0271797f3f27c93e64a1608a758 100644 (file)
@@ -1578,8 +1578,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
 {
        struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
 
-       /* Data+ pullup controlled by OTG state machine in OTG fsm mode */
-       if (ci_otg_is_fsm_mode(ci))
+       /*
+        * Data+ pullup controlled by OTG state machine in OTG fsm mode;
+        * and don't touch Data+ in host mode for dual role config.
+        */
+       if (ci_otg_is_fsm_mode(ci) || ci->role == CI_ROLE_HOST)
                return 0;
 
        pm_runtime_get_sync(&ci->gadget.dev);