clk: Propagate clk_set_rate() if CLK_SET_PARENT_RATE present
authorSam Protsenko <semen.protsenko@linaro.org>
Fri, 8 Mar 2024 00:04:32 +0000 (18:04 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 12 Dec 2024 20:23:25 +0000 (14:23 -0600)
commite5aef1bbf11412eebd4c242b46adff5301353c30
treeadd17fdeadcdddc9eb7922c7c09486027812df40
parent9bc62c980d418f0a67632ab29cd3501072cdb6f0
clk: Propagate clk_set_rate() if CLK_SET_PARENT_RATE present

Sometimes clocks provided to a consumer might not have .set_rate
operation (like gate or mux clocks), but have CLK_SET_PARENT_RATE flag
set. In that case it's usually possible to find a parent up the tree
which is capable of setting the rate (div, pll, etc). Implement a simple
lookup procedure for such cases, to traverse the clock tree until
.set_rate capable parent is found, and use that parent to actually
change the rate. The search will stop once the first .set_rate capable
clock is found, which is usually enough to handle most cases.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
drivers/clk/clk-uclass.c