summaryrefslogtreecommitdiff
path: root/drivers/clk/clk-fractional-divider.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-08-12 20:00:22 +0300
committerStephen Boyd <sboyd@kernel.org>2021-08-12 12:41:47 -0700
commit4e7cf74fa3b28fcb43531ca6bc350bf8636e3de6 (patch)
treef165057d930f49553cf58e923505a861701a5185 /drivers/clk/clk-fractional-divider.h
parente73f0f0ee7541171d89f2e2491130c7771ba58d3 (diff)
clk: fractional-divider: Export approximation algorithm to the CCF users
At least one user currently duplicates some functions that are provided by fractional divider module. Let's export approximation algorithm and replace the open-coded variant. As a bonus the exported function will get better documentation in place. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20210812170025.67074-1-andriy.shevchenko@linux.intel.com [sboyd@kernel.org: Add header guard because why not] Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-fractional-divider.h')
-rw-r--r--drivers/clk/clk-fractional-divider.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/clk/clk-fractional-divider.h b/drivers/clk/clk-fractional-divider.h
new file mode 100644
index 000000000000..a05649eceb17
--- /dev/null
+++ b/drivers/clk/clk-fractional-divider.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _CLK_FRACTIONAL_DIV_H
+#define _CLK_FRACTIONAL_DIV_H
+
+struct clk_hw;
+
+void clk_fractional_divider_general_approximation(struct clk_hw *hw,
+ unsigned long rate,
+ unsigned long *parent_rate,
+ unsigned long *m,
+ unsigned long *n);
+
+#endif