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

Commit 19c3ff6e authored by Junjie Wu's avatar Junjie Wu
Browse files

msm: clock-krait-8974: Fall back to safest PVS when table not found



If there is new hardware that uses unexpected PVS/Speed bin bits, we
should fall back to the safest PVS table instead of failing to probe.
Implement this fall back during clock-krait-8974 probe.

Change-Id: Ie2b06839cac7e5e63eb99df69f9a0aa20744c6c5
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 3d6bf5c6
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -680,8 +680,18 @@ static int clock_krait_8974_driver_probe(struct platform_device *pdev)
	rows = parse_tbl(dev, prop_name, 3,
			(u32 **) &freq, (u32 **) &uv, (u32 **) &ua);
	if (rows < 0) {
		/* Fall back to most conservative PVS table */
		dev_err(dev, "Unable to load voltage plan %s!\n", prop_name);
		ret = parse_tbl(dev, "qcom,speed0-pvs0-bin-v0", 3,
				(u32 **) &freq, (u32 **) &uv, (u32 **) &ua);
		if (ret < 0) {
			dev_err(dev, "Unable to load safe voltage plan\n");
			return rows;
		} else {
			dev_info(dev, "Safe voltage plan loaded.\n");
			pvs = 0;
			rows = ret;
		}
	}

	krait_update_uv(uv, rows, pvs ? 25000 : 0);