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

Commit 88f04130 authored by David Collins's avatar David Collins
Browse files

clk: msm: clock-cpu-8996: round clock rates to nearest fmax frequency



Modify the round_rate() callback function so that it selects
the nearest configured fmax frequency instead of the closest
possible supported frequency of the parent clock.  This ensures
that clk_round_rate() always returns power efficient frequencies
for 8996 CPU clocks.

Change-Id: Icc27ba64b9c8af74ee0f81443fea37c4564b9f94
CRs-Fixed: 981475
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent ce2c04e9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -551,7 +551,13 @@ static enum handoff cpu_clk_8996_handoff(struct clk *c)

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

	for (i = 0; i < c->num_fmax; i++)
		if (rate <= c->fmax[i])
			return clk_round_rate(c->parent, c->fmax[i]);

	return clk_round_rate(c->parent, c->fmax[c->num_fmax - 1]);
}

static unsigned long alt_pll_perfcl_freqs[] = {