clk: meson: improve pll driver results with frac
authorJerome Brunet <jbrunet@baylibre.com>
Mon, 19 Feb 2018 11:21:39 +0000 (12:21 +0100)
committerNeil Armstrong <narmstrong@baylibre.com>
Tue, 13 Mar 2018 09:09:45 +0000 (10:09 +0100)
commit8289aafa4f361050b05f77a35d3167259530a473
tree13a2fdfe6ff4ae6abcecf06f2de989b62c2d74f8
parentc178b003bfcfde5a973c6ba6a45ca60fb1470fc6
clk: meson: improve pll driver results with frac

Finding the appropriate settings of meson plls is too tricky to be done
entirely at runtime, using calculation only. Many combination of m, n
and od won't lock which is why we are using a table for this.  However,
for plls having a fractional parameters, it is possible to improve on
the result provided by the table by calculating the frac parameter.

This change adds the calculation of frac when the parameter is available
and the rate provided by the table is not an exact match for the
requested rate.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
drivers/clk/meson/clk-pll.c
drivers/clk/meson/clkc.h