summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorElaine Zhang <zhangqing@rock-chips.com>2017-08-01 18:21:22 +0200
committerHeiko Stuebner <heiko@sntech.de>2017-08-08 17:39:48 +0200
commitec52e462564b9c5bfdf1f79638c537c7103e1d2b (patch)
treecb1cb6ce6240d2de48708f38e619d0a270875e67 /include
parentclk: rockchip: modify rk3128 clk driver to also support rk3126 (diff)
downloadlinux-ec52e462564b9c5bfdf1f79638c537c7103e1d2b.tar.xz
linux-ec52e462564b9c5bfdf1f79638c537c7103e1d2b.zip
clk: fractional-divider: allow overriding of approximation
Fractional dividers may have special requirements concerning numerator and denominator selection that differ from just getting the best approximation. For example on Rockchip socs the denominator must be at least 20 times larger than the numerator to generate precise clock frequencies. Therefore add the ability to provide custom approximation functions. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Acked-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk-provider.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index c59c62571e4f..1fc113fbf955 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -565,6 +565,9 @@ struct clk_fractional_divider {
u8 nwidth;
u32 nmask;
u8 flags;
+ void (*approximation)(struct clk_hw *hw,
+ unsigned long rate, unsigned long *parent_rate,
+ unsigned long *m, unsigned long *n);
spinlock_t *lock;
};