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

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

Merge "usb: ehci-msm2: Add support for separate PHY"

parents 8f130835 48822332
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ Optional properties :
  the USB host controller and its RESET_N signal is connected to this
  ext-hub-reset-gpio GPIO. It should be driven LOW to RESET the HUB.
- qcom,usb2-enable-uicc: If present, usb2 port will be used for uicc card connection.
- usb-phy: phandle for the PHY device, if described as a separate device tree node

Example MSM HSUSB EHCI controller device node :
	ehci: qcom,ehci-host@f9a55000 {
+23 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#include <linux/usb/ulpi.h>
#include <linux/usb/msm_hsusb_hw.h>
#include <linux/usb/msm_hsusb.h>
#include <linux/usb/phy.h>
#include <linux/of.h>

#include <linux/debugfs.h>
@@ -657,7 +658,12 @@ static int msm_hsusb_reset(struct msm_hcd *mhcd)
								USB_PHY_CTRL2);

	/* Reset USB PHY after performing USB Link RESET */
	if (hcd->phy) {
		usb_phy_reset(hcd->phy);
		usb_phy_init(hcd->phy);
	} else {
		msm_usb_phy_reset(mhcd);
	}

	msleep(100);

@@ -1520,7 +1526,19 @@ static int ehci_msm2_probe(struct platform_device *pdev)
		goto disable_ldo;
	}

	if (pdata && pdata->use_sec_phy)
	hcd->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
	if (IS_ERR(hcd->phy)) {
		if (PTR_ERR(hcd->phy) == -EPROBE_DEFER) {
			dev_dbg(&pdev->dev, "usb-phy not probed yet\n");
			ret = -EPROBE_DEFER;
			goto vbus_deinit;
		}
		hcd->phy = NULL;
	}

	if (hcd->phy)
		usb_phy_init(hcd->phy);
	else if (pdata && pdata->use_sec_phy)
		mhcd->usb_phy_ctrl_reg = USB_PHY_CTRL2;
	else
		mhcd->usb_phy_ctrl_reg = USB_PHY_CTRL;
@@ -1671,6 +1689,9 @@ static int ehci_msm2_remove(struct platform_device *pdev)

	usb_remove_hcd(hcd);

	if (hcd->phy)
		usb_phy_shutdown(hcd->phy);

	if (mhcd->xo_clk) {
		clk_disable_unprepare(mhcd->xo_clk);
		clk_put(mhcd->xo_clk);