• Amit Nischal's avatar
    clk: qcom: Configure the RCGs to a safe source as needed · 7ef6f118
    Amit Nischal authored
    For some root clock generators, there could be child branches which are
    controlled by an entity other than application processor subsystem. For
    such RCGs, as per application processor subsystem clock driver, all of
    its downstream clocks are disabled and RCG is in disabled state but in
    reality downstream clocks can be left enabled before.
    
    So in this scenario, when RCG is disabled as per clock driver's point of
    view and when rate scaling request comes before downstream clock enable
    request, then RCG fails to update its configuration because in reality
    RCG is on and it expects its new source to already be in enable state but
    in reality new source is off. In order to avoid having the RCG to go into
    an invalid state, add support to update the CFG, M, N and D registers
    during set_rate() without configuration update and defer the actual RCG
    configuration update to be done during clk_enable() as at this point of
    time, both its new parent and safe source will be already enabled and RCG
    can safely switch to new parent.
    
    During clk_disable() request, configure it to safe source as both its
    parents, safe source and current parent will be enabled and RCG can
    safely execute a switch.
    Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
    Signed-off-by: default avatarAmit Nischal <anischal@codeaurora.org>
    Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
    7ef6f118
clk-rcg.h 3.83 KB