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)
committer黄涛 <huangtao@rock-chips.com>
Wed, 8 Jan 2014 03:03:53 +0000 (11:03 +0800)
commit06debd06139a6f844d1bd75990a693b76b2df122
tree14c9d34f0ca24c7da595e3916f9e26c2f44550cd
parent905377241b5593de5e5830b15454fd95b6f3aa55
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