clk: rockchip: handle mux dependency of fractional dividers
authorHeiko Stuebner <heiko@sntech.de>
Tue, 22 Dec 2015 21:27:59 +0000 (22:27 +0100)
committerMichael Turquette <mturquette@baylibre.com>
Wed, 23 Dec 2015 20:57:29 +0000 (12:57 -0800)
commit8ca1ca8f6039f19673fb61552f276b848539dbd6
treeb1cdc1c0584c8301aa1a13b3855dfbf414281988
parent8ad0df33c62d706f925a5910701255759a68c2e5
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>
drivers/clk/rockchip/clk.c
drivers/clk/rockchip/clk.h