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

Commit 93e2dd46 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: qcom: mdss: update PLL resources based on ref count"

parents ec9fd9e0 bd7f51b6
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
int mdss_pll_resource_enable(struct mdss_pll_resources *pll_res, bool enable)
{
	int rc = 0;
	int changed = 0;
	if (!pll_res) {
		pr_err("Invalid input parameters\n");
		return -EINVAL;
@@ -44,11 +45,27 @@ int mdss_pll_resource_enable(struct mdss_pll_resources *pll_res, bool enable)
		return rc;
	}

	if (enable) {
		if (pll_res->resource_ref_cnt == 0)
			changed++;
		pll_res->resource_ref_cnt++;
	} else {
		if (pll_res->resource_ref_cnt) {
			pll_res->resource_ref_cnt--;
			if (pll_res->resource_ref_cnt == 0)
				changed++;
		} else {
			pr_err("PLL Resources already OFF\n");
		}
	}

	if (changed) {
		rc = mdss_pll_util_resource_enable(pll_res, enable);
		if (rc)
			pr_err("Resource update failed rc=%d\n", rc);
		else
			pll_res->resource_enable = enable;
	}

	return rc;
}
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ struct mdss_pll_resources {
	/* HW recommended delay during configuration of vco clock rate */
	u32		vco_delay;

	/* Ref-count of the PLL resources */
	u32		resource_ref_cnt;

	/*
	 * Keep track to resource status to avoid updating same status for the
	 * pll from different paths