Skip to content

Commit

Permalink
Merge pull request torvalds#179 from RadxaYuntian/fix_rock-4se_otg_host
Browse files Browse the repository at this point in the history
ROCK 4 SE: Fix "The OTG port always working as device
after boot regardless of the status of OTG physical switch.".

Signed-off-by: Stephen Chen <[email protected]>
  • Loading branch information
RadxaStephen authored Aug 17, 2023
2 parents 7a4a688 + c75f70a commit e9623f2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,9 @@ static void __dwc3_set_mode(struct work_struct *work)
break;
}

/*
* When current_dr_role is not set, there's no role switching.
* Only perform GCTL.CoreSoftReset when there's DRD role switching.
*/
if (dwc->current_dr_role && ((DWC3_IP_IS(DWC3) ||
DWC3_VER_IS_PRIOR(DWC31, 190A)) &&
dwc->desired_dr_role != DWC3_GCTL_PRTCAP_OTG)) {
/* For DRD host or device mode only */
if ((DWC3_IP_IS(DWC3) || DWC3_VER_IS_PRIOR(DWC31, 190A)) &&
dwc->desired_dr_role != DWC3_GCTL_PRTCAP_OTG) {
reg = dwc3_readl(dwc->regs, DWC3_GCTL);
reg |= DWC3_GCTL_CORESOFTRESET;
dwc3_writel(dwc->regs, DWC3_GCTL, reg);
Expand Down

0 comments on commit e9623f2

Please sign in to comment.