Skip to content
Commit 7d0f3fbb authored by Tero Kristo's avatar Tero Kristo Committed by Lokesh Vutla
Browse files

lib: rational: copy the rational fraction lib routines from Linux



Copy the best rational approximation calculation routines from Linux.
Typical usecase for these routines is to calculate the M/N divider
values for PLLs to reach a specific clock rate.

This is based on linux kernel commit:
"lib/math/rational.c: fix possible incorrect result from rational
fractions helper"
(sha1: 323dd2c3ed0641f49e89b4e420f9eef5d3d5a881)

Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
Signed-off-by: default avatarTero Kristo <kristo@kernel.org>
parent 08ea87a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment