Skip to content

Commit c4e9417

Browse files
JunlisuzhouPeter Chen
authored andcommitted
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: <[email protected]> # 4.1+ Signed-off-by: Li Jun <[email protected]> Signed-off-by: Peter Chen <[email protected]>
1 parent f1f6d9a commit c4e9417

File tree

1 file changed

+5
-2
lines changed
  • drivers/usb/chipidea

1 file changed

+5
-2
lines changed

drivers/usb/chipidea/udc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,8 +1596,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
15961596
{
15971597
struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
15981598

1599-
/* Data+ pullup controlled by OTG state machine in OTG fsm mode */
1600-
if (ci_otg_is_fsm_mode(ci))
1599+
/*
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)
16011604
return 0;
16021605

16031606
pm_runtime_get_sync(&ci->gadget.dev);

0 commit comments

Comments
 (0)