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

Commit 18fc8840 authored by Odelu Kukatla's avatar Odelu Kukatla
Browse files

clk: msm: clock-cpu: Correct the round_rate ops for SDM439



Current round_rate ops returns the parent next supported
rate, better way is to round it to next supported level
of child clock.

Change-Id: I22b2b4287a06401b8107991aa23e73ee96039f6e
Signed-off-by: default avatarOdelu Kukatla <okukatla@codeaurora.org>
parent 61147a12
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -130,7 +130,16 @@ static enum handoff cpu_clk_8939_handoff(struct clk *c)

static long cpu_clk_8939_round_rate(struct clk *c, unsigned long rate)
{
	return clk_round_rate(c->parent, rate);
	int level;

	for (level = 0; level < c->num_fmax; level++)
		if (rate <= c->fmax[level])
			break;

	if (level == c->num_fmax)
		return c->fmax[level-1];

	return c->fmax[level];
}

static int cpu_clk_8939_set_rate(struct clk *c, unsigned long rate)