OSDN Git Service

clk: sunxi-ng: mux: Don't just rely on the parent for CLK_SET_RATE_PARENT
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 17 May 2017 07:40:33 +0000 (09:40 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 7 Jun 2017 13:32:13 +0000 (15:32 +0200)
commit73e3e04fc009973d55a523ece1a7261ef7a089be
treed3d6bd862fd78a4b0bb74c24d19c2d7ce3081be9
parente69b2afa876d246feff724dfc7b0b58aec360633
clk: sunxi-ng: mux: Don't just rely on the parent for CLK_SET_RATE_PARENT

The current code only rely on the parent to change its rate in the case
where CLK_SET_RATE_PARENT is set.

However, some clock rates might be obtained only through a modification of
the parent and the clock divider. Just rely on the round rate of the clocks
to give us the best computation that might be achieved for a given rate.

round_rate functions now need to honor CLK_SET_RATE_PARENT, but either the
functions already do that if they modify the parent, or don't modify the
praents at all.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
drivers/clk/sunxi-ng/ccu_mux.c