UPSTREAM: clk: rockchip: handle mux dependency of fractional dividers
authorHeiko Stuebner <heiko@sntech.de>
Tue, 22 Dec 2015 21:27:59 +0000 (22:27 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 18 Feb 2016 11:16:35 +0000 (19:16 +0800)
commit8e4260d130a312d50deb8a7bdbb7871a876d55b2
tree341c998941095a2da7c89b39721c048badce7049
parentd8a5071adefcfec9b6568e975e03d42df0b5669f
UPSTREAM: clk: rockchip: handle mux dependency of fractional dividers

The fractional dividers of Rockchip SoCs contain an "auto-gating-feature"
that requires the downstream mux to actually point to the fractional
divider and the fractional divider gate to be enabled, for it to really
accept changes to the divider ratio.

The downstream muxes themselfs are not generic enough to include them
directly into the fractional divider, as they have varying sources of
parent clocks including not only clocks related to the fractional
dividers but other clocks as well.

To solve this, allow our clock branches to specify direct child clock-
branches in the new child property, let the fractional divider register
its downstream mux through this and add a clock notifier that temporarily
switches the mux setting when it notices rate changes to the fractional
divider.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
(cherry picked from commit 8ca1ca8f6039f19673fb61552f276b848539dbd6)

Change-Id: Ic538fcf248f1e8a7ac87a45788167855155ca54a
drivers/clk/rockchip/clk.c
drivers/clk/rockchip/clk.h