lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXv+5FHA-Y1xyW=_UjGUDsqarXNTciGP7KnzoB2Jyj2Ft5rdQ@mail.gmail.com>
Date: Tue, 8 Jul 2025 12:09:39 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Cc: linux-mediatek@...ts.infradead.org, lee@...nel.org, robh@...nel.org, 
	krzk+dt@...nel.org, conor+dt@...nel.org, matthias.bgg@...il.com, 
	lgirdwood@...il.com, broonie@...nel.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	kernel@...labora.com
Subject: Re: [PATCH v2 3/8] dt-bindings: regulator: Document MediaTek MT6363
 PMIC Regulators

Hi,

On Mon, Jul 7, 2025 at 10:27 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com> wrote:
>
> Add bindings for the regulators found in the MediaTek MT6363 PMIC,
> usually found in board designs using the MT6991 Dimensity 9400 and
> on MT8196 Kompanio SoC for Chromebooks, along with the MT6316 and
> MT6373 PMICs.
>
> Link: https://lore.kernel.org/r/20250624073548.29732-4-angelogioacchino.delregno@collabora.com
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
>  .../regulator/mediatek,mt6363-regulator.yaml  | 175 ++++++++++++++++++
>  1 file changed, 175 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
>
> diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> new file mode 100644
> index 000000000000..9df57b803edb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> @@ -0,0 +1,175 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mediatek,mt6363-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT6363 PMIC Regulators
> +
> +maintainers:
> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> +
> +description:
> +  The MT6363 SPMI PMIC provides 13 BUCK and 25 LDO (Low Dropout) regulators
> +  and can optionally provide overcurrent warnings with one ocp interrupt
> +  for each voltage regulator.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt6363-regulator
> +
> +  interrupts:
> +    description: Overcurrent warning interrupts
> +    minItems: 1
> +    maxItems: 38
> +
> +  interrupt-names:
> +    description:
> +      Names for the overcurrent interrupts are the same as the name
> +      of a regulator (hence the same as each regulator's node name).
> +      For example, the interrupt name for regulator ldo-vemc will
> +      be "ldo-vemc".
> +    minItems: 1
> +    maxItems: 38
> +    contains:
> +      enum:
> +        - buck-sshub1
> +        - buck-sshub2
> +        - buck-sshub4
> +        - buck-vb1
> +        - buck-vb2
> +        - buck-vb3
> +        - buck-vb4
> +        - buck-vb5
> +        - buck-vb6
> +        - buck-vb7
> +        - buck-vs1
> +        - buck-vs2
> +        - buck-vs3
> +        - ldo-va12-1
> +        - ldo-va12-2
> +        - ldo-va15
> +        - ldo-vaux18
> +        - ldo-vcn13
> +        - ldo-vcn15
> +        - ldo-vemc
> +        - ldo-vio0p75
> +        - ldo-vio18
> +        - ldo-vm18
> +        - ldo-vrf0p9
> +        - ldo-vrf12
> +        - ldo-vrf13
> +        - ldo-vrf18
> +        - ldo-vrf-io18
> +        - ldo-vsram-apu
> +        - ldo-vsram-cpub
> +        - ldo-vsram-cpum
> +        - ldo-vsram-cpul
> +        - ldo-vsram-digrf
> +        - ldo-vsram-mdfe
> +        - ldo-vsram-modem
> +        - ldo-vtref18
> +        - ldo-vufs12
> +        - ldo-vufs18

To summarize my replies to the previous iteration, I think this is
not a good representation, since a) the interrupts are internal
to the PMIC, and it does not need to be spelled out in the DT, and
b) this gives another meaning to the representation, it being to
enable overcurrent protection on the given regulators. Instead
the common regulator binding has the "regulator-over-current-protection"
property that can be set in each regulator. IMO this is much more
explicit.


> +  isink-load:
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false

Do we know what this is for? There's no actual output with this name.

> +  ldo-vemc:
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +patternProperties:
> +  "^buck-(sshub[124]|vb[1-7]|vs[1-3])$":

According to the datasheets, vb[1-7] should be vbuck[1-7].

There are no real outputs with the name sshub*. These seem to be some
alternate setting / mode. I don't think they should be modeled as
separate regulators.

Also, could we drop the type from the names? There's no real need for them.
I managed to get them removed in the MT6366 binding, and I hope we can
continue that scheme.

> +    description: Buck regulators
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        description: |
> +          Allowed Buck regulator operating modes allowed. Valid values below.
> +            0 - Normal mode with automatic power saving, reducing the switching
> +                frequency when light load conditions are detected
> +            1 - Forced Continuous Conduction mode (FCCM) for improved voltage
> +                regulation accuracy with constant switching frequency but lower
> +                regulator efficiency
> +            2 - Forced Low Power mode for improved regulator efficiency, used
> +                when no heavy load is expected, does not limit the maximum out
> +                current but unless only a light load is applied, there will be
> +                regulation accuracy and efficiency losses.
> +            3 - Forced Ultra Low Power mode for ultra low load, this greatly
> +                reduces the maximum output power, makes the regulator to be
> +                efficient only for ultra light load, and greatly reduces the
> +                quiescent current (Iq) of the buck.
> +        maxItems: 3
> +        items:
> +          enum: [ 0, 1, 2, 3 ]
> +    unevaluatedProperties: false
> +
> +  "^ldo-va(12-1|12-2|15)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +  "^ldo-v(aux|m|rf-io|tref)18$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +  "^ldo-vcn(13|15)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +  "^ldo-vio(0p75|18)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +  "^ldo-vrf(0p9|12|13|18)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +  "^ldo-vsram-(apu|cpub|cpum|cpul|digrf|mdfe|modem)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +  "^ldo-vufs(12|18)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false

Could we also describe supplies? There should be:

vsys-(buck[1-7]|vs[1-3]|ldo1)-supply


ChenYu

> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    pmic {
> +      interrupt-controller;
> +      #interrupt-cells = <3>;
> +
> +      regulators {
> +        compatible = "mediatek,mt6363-regulator";
> +        interrupts = <4 16 IRQ_TYPE_LEVEL_HIGH>, <4 17 IRQ_TYPE_LEVEL_HIGH>,
> +                     <4 18 IRQ_TYPE_LEVEL_HIGH>, <4 19 IRQ_TYPE_LEVEL_HIGH>;
> +        interrupt-names = "ldo-vcn15", "ldo-vcn13", "ldo-vrf0p9", "ldo-vrf12";
> +
> +        ldo-vio18 {
> +          regulator-name = "pp1800-vio18-s3";
> +          regulator-min-microvolt = <1800000>;
> +          regulator-max-microvolt = <1800000>;
> +          regulator-allowed-modes = <0 2>;
> +          regulator-allow-set-load;
> +        };
> +      };
> +    };
> +...
> --
> 2.49.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ