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

Commit f530d78e authored by Taniya Das's avatar Taniya Das
Browse files

clk: qcom: osm: Initialize ACD when the cluster is online



The OSM clock driver currently enables ACD for the silver and
gold clusters regardless of whether they've been brought up or
not. ACD requires the cluster PLLs to be running for initialization,
a requirement which would not be met if the cluster hasn't been
brought online.
Tie the ACD initialization sequence with enabling OSM for that
cluster.

Change-Id: I4a7e7176e30b26d096645dd9ce508b7af8ae6df2
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 6ec544ae
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -719,9 +719,22 @@ static int clk_osm_set_rate(struct clk_hw *hw, unsigned long rate,
	return 0;
}

static int clk_osm_acd_init(struct clk_osm *c);

static int clk_osm_enable(struct clk_hw *hw)
{
	struct clk_osm *cpuclk = to_clk_osm(hw);
	int rc;

	rc = clk_osm_acd_init(cpuclk);
	if (rc) {
		pr_err("Failed to initialize ACD for cluster %d, rc=%d\n",
				cpuclk->cluster_num, rc);
		return rc;
	}

	/* Wait for 5 usecs before enabling OSM */
	udelay(5);

	clk_osm_write_reg(cpuclk, 1, ENABLE_REG);

@@ -3272,17 +3285,6 @@ static int clk_cpu_osm_driver_probe(struct platform_device *pdev)
		clk_osm_setup_cluster_pll(&perfcl_clk);
	}

	rc = clk_osm_acd_init(&pwrcl_clk);
	if (rc) {
		pr_err("failed to initialize ACD for pwrcl, rc=%d\n", rc);
		return rc;
	}
	rc = clk_osm_acd_init(&perfcl_clk);
	if (rc) {
		pr_err("failed to initialize ACD for perfcl, rc=%d\n", rc);
		return rc;
	}

	spin_lock_init(&pwrcl_clk.lock);
	spin_lock_init(&perfcl_clk.lock);