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

Commit d2d14a77 authored by Russell King's avatar Russell King
Browse files

clk: update clk API documentation to clarify clk_round_rate()



The idea is that rate = clk_round_rate(clk, r) is equivalent to:

	clk_set_rate(clk, r);
	rate = clk_get_rate(clk);

except that clk_round_rate() does not change the hardware in any way.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d5622a9c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -306,6 +306,20 @@ void devm_clk_put(struct device *dev, struct clk *clk);
 * @clk: clock source
 * @rate: desired clock rate in Hz
 *
 * This answers the question "if I were to pass @rate to clk_set_rate(),
 * what clock rate would I end up with?" without changing the hardware
 * in any way.  In other words:
 *
 *   rate = clk_round_rate(clk, r);
 *
 * and:
 *
 *   clk_set_rate(clk, r);
 *   rate = clk_get_rate(clk);
 *
 * are equivalent except the former does not modify the clock hardware
 * in any way.
 *
 * Returns rounded clock rate in Hz, or negative errno.
 */
long clk_round_rate(struct clk *clk, unsigned long rate);