diff options
author | Chen-Yu Tsai <wens@csie.org> | 2017-01-28 07:22:32 -0500 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2017-01-30 02:36:03 -0500 |
commit | 82aab516ec96ab9f9ad4b80a0bab9368b1cd5cdc (patch) | |
tree | 53badf37c67f472b3505f012681c764a2667e4a9 | |
parent | 216abdcc3ae7b1dbe145f1e78cf727b6832db9b4 (diff) |
clk: sunxi-ng: mux: Get closest parent rate possible with CLK_SET_RATE_PARENT
If the CLK_SET_RATE_PARENT flag is set, we want to try getting the
closest parent rate.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
-rw-r--r-- | drivers/clk/sunxi-ng/ccu_mux.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_mux.c b/drivers/clk/sunxi-ng/ccu_mux.c index d0d69c7eb516..c6bb1f523232 100644 --- a/drivers/clk/sunxi-ng/ccu_mux.c +++ b/drivers/clk/sunxi-ng/ccu_mux.c | |||
@@ -93,7 +93,18 @@ int ccu_mux_helper_determine_rate(struct ccu_common *common, | |||
93 | if (!parent) | 93 | if (!parent) |
94 | continue; | 94 | continue; |
95 | 95 | ||
96 | parent_rate = clk_hw_get_rate(parent); | 96 | if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) { |
97 | struct clk_rate_request parent_req = *req; | ||
98 | int ret = __clk_determine_rate(parent, &parent_req); | ||
99 | |||
100 | if (ret) | ||
101 | continue; | ||
102 | |||
103 | parent_rate = parent_req.rate; | ||
104 | } else { | ||
105 | parent_rate = clk_hw_get_rate(parent); | ||
106 | } | ||
107 | |||
97 | adj_parent_rate = parent_rate; | 108 | adj_parent_rate = parent_rate; |
98 | ccu_mux_helper_adjust_parent_for_prediv(common, cm, i, | 109 | ccu_mux_helper_adjust_parent_for_prediv(common, cm, i, |
99 | &adj_parent_rate); | 110 | &adj_parent_rate); |