spmi: msm: use real number of channels for v5 & v7
authorNeil Armstrong <neil.armstrong@linaro.org>
Fri, 28 Mar 2025 08:53:21 +0000 (09:53 +0100)
committerCaleb Connolly <caleb.connolly@linaro.org>
Thu, 10 Apr 2025 13:43:10 +0000 (15:43 +0200)
commit1a02b7aa58ae1558e2fd5c29e85c20bdf1becaae
treefad48af0c13390728e4822314d0996b43e6eafdd
parent2c1462e38b771c547a1f3ee8bbea5aa9d3719885
spmi: msm: use real number of channels for v5 & v7

The SPMI_MAX_CHANNELS_Vx are only the maximum channels supported
by the controller, but the real number of channels mapped on this
system can be read from a register, so take this info.

This allows no to overlap on the second controller present on
the V7 SPMI arbiter, otherwise we would also parse the mapping
of the second SPMI bus and we would bet the wrong IDs.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: caleb.connolly@linaro.org # sdm845
Link: https://lore.kernel.org/r/20250328-topic-sm8x50-spmi-fix-v1-1-a7548d3aef0d@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
drivers/spmi/spmi-msm.c