clk: defer clk_gets on orphan clocks
authorElaine Zhang <zhangqing@rock-chips.com>
Fri, 31 Mar 2017 08:01:00 +0000 (16:01 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 11 Apr 2017 10:29:22 +0000 (18:29 +0800)
commitf8d4d71d8d22b39043c524e1d9f007bcd54bd2fa
treee2f62a1e5d7e12fd977dd9a30c68d3eb5146979b
parentc52fb0880cc0f38d36938e4f60d39a380ed1dc71
clk: defer clk_gets on orphan clocks

Orphan clocks or children of orphan clocks don't have rate information at
all and can produce strange results if they're allowed to be used and the
parent becomes available later on.

This change, based on one from Stephen Boyd, defers __clk_create_clk()
calls on orphan clocks in all regular cases.

One special case that gets handled, is accessing such orphan clocks when
handling assigned-clocks configurations. In the boot-defaults it may be
the case that a clock is connected to an orphan parent which then might
be needed to get reparented to an actually usable clock using
assigned-clock-parents. In this case even orphaned clocks should be
usable, but only for the set-parent case.

The added of_clk_get_from_provider_with_orphans() is only available
to ccf internal parts to prevent abuse.

(am from https://patchwork.kernel.org/patch/7690221/)

Change-Id: I2e603dab191fa8a431adebad1f9d482d52b7deeb
Signed-off-by: Heiko Stuebner <heiko.stuebner@collabora.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
drivers/clk/clk-conf.c
drivers/clk/clk.c
drivers/clk/clk.h
drivers/clk/clkdev.c