diff options
author | Sarang Mairal <sarangmairal@gmail.com> | 2020-06-11 05:19:41 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2020-06-22 12:04:15 +0300 |
commit | e8c849c2a8e8d300922399ac02065bebf53393a6 (patch) | |
tree | 88e45de0882c23cfcd719fe86471801d6e7a419f /drivers/clk/clk.c | |
parent | b3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff) |
clk: add function documentation for clk_hw_round_rate()
Information about usage and prerequisites for this API.
Signed-off-by: Sarang Mairal <sarangmairal@gmail.com>
Link: https://lore.kernel.org/r/20200611021941.786-2-sarangmairal@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 15 |
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; |