clk: at91: clk-generated: create function to find best_diff
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Thu, 10 Aug 2017 06:34:04 +0000 (08:34 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Fri, 1 Sep 2017 22:46:53 +0000 (15:46 -0700)
commit8a8f4bf0c48055f0648b5449f4685b6cd0fc1c85
tree925f18e24acecef715ed485e7a5f76d074ac13ad
parent0865805d82d4c822647ee35ab2629c48cc40706b
clk: at91: clk-generated: create function to find best_diff

The way to find the best_diff and do the appropriate process afterwards
can be re-used.

This patch prepares the driver for an upcoming patch that will allow
clk_generated to determine the rate of the audio_pll.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/at91/clk-generated.c