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

Commit a21c9de8 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by Gerrit - the friendly Code Review server
Browse files

phy: ufs: put regulator to LPM mode



If regulator is marked as always on then we should atleast put
it in LPM mode as we can't disabled it.

Change-Id: I1c2f398d4a3b62d9e641ae53b7c4806b69c4862b
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 99080dfb
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -463,9 +463,26 @@ static int ufs_qcom_phy_disable_vreg(struct device *dev,
{
	int ret = 0;

	if (!vreg || !vreg->enabled || vreg->is_always_on)
	if (!vreg || !vreg->enabled)
		goto out;

	if (vreg->is_always_on) {
		/* voting 0 uA load will keep regulator in LPM mode */
		ret = regulator_set_load(vreg->reg, 0);
		if (ret >= 0) {
			/*
			 * regulator_set_load() returns new regulator
			 * mode upon success.
			 */
			ret = 0;
		} else {
			dev_err(dev, "%s: %s set optimum mode(uA_load=0) failed, err=%d\n",
					__func__, vreg->name, ret);
		}

		goto out;
	}

	ret = regulator_disable(vreg->reg);

	if (!ret) {