diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-03-14 15:12:35 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-05-06 11:58:10 +0100 |
commit | d2d14a77886485310ec66e575f00ea5232ac7a14 (patch) | |
tree | 1bde5a546fc78058703552c28cdefd0061130d01 /include/linux/clk.h | |
parent | d5622a9c13752be46e6fcde9d31391ce0bb0598b (diff) | |
download | lwn-d2d14a77886485310ec66e575f00ea5232ac7a14.tar.gz lwn-d2d14a77886485310ec66e575f00ea5232ac7a14.zip |
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: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r-- | include/linux/clk.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index 68c16a6bedb3..cafb22df8d00 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -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); |