regulator: mt6358: Remove bogus regulators and
authorMark Brown <broonie@kernel.org>
Wed, 14 Jun 2023 18:58:02 +0000 (19:58 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 14 Jun 2023 18:58:02 +0000 (19:58 +0100)
Merge series from Chen-Yu Tsai <wenst@chromium.org>:

This series is a cleanup and improvement of the MT6358 regulator driver.
Various discrepancies were found while preparing to upstream MT8186
device trees, which utilize the MT6366 PMIC, that is also covered by
this driver.

Patches 1~8 should go through the regulator tree, and patch 9 through
the soc tree.

This series can be seen as two parts:

Part 1 - Fixing bogus regulators (patches 1~4 and 9)

There are some regulators listed in the bindings and driver that have no
corresponding pin on the actual hardware. MediaTek says these are a
hardware construct for shared control of the same regulator in the
VCN33 case and an alternative control scheme for low power suspend.

In the VCN33 case, there's only one actual regulator, so we merge the
two and rename them to match the hardware pin. No existing devices use
these AFAICT, so this should be safe to change.

In the *_SSHUB case, the two extra regulators refer to alternative
configuration registers of the same regulators. They are intended for
the SoC's low power mode companion processor to use, not the main
processor or OS. It should be left to the implementation to choose
which set of registers to actually control.

Part 2 - Code cleanup (patches 5 and 6)

Various tables in the regulator driver were not constant, even though
they are just lookup tables. With some reworking of the code, they are
made constant.

Also, some regulators that have a single linear range were using linear
range helpers. This is more complicated than just declaring the range
and step directly in the description. This is simplified to use the
latter approach.

Please have a look. After this series is done I'll send out patches for
the MT6366 PMIC, which is what started this. That will also include
updated YAML bindings for MT6366. I think we can merge MT6358 bindings
into them afterwards.

[1] https://lore.kernel.org/linux-arm-kernel/20230609075032.2804554-1-wenst@chromium.org/


Trivial merge