From 4e7cf74fa3b28fcb43531ca6bc350bf8636e3de6 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 12 Aug 2021 20:00:22 +0300 Subject: 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 Tested-by: Heiko Stuebner Acked-by: Heiko Stuebner 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 --- drivers/clk/clk-fractional-divider.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 drivers/clk/clk-fractional-divider.h (limited to 'drivers/clk/clk-fractional-divider.h') 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 -- cgit v1.2.3