clk: fractional-divider: Improve approximation when zero based and export
authorFrank Oltmanns <frank@oltmanns.dev>
Sat, 17 Jun 2023 13:10:40 +0000 (15:10 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 12 Oct 2023 21:02:17 +0000 (14:02 -0700)
commit2e9abc6ec108370ad341f98d0e05e02e4e165b5a
treed4b1d1fa5ce6078fba5271467b7a9133515a51e2
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d
clk: fractional-divider: Improve approximation when zero based and export

Consider the CLK_FRAC_DIVIDER_ZERO_BASED flag when finding the best
approximation for m and n. By doing so, increase the range of valid
values for the numerator and denominator by 1.

Furthermore, export the approximation function so that users of this
function can be compiled as modules.

Cc: A.s. Dong <aisheng.dong@nxp.com>
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Link: https://lore.kernel.org/r/20230617131041.18313-2-frank@oltmanns.dev
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-fractional-divider.c