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

Commit 25be8581 authored by Mayank Rana's avatar Mayank Rana Committed by Gerrit - the friendly Code Review server
Browse files

usb: phy: Don't program REXT if it is not present



On some platform, external REXT is not present. Hence add
optional qcom,no-rext-present property to avoid selecting it
using USB_PHY_RUTNE_SEL register from phy driver.

Change-Id: I1c334d52dd85044dfcaf22473608b58074bcac2e
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 75967c95
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ Optional properties:
 - reg: Address and length of the register set for the device
   Optional regs are:
        "phy_rcal_reg": register address for efuse used for rext calibration
 - qcom,no-rext-present: Set only if external REXT is not present. Default value
   is present.

Example:
	hsphy@f9200000 {
+10 −2
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ struct msm_hsphy {
	bool			suspended;
	bool			cable_connected;
	bool			dpdm_enable;
	bool			no_rext_present;

	int			*param_override_seq;
	int			param_override_seq_cnt;
@@ -396,8 +397,12 @@ static int msm_hsphy_init(struct usb_phy *uphy)
				phy->rcal_mask, phy->phy_rcal_reg, rcal_code);
	}

	/* Use external resistor for tuning if efuse is not programmed */
	if (!rcal_code)
	/*
	 * Use external resistor value only if:
	 * a. It is present and
	 * b. efuse is not programmed.
	 */
	if (!phy->no_rext_present && !rcal_code)
		msm_usb_write_readback(phy->base, USB2PHY_USB_PHY_RTUNE_SEL,
			RTUNE_SEL, RTUNE_SEL);

@@ -711,6 +716,9 @@ static int msm_hsphy_probe(struct platform_device *pdev)
		}
	}

	phy->no_rext_present = of_property_read_bool(dev->of_node,
					"qcom,no-rext-present");

	phy->param_override_seq_cnt = of_property_count_elems_of_size(
					dev->of_node,
					"qcom,param-override-seq",