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

Commit 311dbfca authored by Osvaldo Banuelos's avatar Osvaldo Banuelos
Browse files

regulator: spm-regulator: initialize SAW VCTL register at probe time



In order for msm_spm_get_vdd() to return a valid voltage level that
can be used by consumers, an msm_spm_set_vdd() call must take place
beforehand. To cater to this scenario, perform an msm_spm_set_vdd()
call with the regulator supply voltage read via the SPMI bus at
initialization time.

Change-Id: Ic11072b54728f9bcac91f306d2957f3934c1e448
Signed-off-by: default avatarOsvaldo Banuelos <osvaldob@codeaurora.org>
parent 1fabae78
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -633,7 +633,15 @@ static int qpnp_smps_init_voltage(struct spm_vreg *vreg)
	vreg->vlevel = vreg->last_set_vlevel;
	vreg->uV = vreg->last_set_uV;

	return rc;
	/* Initialize SAW voltage control register */
	if (!vreg->bypass_spm) {
		rc = msm_spm_set_vdd(vreg->cpu_num, vreg->vlevel);
		if (rc)
			pr_err("%s: msm_spm_set_vdd failed, rc=%d\n",
			       vreg->rdesc.name, rc);
	}

	return 0;
}

static int qpnp_smps_init_mode(struct spm_vreg *vreg)