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

Commit bcb901ef authored by Asutosh Das's avatar Asutosh Das Committed by Sayali Lokhande
Browse files

scsi: ufs: set load before setting voltage in regulators



This sequence change is required to avoid dips in voltage
during boot-up.

Apparently, this dip is caused because in the original
sequence, the regulators are initialized in lpm mode.
And then when the load is set to high, and more current
is drawn, than is allowed in lpm, the dip is seen.

CRs-fixed: 2279027
Change-Id: Ic531a1e6788d6288071f93d5002613855c2667f5
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent be565748
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * This code is based on drivers/scsi/ufs/ufshcd.c
 * Copyright (C) 2011-2013 Samsung India Software Operations
 * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
 *
 * Authors:
 *	Santosh Yaraganavi <santosh.sy@samsung.com>
@@ -7922,6 +7922,11 @@ static int ufshcd_config_vreg(struct device *dev,
	BUG_ON(!vreg);

	if (regulator_count_voltages(reg) > 0) {
		uA_load = on ? vreg->max_uA : 0;
		ret = ufshcd_config_vreg_load(dev, vreg, uA_load);
		if (ret)
			goto out;

		min_uV = on ? vreg->min_uV : 0;
		ret = regulator_set_voltage(reg, min_uV, vreg->max_uV);
		if (ret) {
@@ -7929,11 +7934,6 @@ static int ufshcd_config_vreg(struct device *dev,
					__func__, name, ret);
			goto out;
		}

		uA_load = on ? vreg->max_uA : 0;
		ret = ufshcd_config_vreg_load(dev, vreg, uA_load);
		if (ret)
			goto out;
	}
out:
	return ret;