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

Commit 793af31a authored by Hemant Kumar's avatar Hemant Kumar Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: Use devm_regulator_get_optional() for dpdm regulator



dpdm regulator is only required for primary usb to make sure
dp and dm lines are in high-z state prior to performing charger
detection. Calling devm_regulator_get() for secondary usb returns
handle for dummy regulator as dpdm property is not present. As a
result secondary dwc3 does not enter low power mode upon boot up.
Fix this by calling devm_regulator_get_optional() which returns
error if regulator is not found.

Change-Id: I387560cf15f3f5505caa1c6418b6e17a4ab14c3b
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent c456d422
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3747,7 +3747,8 @@ static int dwc3_msm_probe(struct platform_device *pdev)
		 * if dpdm is not present controller can be reset
		 * as this controller may not be used for charger detection.
		 */
		mdwc->dpdm_reg = devm_regulator_get(&pdev->dev, "dpdm");
		mdwc->dpdm_reg = devm_regulator_get_optional(&pdev->dev,
				"dpdm");
		if (IS_ERR(mdwc->dpdm_reg)) {
			dev_dbg(mdwc->dev, "assume cable is not connected\n");
			mdwc->dpdm_reg = NULL;