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

Commit 3b9b4408 authored by Taniya Das's avatar Taniya Das Committed by Gerrit - the friendly Code Review server
Browse files

clk: qcom: branch: Fix propagation of parent rate to branches



Currently the recalc rate of the branches is broken and it reports 0.
Ideally the rate would be the parent rate, except where the aggregation
is required for sibling branches.
Also in the cases where a clock rate is set on a branch or rcg the rate
of the parent should get propagated to each of the sibling/child branches.
Fix this propagation in the cases where aggregation is not a
requirement on the branches.

Change-Id: I66bbba70a7bc4021f9559e753a04311394c7946d
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 3d91e789
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -194,8 +194,8 @@ static int clk_branch2_set_rate(struct clk_hw *hw, unsigned long rate,
	if (!parent)
		return -EPERM;

	if (!branch->aggr_sibling_rates || !clk_hw_is_prepared(hw)) {
		branch->rate = rate;
	if (!branch->aggr_sibling_rates) {
		branch->rate = parent_rate;
		return 0;
	}

@@ -242,6 +242,11 @@ static long clk_branch2_round_rate(struct clk_hw *hw, unsigned long rate,
static unsigned long clk_branch2_recalc_rate(struct clk_hw *hw,
		unsigned long parent_rate)
{
	struct clk_branch *branch = to_clk_branch(hw);

	if (!branch->aggr_sibling_rates)
		return parent_rate;

	return to_clk_branch(hw)->rate;
}