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

Commit eeccf5a9 authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

clk: qcom: clk-branch: Correct the round_rate callback behavior



Currently, during a set_rate() operation, the call never makes
its way to the branch clocks parent since the parent_rate is
not updated and matches the stashed rate value of the parent.
Once the parent_rate is updated, the set_rate() call on the
branch clock makes it's way upto the clock parent.

Change-Id: I49c2fc26a13df4c93764f786bc42f5a8e18859fc
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 60bc4fc9
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, 2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013, 2016-2017, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -218,11 +218,20 @@ static long clk_branch2_round_rate(struct clk_hw *hw, unsigned long rate,
		unsigned long *parent_rate)
{
	struct clk_hw *parent = clk_hw_get_parent(hw);
	unsigned long rrate = 0;

	if (!parent)
		return -EPERM;

	return clk_hw_round_rate(parent, rate);
	rrate = clk_hw_round_rate(parent, rate);
	/*
	 * If the rounded rate that's returned is valid, update the parent_rate
	 * field so that the set_rate() call can be propagated to the parent.
	 */
	if (rrate > 0)
		*parent_rate = rrate;

	return rrate;
}

static unsigned long clk_branch2_recalc_rate(struct clk_hw *hw,