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

Commit 77c15760 authored by Hemant Kumar's avatar Hemant Kumar Committed by Jack Pham
Browse files

usb: phy-msm-ssusb-qmp: Add support to set/clear PCS clamp enable reg



Clearing CLAMP_EN_B in USB3_UNI_PCS_CLAMP_ENABLE reg, clamps the PHY data
inputs and enables USB3 autonomous mode. CLAMP_EN_B is set power on default
which disables USB3 autonomous mode.

Change-Id: I6e9c4404a18e0ee2d10f1e58ccd1ca52de27e5bf
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 5f730d9a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ Optional properties:
 - reg: Additional register set of address and length to control QMP PHY are:
   "tcsr_usb3_dp_phymode" : top-level CSR register to be written to select
   super speed usb qmp phy.
   "pcs_clamp_enable_reg" : Clamps the phy data inputs and enables USB3
   autonomous mode.
 - clocks: a list of phandles to the PHY clocks. Use as per
   Documentation/devicetree/bindings/clock/clock-bindings.txt
 - clock-names: Names of the clocks in 1-1 correspondence with the "clocks"
+13 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ struct msm_ssphy_qmp {
	struct usb_phy		phy;
	void __iomem		*base;
	void __iomem		*vls_clamp_reg;
	void __iomem		*pcs_clamp_enable_reg;
	void __iomem		*tcsr_usb3_dp_phymode;

	struct regulator	*vdd;
@@ -187,6 +188,8 @@ static void msm_ssusb_qmp_clamp_enable(struct msm_ssphy_qmp *phy, bool val)
	case USB_PHY_TYPE_USB3_OR_DP:
	case USB_PHY_TYPE_USB3:
		writel_relaxed(!!val, phy->vls_clamp_reg);
		if (phy->pcs_clamp_enable_reg)
			writel_relaxed(!val, phy->pcs_clamp_enable_reg);
		break;
	default:
		break;
@@ -891,6 +894,16 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev)
		}
	}

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
			"pcs_clamp_enable_reg");
	if (res) {
		phy->pcs_clamp_enable_reg = devm_ioremap_resource(dev, res);
		if (IS_ERR(phy->pcs_clamp_enable_reg)) {
			dev_err(dev, "err getting pcs_clamp_enable_reg address.\n");
			return PTR_ERR(phy->pcs_clamp_enable_reg);
		}
	}

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
			"tcsr_usb3_dp_phymode");
	if (res) {