• Stephen Boyd's avatar
    clk: qcom: Simplify gdsc status checking logic · 88051f55
    Stephen Boyd authored
    The code is complicated because we want to check if the GDSC is enabled
    or disabled based on different bits in different registers while the
    GDSC hardware is slightly different across chips. Furthermore, we poll
    the status of the enable or disable state by checking if the gdsc is
    enabled or not, and then comparing that to if the gdsc is being enabled
    or disabled. Let's push all that into one function, so we can ask if the
    status matches what we want, either on or off. Then the call site can
    just ask that question, and the logic to check that state can simply
    return yes or no, and not 1 or 0 or 0 or 1 depending on if we're
    enabling or disabling respectively.
    Tested-by: default avatarTaniya Das <tdas@codeaurora.org>
    Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
    88051f55
gdsc.c 9.45 KB