clk: clk-mux: implement remuxing on set_rate
authorJames Hogan <james.hogan@imgtec.com>
Mon, 29 Jul 2013 11:25:02 +0000 (12:25 +0100)
committerMike Turquette <mturquette@linaro.org>
Mon, 19 Aug 2013 19:27:18 +0000 (12:27 -0700)
commite366fdd72529c545ccf327569ee250c1673be221
tree69139adc59e6ab101555f09544669793c385c250
parent819c1de344c5b8350bffd35be9a0fa74541292d3
clk: clk-mux: implement remuxing on set_rate

Implement clk-mux remuxing if the CLK_SET_RATE_NO_REPARENT flag isn't
set. This implements determine_rate for clk-mux to propagate to each
parent and to choose the best one (like clk-divider this chooses the
parent which provides the fastest rate <= the requested rate).

The determine_rate op is implemented as a core helper function so that
it can be easily used by more complex clocks which incorporate muxes.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk-mux.c
drivers/clk/clk.c
include/linux/clk-provider.h