soc: qcom: rpmh-rsc: Clean code reading/writing TCS regs/cmds
authorDouglas Anderson <dianders@chromium.org>
Mon, 13 Apr 2020 17:04:06 +0000 (10:04 -0700)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 14 Apr 2020 05:09:17 +0000 (22:09 -0700)
commit3b5e3d50f83a3706126ade45ba8d44ca829b0803
tree2591dcf1c1f7166528aee6d14dedcdf14e1a7793
parent38427e5a47bf83299da930bd474c6cb2632ad810
soc: qcom: rpmh-rsc: Clean code reading/writing TCS regs/cmds

This patch makes two changes, both of which should be no-ops:

1. Make read_tcs_reg() / read_tcs_cmd() symmetric to write_tcs_reg() /
   write_tcs_cmd().

2. Change the order of operations in the above functions to make it
   more obvious to me what the math is doing.  Specifically first you
   want to find the right TCS, then the right register, and then
   multiply by the command ID if necessary.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Maulik Shah <mkshah@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://lore.kernel.org/r/20200413100321.v4.1.I1b754137e8089e46cf33fc2ea270734ec3847ec4@changeid
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/soc/qcom/rpmh-rsc.c