summaryrefslogtreecommitdiff
path: root/include/linux/clk-provider.h
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/linux/clk-provider.h
parent334614058886fc5002dbfa2c4c72f89b3830f7e1 (diff)
downloadlwn-ec52e462564b9c5bfdf1f79638c537c7103e1d2b.tar.gz
lwn-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/linux/clk-provider.h')
-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;
};