]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
clk: qcom: Simplify gdsc status checking logic
authorStephen Boyd <sboyd@kernel.org>
Wed, 2 May 2018 06:58:47 +0000 (23:58 -0700)
committerStephen Boyd <sboyd@kernel.org>
Tue, 8 May 2018 18:22:55 +0000 (11:22 -0700)
commit88051f55de502811472fe25d4a710bc7e6e60fd1
tree47421eb5538f2c491b1f9367fab448dd833480b6
parente892e17d0c0e3d1bb8a56b84d15f9995807b92fa
clk: qcom: Simplify gdsc status checking logic

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: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/gdsc.c