Add bindings for the regulators found in the MediaTek MT6392 PMIC,
usually found in board designs using the MediaTek MT8516/MT8167 SoCs.
Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
---
.../regulator/mediatek,mt6392-regulator.yaml | 318 ++++++++++++++++++
.../regulator/mediatek,mt6392-regulator.h | 24 ++
2 files changed, 342 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
create mode 100644 include/dt-bindings/regulator/mediatek,mt6392-regulator.h
diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
new file mode 100644
index 000000000000..fa4aad2dcbe8
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
@@ -0,0 +1,318 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mediatek,mt6392-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6392 Regulator
+
+description:
+ Regulator node of the PMIC. This node should under the PMIC's device node.
+ All voltage regulators provided by the PMIC are described as sub-nodes of
+ this node.
+
+properties:
+ compatible:
+ items:
+ - const: mediatek,mt6392-regulator
+
+patternProperties:
+ "^(buck_)?v(core|proc|sys)$":
+ description: Buck regulators
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes:
+ description: |
+ BUCK regulators can set regulator-initial-mode and regulator-allowed-modes to
+ values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
+ items:
+ enum: [0, 1]
+ unevaluatedProperties: false
+
+ "^(ldo_)?v(adc18|camio|cn18|io18)$":
+ description: LDOs with fixed 1.8V output
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes:
+ description: |
+ LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
+ values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
+ items:
+ enum: [0, 1]
+ unevaluatedProperties: false
+
+ "^(ldo_)?v(xo22)$":
+ description: LDOs with fixed 2.2V output
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes:
+ description: |
+ LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
+ values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
+ items:
+ enum: [0, 1]
+ unevaluatedProperties: false
+
+ "^(ldo_)?v(m25)$":
+ description: LDOs with fixed 2.5V output
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes:
+ description: |
+ LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
+ values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
+ items:
+ enum: [0, 1]
+ unevaluatedProperties: false
+
+ "^(ldo_)?v(aud28|io28)$":
+ description: LDOs with fixed 2.8V output w/ mode
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes:
+ description: |
+ LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
+ values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
+ items:
+ enum: [0, 1]
+ unevaluatedProperties: false
+
+ "^(ldo_)?v(cama)$":
+ description: LDOs with fixed 2.8V output w/o mode
+ type: object
+ $ref: regulator.yaml#
+ unevaluatedProperties: false
+
+ "^(ldo_)?vusb$":
+ description: LDOs with fixed 3.3V output
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes:
+ description: |
+ LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
+ values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
+ items:
+ enum: [0, 1]
+ unevaluatedProperties: false
+
+ "^(ldo_)?v(aud22|camaf|camd|cn35|efuse|emc3v3|gp1|gp2|m|mc|mch)$":
+ description: LDOs with variable output
+ type: object
+ $ref: regulator.yaml#
+ properties:
+ regulator-allowed-modes: false
+ unevaluatedProperties: false
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ mt6392_regulators: regulators {
+ compatible = "mediatek,mt6392-regulator";
+
+ mt6392_vproc_reg: buck_vproc {
+ regulator-name = "vproc";
+ regulator-min-microvolt = <700000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <12500>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vsys_reg: buck_vsys {
+ regulator-name = "vsys";
+ regulator-min-microvolt = <1400000>;
+ regulator-max-microvolt = <2987500>;
+ regulator-ramp-delay = <25000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vcore_reg: buck_vcore {
+ regulator-name = "vcore";
+ regulator-min-microvolt = <700000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <12500>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vxo22_reg: ldo_vxo22 {
+ regulator-name = "vxo22";
+ regulator-min-microvolt = <2200000>;
+ regulator-max-microvolt = <2200000>;
+ regulator-enable-ramp-delay = <110>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vaud22_reg: ldo_vaud22 {
+ regulator-name = "vaud22";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2200000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vcama_reg: ldo_vcama {
+ regulator-name = "vcama";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vaud28_reg: ldo_vaud28 {
+ regulator-name = "vaud28";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vadc18_reg: ldo_vadc18 {
+ regulator-name = "vadc18";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vcn35_reg: ldo_vcn35 {
+ regulator-name = "vcn35";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vio28_reg: ldo_vio28 {
+ regulator-name = "vio28";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vusb_reg: ldo_vusb {
+ regulator-name = "vusb";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vmc_reg: ldo_vmc {
+ regulator-name = "vmc";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-boot-on;
+ };
+
+ mt6392_vmch_reg: ldo_vmch {
+ regulator-name = "vmch";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-boot-on;
+ };
+
+ mt6392_vemc3v3_reg: ldo_vemc3v3 {
+ regulator-name = "vemc3v3";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-boot-on;
+ };
+
+ mt6392_vgp1_reg: ldo_vgp1 {
+ regulator-name = "vgp1";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vgp2_reg: ldo_vgp2 {
+ regulator-name = "vgp2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vcn18_reg: ldo_vcn18 {
+ regulator-name = "vcn18";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vcamaf_reg: ldo_vcamaf {
+ regulator-name = "vcamaf";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vm_reg: ldo_vm {
+ regulator-name = "vm";
+ regulator-min-microvolt = <1240000>;
+ regulator-max-microvolt = <1390000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vio18_reg: ldo_vio18 {
+ regulator-name = "vio18";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <264>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ mt6392_vcamd_reg: ldo_vcamd {
+ regulator-name = "vcamd";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vcamio_reg: ldo_vcamio {
+ regulator-name = "vcamio";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vm25_reg: ldo_vm25 {
+ regulator-name = "vm25";
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+
+ mt6392_vefuse_reg: ldo_vefuse {
+ regulator-name = "vefuse";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2000000>;
+ regulator-enable-ramp-delay = <264>;
+ };
+ };
diff --git a/include/dt-bindings/regulator/mediatek,mt6392-regulator.h b/include/dt-bindings/regulator/mediatek,mt6392-regulator.h
new file mode 100644
index 000000000000..8bd1a13faad8
--- /dev/null
+++ b/include/dt-bindings/regulator/mediatek,mt6392-regulator.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+
+#ifndef _DT_BINDINGS_REGULATOR_MEDIATEK_MT6392_H_
+#define _DT_BINDINGS_REGULATOR_MEDIATEK_MT6392_H_
+
+/*
+ * Buck mode constants which may be used in devicetree properties (eg.
+ * regulator-initial-mode, regulator-allowed-modes).
+ * See the manufacturer's datasheet for more information on these modes.
+ */
+
+#define MT6392_BUCK_MODE_AUTO 0
+#define MT6392_BUCK_MODE_FORCE_PWM 1
+
+/*
+ * LDO mode constants which may be used in devicetree properties (eg.
+ * regulator-initial-mode, regulator-allowed-modes).
+ * See the manufacturer's datasheet for more information on these modes.
+ */
+
+#define MT6392_LDO_MODE_NORMAL 0
+#define MT6392_LDO_MODE_LP 1
+
+#endif
--
2.43.0
On Wed, Mar 18, 2026 at 2:46 AM Luca Leonardo Scorcia <l.scorcia@gmail.com> wrote: > > Add bindings for the regulators found in the MediaTek MT6392 PMIC, > usually found in board designs using the MediaTek MT8516/MT8167 SoCs. > > Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com> > --- > .../regulator/mediatek,mt6392-regulator.yaml | 318 ++++++++++++++++++ > .../regulator/mediatek,mt6392-regulator.h | 24 ++ > 2 files changed, 342 insertions(+) > create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml > create mode 100644 include/dt-bindings/regulator/mediatek,mt6392-regulator.h > > diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml > new file mode 100644 > index 000000000000..fa4aad2dcbe8 > --- /dev/null > +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml > @@ -0,0 +1,318 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/regulator/mediatek,mt6392-regulator.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: MediaTek MT6392 Regulator > + > +description: > + Regulator node of the PMIC. This node should under the PMIC's device node. > + All voltage regulators provided by the PMIC are described as sub-nodes of > + this node. > + > +properties: > + compatible: > + items: > + - const: mediatek,mt6392-regulator Please add the various supply rails. This allows you to properly describe regulator dependencies and have a complete power supply tree. They can be found in the datasheet. ChenYu
Il 17/03/26 19:43, Luca Leonardo Scorcia ha scritto:
> Add bindings for the regulators found in the MediaTek MT6392 PMIC,
> usually found in board designs using the MediaTek MT8516/MT8167 SoCs.
>
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
> ---
> .../regulator/mediatek,mt6392-regulator.yaml | 318 ++++++++++++++++++
> .../regulator/mediatek,mt6392-regulator.h | 24 ++
> 2 files changed, 342 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
> create mode 100644 include/dt-bindings/regulator/mediatek,mt6392-regulator.h
>
> diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
> new file mode 100644
> index 000000000000..fa4aad2dcbe8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
> @@ -0,0 +1,318 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mediatek,mt6392-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT6392 Regulator
> +
> +description:
> + Regulator node of the PMIC. This node should under the PMIC's device node.
> + All voltage regulators provided by the PMIC are described as sub-nodes of
> + this node.
> +
> +properties:
> + compatible:
> + items:
> + - const: mediatek,mt6392-regulator
> +
> +patternProperties:
> + "^(buck_)?v(core|proc|sys)$":
> + description: Buck regulators
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes:
> + description: |
> + BUCK regulators can set regulator-initial-mode and regulator-allowed-modes to
> + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
> + items:
> + enum: [0, 1]
> + unevaluatedProperties: false
> +
> + "^(ldo_)?v(adc18|camio|cn18|io18)$":
There was a discussion a bit of time ago and we decided to drop the "ldo_" and
"buck_" prefix from the regulators.
Can you please drop those?
Cheers,
Angelo
> + description: LDOs with fixed 1.8V output
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes:
> + description: |
> + LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
> + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
> + items:
> + enum: [0, 1]
> + unevaluatedProperties: false
> +
> + "^(ldo_)?v(xo22)$":
> + description: LDOs with fixed 2.2V output
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes:
> + description: |
> + LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
> + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
> + items:
> + enum: [0, 1]
> + unevaluatedProperties: false
> +
> + "^(ldo_)?v(m25)$":
> + description: LDOs with fixed 2.5V output
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes:
> + description: |
> + LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
> + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
> + items:
> + enum: [0, 1]
> + unevaluatedProperties: false
> +
> + "^(ldo_)?v(aud28|io28)$":
> + description: LDOs with fixed 2.8V output w/ mode
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes:
> + description: |
> + LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
> + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
> + items:
> + enum: [0, 1]
> + unevaluatedProperties: false
> +
> + "^(ldo_)?v(cama)$":
> + description: LDOs with fixed 2.8V output w/o mode
> + type: object
> + $ref: regulator.yaml#
> + unevaluatedProperties: false
> +
> + "^(ldo_)?vusb$":
> + description: LDOs with fixed 3.3V output
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes:
> + description: |
> + LDO regulators can set regulator-initial-mode and regulator-allowed-modes to
> + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h
> + items:
> + enum: [0, 1]
> + unevaluatedProperties: false
> +
> + "^(ldo_)?v(aud22|camaf|camd|cn35|efuse|emc3v3|gp1|gp2|m|mc|mch)$":
> + description: LDOs with variable output
> + type: object
> + $ref: regulator.yaml#
> + properties:
> + regulator-allowed-modes: false
> + unevaluatedProperties: false
> +
> +required:
> + - compatible
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + mt6392_regulators: regulators {
> + compatible = "mediatek,mt6392-regulator";
> +
> + mt6392_vproc_reg: buck_vproc {
> + regulator-name = "vproc";
> + regulator-min-microvolt = <700000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-ramp-delay = <12500>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vsys_reg: buck_vsys {
> + regulator-name = "vsys";
> + regulator-min-microvolt = <1400000>;
> + regulator-max-microvolt = <2987500>;
> + regulator-ramp-delay = <25000>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcore_reg: buck_vcore {
> + regulator-name = "vcore";
> + regulator-min-microvolt = <700000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-ramp-delay = <12500>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vxo22_reg: ldo_vxo22 {
> + regulator-name = "vxo22";
> + regulator-min-microvolt = <2200000>;
> + regulator-max-microvolt = <2200000>;
> + regulator-enable-ramp-delay = <110>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vaud22_reg: ldo_vaud22 {
> + regulator-name = "vaud22";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2200000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcama_reg: ldo_vcama {
> + regulator-name = "vcama";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vaud28_reg: ldo_vaud28 {
> + regulator-name = "vaud28";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vadc18_reg: ldo_vadc18 {
> + regulator-name = "vadc18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcn35_reg: ldo_vcn35 {
> + regulator-name = "vcn35";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3600000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vio28_reg: ldo_vio28 {
> + regulator-name = "vio28";
> + regulator-always-on;
> + regulator-boot-on;
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vusb_reg: ldo_vusb {
> + regulator-name = "vusb";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vmc_reg: ldo_vmc {
> + regulator-name = "vmc";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vmch_reg: ldo_vmch {
> + regulator-name = "vmch";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vemc3v3_reg: ldo_vemc3v3 {
> + regulator-name = "vemc3v3";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vgp1_reg: ldo_vgp1 {
> + regulator-name = "vgp1";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vgp2_reg: ldo_vgp2 {
> + regulator-name = "vgp2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcn18_reg: ldo_vcn18 {
> + regulator-name = "vcn18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcamaf_reg: ldo_vcamaf {
> + regulator-name = "vcamaf";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vm_reg: ldo_vm {
> + regulator-name = "vm";
> + regulator-min-microvolt = <1240000>;
> + regulator-max-microvolt = <1390000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vio18_reg: ldo_vio18 {
> + regulator-name = "vio18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcamd_reg: ldo_vcamd {
> + regulator-name = "vcamd";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcamio_reg: ldo_vcamio {
> + regulator-name = "vcamio";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vm25_reg: ldo_vm25 {
> + regulator-name = "vm25";
> + regulator-min-microvolt = <2500000>;
> + regulator-max-microvolt = <2500000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vefuse_reg: ldo_vefuse {
> + regulator-name = "vefuse";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2000000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> + };
> diff --git a/include/dt-bindings/regulator/mediatek,mt6392-regulator.h b/include/dt-bindings/regulator/mediatek,mt6392-regulator.h
> new file mode 100644
> index 000000000000..8bd1a13faad8
> --- /dev/null
> +++ b/include/dt-bindings/regulator/mediatek,mt6392-regulator.h
> @@ -0,0 +1,24 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +
> +#ifndef _DT_BINDINGS_REGULATOR_MEDIATEK_MT6392_H_
> +#define _DT_BINDINGS_REGULATOR_MEDIATEK_MT6392_H_
> +
> +/*
> + * Buck mode constants which may be used in devicetree properties (eg.
> + * regulator-initial-mode, regulator-allowed-modes).
> + * See the manufacturer's datasheet for more information on these modes.
> + */
> +
> +#define MT6392_BUCK_MODE_AUTO 0
> +#define MT6392_BUCK_MODE_FORCE_PWM 1
> +
> +/*
> + * LDO mode constants which may be used in devicetree properties (eg.
> + * regulator-initial-mode, regulator-allowed-modes).
> + * See the manufacturer's datasheet for more information on these modes.
> + */
> +
> +#define MT6392_LDO_MODE_NORMAL 0
> +#define MT6392_LDO_MODE_LP 1
> +
> +#endif
On Tue, Mar 17, 2026 at 06:43:06PM +0000, Luca Leonardo Scorcia wrote: > Add bindings for the regulators found in the MediaTek MT6392 PMIC, > usually found in board designs using the MediaTek MT8516/MT8167 SoCs. Please use subject prefixes matching the subsystem. You can get them for example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory your patch is touching. For bindings, the preferred subjects are explained here: https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters You already received this feedback from Mark. > > Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com> > --- > .../regulator/mediatek,mt6392-regulator.yaml | 318 ++++++++++++++++++ > .../regulator/mediatek,mt6392-regulator.h | 24 ++ > 2 files changed, 342 insertions(+) > create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml > create mode 100644 include/dt-bindings/regulator/mediatek,mt6392-regulator.h > > diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml > new file mode 100644 > index 000000000000..fa4aad2dcbe8 > --- /dev/null > +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml > @@ -0,0 +1,318 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/regulator/mediatek,mt6392-regulator.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: MediaTek MT6392 Regulator > + > +description: > + Regulator node of the PMIC. This node should under the PMIC's device node. > + All voltage regulators provided by the PMIC are described as sub-nodes of > + this node. > + > +properties: > + compatible: > + items: > + - const: mediatek,mt6392-regulator Drop compatible. Regulator nodes do not have compatibles. With this, you can also drop example as it won't be used. > + > +patternProperties: > + "^(buck_)?v(core|proc|sys)$": Nope, underscores are not allowed. Use only hyphens. > + description: Buck regulators > + type: object > + $ref: regulator.yaml# > + properties: > + regulator-allowed-modes: > + description: | > + BUCK regulators can set regulator-initial-mode and regulator-allowed-modes to > + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h > + items: > + enum: [0, 1] > + unevaluatedProperties: false > + > + "^(ldo_)?v(adc18|camio|cn18|io18)$": > + description: LDOs with fixed 1.8V output If fixed, then encode it in the schema - min/max microvolt. > + type: object > + $ref: regulator.yaml# > + properties: > + regulator-allowed-modes: > + description: | > + LDO regulators can set regulator-initial-mode and regulator-allowed-modes to > + values specified in dt-bindings/regulator/mediatek,mt6392-regulator.h > + items: > + enum: [0, 1] > + unevaluatedProperties: false Best regards, Krzysztof
Il giorno mer 18 mar 2026 alle ore 08:43 Krzysztof Kozlowski <krzk@kernel.org> ha scritto: > Please use subject prefixes matching the subsystem. You can get them for > example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory > your patch is touching. For bindings, the preferred subjects are > explained here: > https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters > > You already received this feedback from Mark. I am sorry I missed these. I will revise all of them in the next version. > > +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml [...] > > +properties: > > + compatible: > > + items: > > + - const: mediatek,mt6392-regulator > > Drop compatible. Regulator nodes do not have compatibles. Thanks for this comment. It took me a while to understand what you meant as most of the MediaTek PMIC regulator drivers still require the compatible node to probe, including MT6397 that was the template for this patch. I compared the driver to MT6359 that does not use it and I am now working on the driver to not rely on it. > With this, you can also drop example as it won't be used. Just to be sure - do you mean remove the compatible attribute from the example, or the whole example section? > > + > > +patternProperties: > > + "^(buck_)?v(core|proc|sys)$": > > Nope, underscores are not allowed. Use only hyphens. Got it. I will actually completely remove the (buck_|ldo_) prefix altogether as suggested in another comment. > > + "^(ldo_)?v(adc18|camio|cn18|io18)$": > > + description: LDOs with fixed 1.8V output > > If fixed, then encode it in the schema - min/max microvolt. If possible I'd like some clarification here. According to Chen-Yu Tsai comment [1], dtsi shouldn't contain voltage constraints. The way I understood this is that electrical constraints are a matter of the actual board layout, so if adjustments are needed they have to be in the board dts. But you also specify "If fixed", so maybe there's an exception to this rule when the constraint is "absolute" and boards can't actually set a different value? [1] https://lore.kernel.org/linux-mediatek/28102417-4a2a-4e29-afbd-d0f2aa76074b@collabora.com/T/#mb1473bb5515f3e5a1bb3ff20c717b387c42373ef Thank you for your help! -- Luca Leonardo Scorcia l.scorcia@gmail.com
On 18/03/2026 22:25, Luca Leonardo Scorcia wrote: >> >> Drop compatible. Regulator nodes do not have compatibles. > > Thanks for this comment. It took me a while to understand what you > meant as most of the MediaTek PMIC regulator drivers still require the > compatible node to probe, including MT6397 that was the template for > this patch. I compared the driver to MT6359 that does not use it and I > am now working on the driver to not rely on it. > >> With this, you can also drop example as it won't be used. > > Just to be sure - do you mean remove the compatible attribute from the > example, or the whole example section? The entire example because without the compatible it will be no-op. > >>> + >>> +patternProperties: >>> + "^(buck_)?v(core|proc|sys)$": >> >> Nope, underscores are not allowed. Use only hyphens. > > Got it. I will actually completely remove the (buck_|ldo_) prefix > altogether as suggested in another comment. > >>> + "^(ldo_)?v(adc18|camio|cn18|io18)$": >>> + description: LDOs with fixed 1.8V output >> >> If fixed, then encode it in the schema - min/max microvolt. > > If possible I'd like some clarification here. According to Chen-Yu > Tsai comment [1], dtsi shouldn't contain voltage constraints. The way That's odd, because long time in the past I heard that DTS must absolutely set min/max constraints, because these are real hardware (board) constraints for each regulator, unlike the generic and broad ones from the driver. IOW, driver has what datasheet tells. DTS has what actually should be used. Also, I did not actually require to make min/max required, just they have to be specific/constrained. > I understood this is that electrical constraints are a matter of the > actual board layout, so if adjustments are needed they have to be in > the board dts. But you also specify "If fixed", so maybe there's an > exception to this rule when the constraint is "absolute" and boards > can't actually set a different value? Now I am confused. You wrote - LDOs with fixed 1.8V output - so board cannot set it to 2.0V for example. They are affixed. This regulator CANNOT physically produce anything else. At least this is the meaning of the text you wrote. Best regards, Krzysztof
On Thu, Mar 19, 2026 at 6:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 18/03/2026 22:25, Luca Leonardo Scorcia wrote: > >> > >> Drop compatible. Regulator nodes do not have compatibles. > > > > Thanks for this comment. It took me a while to understand what you > > meant as most of the MediaTek PMIC regulator drivers still require the > > compatible node to probe, including MT6397 that was the template for > > this patch. I compared the driver to MT6359 that does not use it and I > > am now working on the driver to not rely on it. > > > >> With this, you can also drop example as it won't be used. > > > > Just to be sure - do you mean remove the compatible attribute from the > > example, or the whole example section? > > The entire example because without the compatible it will be no-op. > > > > >>> + > >>> +patternProperties: > >>> + "^(buck_)?v(core|proc|sys)$": > >> > >> Nope, underscores are not allowed. Use only hyphens. > > > > Got it. I will actually completely remove the (buck_|ldo_) prefix > > altogether as suggested in another comment. > > > >>> + "^(ldo_)?v(adc18|camio|cn18|io18)$": > >>> + description: LDOs with fixed 1.8V output > >> > >> If fixed, then encode it in the schema - min/max microvolt. > > > > If possible I'd like some clarification here. According to Chen-Yu > > Tsai comment [1], dtsi shouldn't contain voltage constraints. The way > > That's odd, because long time in the past I heard that DTS must > absolutely set min/max constraints, because these are real hardware > (board) constraints for each regulator, unlike the generic and broad > ones from the driver. > > IOW, driver has what datasheet tells. DTS has what actually should be used. > > Also, I did not actually require to make min/max required, just they > have to be specific/constrained. > > > I understood this is that electrical constraints are a matter of the > > actual board layout, so if adjustments are needed they have to be in > > the board dts. But you also specify "If fixed", so maybe there's an > > exception to this rule when the constraint is "absolute" and boards > > can't actually set a different value? > > Now I am confused. You wrote - LDOs with fixed 1.8V output - so board > cannot set it to 2.0V for example. They are affixed. This regulator > CANNOT physically produce anything else. As you said, it cannot physically produce anything else. IMO it doesn't even need voltage constraints as it is already implied by the model and regulator output, in which case I would actually recommend rejecting min/max voltage being added to this node. ChenYu
On 19/03/2026 05:53, Chen-Yu Tsai wrote: >>> I understood this is that electrical constraints are a matter of the >>> actual board layout, so if adjustments are needed they have to be in >>> the board dts. But you also specify "If fixed", so maybe there's an >>> exception to this rule when the constraint is "absolute" and boards >>> can't actually set a different value? >> >> Now I am confused. You wrote - LDOs with fixed 1.8V output - so board >> cannot set it to 2.0V for example. They are affixed. This regulator >> CANNOT physically produce anything else. > > As you said, it cannot physically produce anything else. IMO it doesn't > even need voltage constraints as it is already implied by the model and > regulator output, in which case I would actually recommend rejecting > min/max voltage being added to this node. But the text is not helping and not doing much good here. So either this should be schema or nothing. I agree though that having here no constraints in final DTS is valid. Best regards, Krzysztof
© 2016 - 2026 Red Hat, Inc.