Skip to content
smpi: msm: fix version 5 and add version 7 support

First, fix version 5 support by using the right ch_offset in
then msm_spmi_write() reg accesses.

Then:
- properly format command by importing helpers from Linux driver and
  use a switch/case to handle all versions in msm_spmi_write/read() command.
- handle peripheral ownership by poking into the cnfg registers and
  mark periperal as read-only when the owner id doesn't match
- finally add version 7 defines

SPMI Arbiter Version 7 is present on SM8450, SM8550 and SM8650 SoC.

To: Caleb Connolly <caleb.connolly@linaro.org>
To: Sumit Garg <sumit.garg@linaro.org>
To: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: Tom Rini <trini@konsulko.com>
To: Dzmitry Sankouski <dsankouski@gmail.com>
Cc:  <u-boot@lists.denx.de>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

---
Neil Armstrong (4):
      spmi: msm: fix version 5 support
      spmi: msm: properly format command
      spmi: msm: handle peripheral ownership
      spmi: msm: support controller version 7

 drivers/spmi/spmi-msm.c | 148 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 116 insertions(+), 32 deletions(-)
---
base-commit: f0e6aba1218bca578605697eed8aa94582bf57bb
change-id: 20240404-topic-sm8x50-spmi-fixes-aec9b392813b

Best regards,