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

Commit c2f86822 authored by Deepak Katragadda's avatar Deepak Katragadda Committed by Gerrit - the friendly Code Review server
Browse files

qcom: clock-rpm: Add check to avoid enabling RPM scaling multiple times



Currently, the request to enable RPM scaling is made
everytime the enable_rpm_scaling function is invoked.
With the new msm-clock controller driver, this will
happen everytime a clock controller is probed, i.e.
once for RPM CC, once for GCC CC, etc.
Avoid sending these multiple requests to RPM.

Change-Id: If2a9683a7a80c8c9fd090c60b2229ca7541dab52
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent c5564588
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -268,12 +268,17 @@ static enum handoff rpm_clk_handoff(struct clk *clk)
int enable_rpm_scaling(void)
{
	int rc, value = 0x1;
	static int is_inited;

	struct msm_rpm_kvp kvp = {
		.key = RPM_SMD_KEY_ENABLE,
		.data = (void *)&value,
		.length = sizeof(value),
	};

	if (is_inited)
		return 0;

	rc = msm_rpm_send_message_noirq(MSM_RPM_CTX_SLEEP_SET,
			RPM_MISC_CLK_TYPE, RPM_SCALING_ENABLE_ID, &kvp, 1);
	if (rc < 0) {
@@ -290,6 +295,7 @@ int enable_rpm_scaling(void)
		return rc;
	}

	is_inited++;
	return 0;
}