summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-11-27 07:49:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-12-05 08:45:32 +0100
commit16994e864ffae4ce2d2f3bfffbe5c27add231c95 (patch)
tree16e8a130733ceacd454dd3065e2daa1d959f64d5 /include/linux
parent1484a59ee7feff318aca6e5ff294ac7ce9a86d7f (diff)
downloadbarebox-16994e864ffae4ce2d2f3bfffbe5c27add231c95.tar.gz
barebox-16994e864ffae4ce2d2f3bfffbe5c27add231c95.tar.xz
clk: divider: implement divider_[ro_]round_rate_parent
These functions will be used in the incoming STM32MP13 clock driver support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231127064947.2207726-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk-provider.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 207f3b205d..6d781fbfcc 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -8,6 +8,27 @@
#include <linux/clk.h>
+long divider_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
+ unsigned long rate, unsigned long *prate,
+ const struct clk_div_table *table,
+ u8 width, unsigned long flags);
+
+long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
+ unsigned long rate, unsigned long *prate,
+ const struct clk_div_table *table, u8 width,
+ unsigned long flags, unsigned int val);
+
+static inline long divider_ro_round_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long *prate,
+ const struct clk_div_table *table,
+ u8 width, unsigned long flags,
+ unsigned int val)
+{
+ return divider_ro_round_rate_parent(hw, clk_hw_get_parent(hw),
+ rate, prate, table, width, flags,
+ val);
+}
+
#define CLK_HW_INIT(_name, _parent, _ops, _flags) \
(&(struct clk_init_data) { \
.flags = _flags, \