clk: qcom: Add support for RCG to register for DFS
authorTaniya Das <tdas@codeaurora.org>
Sat, 11 Aug 2018 01:53:55 +0000 (07:23 +0530)
committerStephen Boyd <sboyd@kernel.org>
Mon, 27 Aug 2018 20:36:25 +0000 (13:36 -0700)
commitcc4f6944d0e333ed57a2f300afd7c8cb6df228d5
treee1adfa849de56109b15d1bb47e9220706492da18
parent5b394b2ddf0347bef56e50c69a58773c94343ff3
clk: qcom: Add support for RCG to register for DFS

Dynamic Frequency switch is a feature of clock controller by which request
from peripherals allows automatic switching frequency of input clock
without SW intervention. There are various performance levels associated
with a root clock. When the input performance state changes, the source
clocks and division ratios of the new performance state are loaded on to
RCG via HW and the RCG switches to new clock frequency when the RCG is in
DFS HW enabled mode.

Register the root clock generators(RCG) to switch to use the dfs clock ops
in the cases where DFS is enabled. The clk_round_rate() called by the clock
consumer would invoke the dfs determine clock ops and would read the DFS
performance level registers to identify all the frequencies supported and
update the frequency table. The DFS clock consumers would maintain these
frequency mapping and request the desired performance levels.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
[sboyd@kernel.org: Rework registration logic to stop copying, change
recalc_rate() to index directly into the table if possible and fallback
to calculating on the fly with an assumed correct parent]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/clk-rcg.h
drivers/clk/qcom/clk-rcg2.c