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

Commit 26629e0a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: phy: qmp: Disable LDOs and clocks in error handling path"

parents 4d4c6976 ed86e2fe
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -482,7 +482,7 @@ static int msm_ssphy_qmp_init(struct usb_phy *uphy)
	ret = configure_phy_regs(uphy, reg);
	if (ret) {
		dev_err(uphy->dev, "Failed the main PHY configuration\n");
		return ret;
		goto fail;
	}

	/* perform software reset of PHY common logic */
@@ -513,10 +513,19 @@ static int msm_ssphy_qmp_init(struct usb_phy *uphy)
		dev_err(uphy->dev, "USB3_PHY_PCS_STATUS:%x\n",
				readl_relaxed(phy->base +
					phy->phy_reg[USB3_PHY_PCS_STATUS]));
		return -EBUSY;
		ret = -EBUSY;
		goto fail;
	};

	return 0;
fail:
	phy->in_suspend = true;
	writel_relaxed(0x00,
		phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
	msm_ssphy_qmp_enable_clks(phy, false);
	msm_ssusb_qmp_ldo_enable(phy, 0);

	return ret;
}

static int msm_ssphy_qmp_dp_combo_reset(struct usb_phy *uphy)