Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit eb448596 authored by David Collins's avatar David Collins
Browse files

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: default avatarDavid Collins <collinsd@codeaurora.org>
parent ecbdac2c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment