Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44c53ef8 authored by Linyu Yuan's avatar Linyu Yuan Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: control redriver connect/disconnect



control redriver when start/stop host or device mode.

Change-Id: Id2e7af96a20b285292d0799b6ed04365611ba709
Signed-off-by: default avatarLinyu Yuan <linyyuan@codeaurora.org>
parent 1362aa14
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4755,6 +4755,7 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
		pm_runtime_get_sync(mdwc->dev);
		dbg_event(0xFF, "StrtHost gync",
			atomic_read(&mdwc->dev->power.usage_count));
		redriver_notify_connect(mdwc->ss_redriver_node);
		if (dwc->maximum_speed >= USB_SPEED_SUPER) {
			mdwc->ss_phy->flags |= PHY_HOST_MODE;
			usb_phy_notify_connect(mdwc->ss_phy,
@@ -4851,6 +4852,7 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
					USB_SPEED_SUPER);
			mdwc->ss_phy->flags &= ~PHY_HOST_MODE;
		}
		redriver_notify_disconnect(mdwc->ss_redriver_node);

		mdwc->hs_phy->flags &= ~PHY_HOST_MODE;
		dwc3_host_exit(dwc);
@@ -4909,6 +4911,7 @@ static int dwc3_otg_start_peripheral(struct dwc3_msm *mdwc, int on)
					__func__, dwc->gadget.name);

		dwc3_override_vbus_status(mdwc, true);
		redriver_notify_connect(mdwc->ss_redriver_node);
		usb_phy_notify_connect(mdwc->hs_phy, USB_SPEED_HIGH);
		usb_phy_notify_connect(mdwc->ss_phy, USB_SPEED_SUPER);

@@ -4954,6 +4957,7 @@ static int dwc3_otg_start_peripheral(struct dwc3_msm *mdwc, int on)
		usb_gadget_vbus_disconnect(&dwc->gadget);
		usb_phy_notify_disconnect(mdwc->hs_phy, USB_SPEED_HIGH);
		usb_phy_notify_disconnect(mdwc->ss_phy, USB_SPEED_SUPER);
		redriver_notify_disconnect(mdwc->ss_redriver_node);
		dwc3_override_vbus_status(mdwc, false);
		dwc3_msm_write_reg_field(mdwc->base, DWC3_GUSB3PIPECTL(0),
				DWC3_GUSB3PIPECTL_SUSPHY, 0);