aboutsummaryrefslogtreecommitdiff
path: root/include/clk-uclass.h
diff options
context:
space:
mode:
authorDario Binacchi2020-12-30 00:06:31 +0100
committerLokesh Vutla2021-01-12 10:58:04 +0530
commit2983ad55a13e9afcdf1a3d8f55eea038c0a0e8a3 (patch)
treed586303823a6aa0aa980451e53610dc20e7e66b5 /include/clk-uclass.h
parent6337d53fdf45df764bc9946d927172397f183d37 (diff)
clk: add clk_round_rate()
It returns the rate which will be set if you ask clk_set_rate() to set that rate. It provides a way to query exactly what rate you'll get if you call clk_set_rate() with that same argument. So essentially, clk_round_rate() and clk_set_rate() are equivalent except the former does not modify the clock hardware in any way. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'include/clk-uclass.h')
-rw-r--r--include/clk-uclass.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clk-uclass.h b/include/clk-uclass.h
index dac42dab368..50e8681b553 100644
--- a/include/clk-uclass.h
+++ b/include/clk-uclass.h
@@ -62,6 +62,14 @@ struct clk_ops {
*/
int (*rfree)(struct clk *clock);
/**
+ * round_rate() - Adjust a rate to the exact rate a clock can provide.
+ *
+ * @clk: The clock to manipulate.
+ * @rate: Desidered clock rate in Hz.
+ * @return rounded rate in Hz, or -ve error code.
+ */
+ ulong (*round_rate)(struct clk *clk, ulong rate);
+ /**
* get_rate() - Get current clock rate.
*
* @clk: The clock to query.