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

This commit is contained in:
qctecmdr 2020-07-29 06:36:26 -07:00 • committed by Gerrit - the friendly Code Review server
commit 0a652bb3d2

View file

@ -178,8 +178,21 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
vreg->min_uV = UFS_VREG_VCCQ_MIN_UV;
vreg->max_uV = UFS_VREG_VCCQ_MAX_UV;
} else if (!strcmp(name, "vccq2")) {
#if defined(CONFIG_SCSI_UFSHCD_QTI)
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]);
}
#else
vreg->min_uV = UFS_VREG_VCCQ2_MIN_UV;
vreg->max_uV = UFS_VREG_VCCQ2_MAX_UV;
#endif
}
goto out;