clk: sunxi-ng: mp: Adjust parent rate for pre-dividers
authorChen-Yu Tsai <wens@csie.org>
Tue, 14 Feb 2017 03:35:22 +0000 (11:35 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 6 Mar 2017 06:36:04 +0000 (07:36 +0100)
commitac8616e4c81dded650dfade49a7da283565d37ce
tree84ff6cfb9d1b96767417e6b09502c7fab5394b41
parentc1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201
clk: sunxi-ng: mp: Adjust parent rate for pre-dividers

The MP style clocks support an mux with pre-dividers. While the driver
correctly accounted for them in the .determine_rate callback, it did
not in the .recalc_rate and .set_rate callbacks.

This means when calculating the factors in the .set_rate callback, they
would be off by a factor of the active pre-divider. Same goes for
reading back the clock rate after it is set.

Cc: stable@vger.kernel.org
Fixes: 2ab836db5097 ("clk: sunxi-ng: Add M-P factor clock support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi-ng/ccu_mp.c