Re: [PATCH v3 05/12] regulator: dt-bindings: mt6358: Add MT6366 PMIC

From: AngeloGioacchino Del Regno
Date: Wed Sep 20 2023 - 04:01:05 EST


Il 19/09/23 21:57, Rob Herring ha scritto:
On Tue, Sep 19, 2023 at 06:43:48PM +0800, Chen-Yu Tsai wrote:
From: Zhiyong Tao <zhiyong.tao@xxxxxxxxxxxx>

The MediaTek MT6366 PMIC is similar to the MT6358 PMIC. It is designed
to be paired with the MediaTek MT8186 SoC. It has 9 buck regulators and
29 LDO regulators, not counting ones that feed internally and basically
have no controls. The regulators are named after their intended usage
for the SoC and system design, thus not named generically as ldoX or
dcdcX, but as vcn33 or vgpu.

The differences compared to the MT6358 are minimal:
- Regulators removed: VCAMA1, VCAMA2, VCAMD, VCAMIO, VLDO28
- Regulators added: VM18, VMDDR, VSRAM_CORE

Add a binding document describing all the regulators and their supplies.

Signed-off-by: Zhiyong Tao <zhiyong.tao@xxxxxxxxxxxx>
[wens@xxxxxxxxxxxx: major rework and added commit message]
Signed-off-by: Chen-Yu Tsai <wenst@xxxxxxxxxxxx>
---
Changes since v2:
- Merged all the propertyPatterns together; the if-then sections now
only block out invalid properties

Changes since v1:
- Replaced underscores in supply names to hyphens
- Merged with MT6358 regulator binding
- Added MT6358 fallback compatible to MT6366 regulator

Changes since Zhiyong's last version (v4) [1]:
- simplified regulator names
- added descriptions to regulators
- removed bogus regulators (*_sshub)
- merged vcn33-wifi and vcn33-bt as vcn33
- added missing regulators (vm18, vmddr, vsram-core)
- cut down examples to a handful of cases and made them complete
- expanded commit message a lot

[1] https://lore.kernel.org/linux-arm-kernel/20220823123745.14061-1-zhiyong.tao@xxxxxxxxxxxx/

.../regulator/mediatek,mt6358-regulator.yaml | 120 +++++++++++++++---
1 file changed, 104 insertions(+), 16 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml
index c5f336318ec2..05e381899d08 100644
--- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml
@@ -16,14 +16,18 @@ description:
properties:
compatible:
- const: mediatek,mt6358-regulator
+ oneOf:
+ - const: mediatek,mt6358-regulator
+ - items:
+ - const: mediatek,mt6366-regulator
+ - const: mediatek,mt6358-regulator

Would the mt6366 regulator driver(s) function with the mt6358 driver
unchanged? If not, then not really much point in having the fallback.


It would, because there's chip id verification inside and would still
automatically select the right regulator info, even if there's no mt6366
specific compatible.

Cheers,
Angelo