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

Commit 39c0b01e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: phy: Expose new PHY callback for performing PHY reset"

parents 759c97a6 fc7f40d5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ static int msm_ehci_phy_reset(struct msm_hcd *mhcd)
	return 0;
}

static void usb_phy_reset(struct msm_hcd *mhcd)
static void msm_usb_phy_reset(struct msm_hcd *mhcd)
{
	u32 val;

@@ -661,7 +661,7 @@ static int msm_hsusb_reset(struct msm_hcd *mhcd)
								USB_PHY_CTRL2);

	/* Reset USB PHY after performing USB Link RESET */
	usb_phy_reset(mhcd);
	msm_usb_phy_reset(mhcd);

	msleep(100);

+3 −3
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ static int msm_otg_link_reset(struct msm_otg *motg)
	return 0;
}

static void usb_phy_reset(struct msm_otg *motg)
static void msm_usb_phy_reset(struct msm_otg *motg)
{
	u32 val;

@@ -598,7 +598,7 @@ static int msm_otg_reset(struct usb_phy *phy)
	msleep(100);

	/* Reset USB PHY after performing USB Link RESET */
	usb_phy_reset(motg);
	msm_usb_phy_reset(motg);

	/* Program USB PHY Override registers. */
	ulpi_init(motg);
@@ -607,7 +607,7 @@ static int msm_otg_reset(struct usb_phy *phy)
	 * It is recommended in HPG to reset USB PHY after programming
	 * USB PHY Override registers.
	 */
	usb_phy_reset(motg);
	msm_usb_phy_reset(motg);

	if (motg->clk)
		clk_disable_unprepare(motg->clk);
+12 −0
Original line number Diff line number Diff line
@@ -122,6 +122,9 @@ struct usb_phy {
			enum usb_device_speed speed);
	int	(*notify_disconnect)(struct usb_phy *x,
			enum usb_device_speed speed);

	/* reset the PHY clocks */
	int	(*reset)(struct usb_phy *x);
};

/**
@@ -214,6 +217,15 @@ usb_phy_post_init(struct usb_phy *x)
	return 0;
}

static inline int
usb_phy_reset(struct usb_phy *x)
{
	if (x && x->reset)
		return x->reset(x);

	return 0;
}

/* for usb host and peripheral controller drivers */
#if IS_ENABLED(CONFIG_USB_PHY)
extern struct usb_phy *usb_get_phy(enum usb_phy_type type);