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

Commit c2c18e35 authored by Nitin Rawat's avatar Nitin Rawat Committed by Mohit Sharma
Browse files

scsi: ufs: Read device tree to find UFS's Vccq2 voltage level



This change allows selecting the UFS Vccq2 voltage level by
setting the UFS's entry vccq2-voltage-level in the device tree.
If UFS's Vccq2 voltage level setting is not found in the device
tree,use default values provided by the driver.

Change-Id: Ibe9223e717e63b9edde95b272aaf142e7cf81672
Signed-off-by: default avatarNitin Rawat <nitirawa@codeaurora.org>
parent 1e2f579c
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -231,8 +231,16 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
		if (of_property_read_bool(np, "vccq-pwr-collapse-sup"))
			vreg->sys_suspend_pwr_off = true;
	} else if (!strcmp(name, "vccq2")) {
		prop = of_get_property(np, "vccq2-voltage-level", &len);
		if (!prop || (len != (2 * sizeof(__be32)))) {
			dev_warn(dev, "%s vccq2-voltage-level property.\n",
				prop ? "invalid format" : "no");
			vreg->min_uV = UFS_VREG_VCCQ2_MIN_UV;
			vreg->max_uV = UFS_VREG_VCCQ2_MAX_UV;
		} else {
			vreg->min_uV = be32_to_cpup(&prop[0]);
			vreg->max_uV = be32_to_cpup(&prop[1]);
		}
		if (of_property_read_bool(np, "vccq2-pwr-collapse-sup"))
			vreg->sys_suspend_pwr_off = true;
	}