summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2020-06-22 12:09:43 +0300
committerStephen Boyd <sboyd@kernel.org>2020-06-22 12:09:43 +0300
commit9ebc0617d676e801d54b85d89c44abdbf6e25ff8 (patch)
tree8e80b11567652f5bdd0c5996267706b074f5cb56 /drivers/clk
parent6eb81373434b0101ac7ea47e1e09fd3ae22818c8 (diff)
parente8c849c2a8e8d300922399ac02065bebf53393a6 (diff)
downloadlinux-9ebc0617d676e801d54b85d89c44abdbf6e25ff8.tar.xz
Merge branch 'clk-doc' into clk-next
* clk-doc: clk: add function documentation for clk_hw_round_rate()
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 3f588ed06ce3..236923b25543 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1400,6 +1400,21 @@ int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
}
EXPORT_SYMBOL_GPL(__clk_determine_rate);
+/**
+ * clk_hw_round_rate() - round the given rate for a hw clk
+ * @hw: the hw clk for which we are rounding a rate
+ * @rate: the rate which is to be rounded
+ *
+ * Takes in a rate as input and rounds it to a rate that the clk can actually
+ * use.
+ *
+ * Context: prepare_lock must be held.
+ * For clk providers to call from within clk_ops such as .round_rate,
+ * .determine_rate.
+ *
+ * Return: returns rounded rate of hw clk if clk supports round_rate operation
+ * else returns the parent rate.
+ */
unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate)
{
int ret;