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

Commit 77267719 authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam Committed by Hemant Kumar
Browse files

usb: dwc3: Notify super speed phy about link training



Notify super speed phy such as qmp phy to start/stop link
training (reset and connection done) so that phy can reset
training sequence buffer when required.

Change-Id: I6c1a07d5d4614d368d57e742569ec537e0212e51
Signed-off-by: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent b54e6c30
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3085,6 +3085,8 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
{
	u32			reg;

	usb_phy_start_link_training(dwc->usb3_phy);

	dwc->connected = true;

	/*
@@ -3170,6 +3172,7 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
	u8			speed;

	dbg_event(0xFF, "CONNECT DONE", 0);
	usb_phy_stop_link_training(dwc->usb3_phy);
	reg = dwc3_readl(dwc->regs, DWC3_DSTS);
	speed = reg & DWC3_DSTS_CONNECTSPD;
	dwc->speed = speed;
+18 −0
Original line number Diff line number Diff line
@@ -352,6 +352,24 @@ usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
		return 0;
}

static inline int
usb_phy_start_link_training(struct usb_phy *x)
{
	if (x && x->link_training)
		return x->link_training(x, true);
	else
		return 0;
}

static inline int
usb_phy_stop_link_training(struct usb_phy *x)
{
	if (x && x->link_training)
		return x->link_training(x, false);
	else
		return 0;
}

static inline int
usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
{