clk: divider: Add re-usable determine_rate implementations
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 27 Jun 2021 22:39:57 +0000 (00:39 +0200)
committerStephen Boyd <sboyd@kernel.org>
Wed, 30 Jun 2021 18:37:02 +0000 (11:37 -0700)
commitbbd7a6cc382f4317b08ba71151b23abf76fc4c34
tree47e1e1bc6f33e00d5051be569896a8b818610115
parentfaa0e307948594b4379a86fff7fb2409067aed6f
clk: divider: Add re-usable determine_rate implementations

These are useful when running on 32-bit systems to increase the upper
supported frequency limit. clk_ops.round_rate returns a signed long
which limits the maximum rate on 32-bit systems to 2^31 (or approx.
2.14GHz). clk_ops.determine_rate internally uses an unsigned long so
the maximum rate on 32-bit systems is 2^32 or approx. 4.29GHz.

To avoid code-duplication switch over divider_{ro_,}round_rate_parent
to use the new divider_{ro_,}determine_rate functions.

Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20210627223959.188139-2-martin.blumenstingl@googlemail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-divider.c
include/linux/clk-provider.h