clk: qcom: clk-rcg2: correct set rate handling for FORCE_ENABLE_RCG
Currently, if clk_set_rate() is called on a disabled clock that
has flags = FORCE_ENABLE_RCG, the rate is neither physically set
nor properly cached in software. This means that when the clock
is later enabled, its rate will not be what was previously
requested.
Change the handling of FORCE_ENABLE_RCG so that all clk_set_rate()
calls are respected regardless of a clock's enable state. In
doing so, ensure that FORCE_ENABLE_RCG and enable_safe_config are
supported both individually and together.
Implement the following behavior:
enable_safe_config == true:
enable - configure the RCG according to the cached current_freq
disable - configure the RCG for CXO (safe) source
set_rate - (if prepared) configure the RCG for the requested rate
(if not prepared) cache the rate in current_freq
flags | FORCE_ENABLE_RCG:
enable - set ROOT_EN=1 to force the RCG to be enabled
disable - set ROOT_EN=0
set_rate - configure the RCG for the requested rate;
if disabled, then set ROOT_EN=1 before the
configuration is changed and ROOT_EN=0 after
enable_safe_config && (flags | FORCE_ENABLE_RCG):
enable - set ROOT_EN=1 and configure the RCG according to the
cached current_freq
disable - configure the RCG for CXO source and set ROOT_EN=0
set_rate - (if prepared) configure the RCG for the requested rate
(if not prepared) cache the rate in current_freq
Change-Id: Ib7442e4a4b572ae7c567929044410e09a9886c76
Signed-off-by:
David Collins <collinsd@codeaurora.org>
Loading
Please register or sign in to comment