Skip to contentSkip to conversation

regulator: dt-bindings: mt6323: Convert to DT schema

PATCH Superseded Macpaul Lin 4 participants 20 messages Aug 30, 2024 – Sep 13, 2024

Subsystems (11)

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Macpaul Lin

author maintainer
#0 lore raw

PATCH v2 1/7 regulator: dt-bindings: mt6323: Convert to DT schema

Convert this from the old style text based binding to the new DT schema style.

The examples have been trimmed down and move to parent schema mfd/mediatek,mt6397.yaml.

Add new maintainers and submitter from MediaTek.

---
 .../regulator/mediatek,mt6323-regulator.yaml  |  84 +++++++
 .../bindings/regulator/mt6323-regulator.txt   | 237 ------------------
 2 files changed, 84 insertions(+), 237 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/mt6323-regulator.txt

Changes for v1 and v2:
- This is the first version of converting mt6323-regulator. This is because converting mt6323-regulator together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of single patch for each skydives.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml new file +84 -0
new file mode 100644
index 0000000..f7c2a03
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mediatek,mt6323-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6323 Regulator
+
+maintainers:
+  - John Crispin <[email protected]>
+  - Sen Chu <[email protected]>
+  - Macpaul Lin <[email protected]>
+
+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,mt6323-regulator
+
+patternProperties:
+  "^(buck_)?v(pa|proc|sys)$":
+    description: Buck regulators
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v(camio|cn18)$":
+    description: LDO with fixed 1.8V output and 0~100/10mV tuning
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v((io|rf)18)$":
+    description: LDOs with fixed 1.825V output and 0~100/10mV tuning
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v(a|rtc|tcxo|(cn|io)28)$":
+    description: LDOs with fixed 2.8V output and 0~100/10mV tuning
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?vusb$":
+    description: LDOs with fixed 3.3V output and 0~100/10mV tuning
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v(cn33_(bt|wifi))$":
+    description: LDOs with variable 3.3V output and 0~100/10mV tuning
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v(cama|camaf|camd|emc3v3|gp[123]|ibr|m|mc|mch|sim[12])$":
+    description: LDOs with variable output and 0~100/10mV tuning
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+required:
+  - compatible
+
+additionalProperties: false
Documentation/devicetree/bindings/regulator/mt6323-regulator.txt deleted +0 -237

237 lines not on this page · raw message

Signature · 1 line
2.45.2
author maintainer
#1 lore raw

PATCH v2 2/7 dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format

Convert the mfd: mediatek: mt6397 binding to DT schema format.

MT6323/MT6358/MT6397 are PMIC devices with multiple function of subdevices. They have some variant of the combinations of subdevices but share a common PMIC design.

New updates in this conversion:
- RTC:
- Convert rtc-mt6397.txt and add it into parent's mt6397 PMIC DT schema.
- regulators:
- Align generic names "regulators" instead of origin names.
- mt6323-regulator: Replace "txt" reference with mt6323-regulaotr.yaml
- mt6358-regulator: Replace "txt" reference with mt6358-regulator.yaml
- mt6397-regulator: Replace "txt" reference with mt6397-reuglator.yaml
- audio-codec:
- Align generic name "audio-codec" for codec and sound subdevices.
- Add "mediatek,dmic-mode" and "Avdd-supply".
- clocks:
- Align generic name "clocks" for clockbuffer subdevices.
- leds:
- Convert leds-mt6323.txt and add it into parent's mt6397 PMIC DT schema.
- keys:
- Add more specific descriptions for power and home keys.
- Add compatible: mediatek,mt6358-keys
- power-controller:
- Add property #power-domain-cells for fixing dt-binding check error.
- Add "Baseband power up" as the explaination of abbrevitation "BBPU".
- pinctrl:
- Align generic name "pinctrl" instead of "pin-controller".

---
 .../bindings/mfd/mediatek,mt6397.yaml         | 1026 +++++++++++++++++
 .../devicetree/bindings/mfd/mt6397.txt        |  110 --
 2 files changed, 1026 insertions(+), 110 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/mt6397.txt

Changes for v1:
- This patch depends on conversion of mediatek,mt6397-regulator.yaml
[1] https://lore.kernel.org/lkml/[email protected]/T/

Changes for v2:
- This patch has been made base on linux-next/master git repo.
- Keep the parent and child relationship with mediatek,pwrap in description.
[2] https://lore.kernel.org/all/20240826-slurp-earphone-0d5173923ae8@spud/
- Keep the $ref for regulators since dt_binding_check didn't report any issue based on linux-next/master repo.
- Fix description of mt6397/mt6323 devices, use "power management chip" instead of "multifunction device"
- Drop unnecessary comments or description according to the review.
- Convert sub-modules to DT Schema:
- RTC, LEDs, power-controllers, regulators
- Drop duplicate sub node name and description for sub-modules
- RTC, Keys
- examples:
- drop parent pwrap node
- Add examples from mediatek,mt6323-regulator.yaml
- Add examples from mediatek,mt6358-regulator.yaml
- Add examples from mediatek,mt6397-regulator.yaml
- Complete the examples as could as possible.

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +1026 -0
new file mode 100644
index 0000000..f5bea33
@@ -0,0 +1,1026 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6397/MT6323 Multifunction Device (PMIC)
+
+maintainers:
+  - Sen Chu <[email protected]>
+  - Macpaul Lin <[email protected]>
+
+description: |
+  MT6397/MT6323 is a power management system chip.
+  Please see the sub-modules below for supported features.
+
+  MT6397/MT6323 is a multifunction device with the following sub modules:
+  - Regulators
+  - RTC
+  - Audio codec
+  - GPIO
+  - Clock
+  - LED
+  - Keys
+  - Power controller
+
+  It is interfaced to host controller using SPI interface by a proprietary hardware
+  called PMIC wrapper or pwrap. MT6397/MT6323 PMIC is a child device of pwrap.
+  See the following for pwrap node definitions:
+  Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - mediatek,mt6323
+          - mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
+          - mediatek,mt6357
+          - mediatek,mt6358
+          - mediatek,mt6359
+          - mediatek,mt6397
+      - items:
+          - enum:
+              - mediatek,mt6366
+          - const: mediatek,mt6358
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  rtc:
+    type: object
+    $ref: /schemas/rtc/rtc.yaml#
+    unevaluatedProperties: false
+    description:
+      MT6397 Real Time Clock.
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-rtc
+              - mediatek,mt6331-rtc
+              - mediatek,mt6358-rtc
+              - mediatek,mt6397-rtc
+          - items:
+              - enum:
+                  - mediatek,mt6366-rtc
+              - const: mediatek,mt6358-rtc
+      start-year: true
+    required:
+      - compatible
+
+  regulators:
+    type: object
+    oneOf:
+      - $ref: /schemas/regulator/mediatek,mt6323-regulator.yaml
+      - $ref: /schemas/regulator/mediatek,mt6358-regulator.yaml
+      - $ref: /schemas/regulator/mediatek,mt6397-regulator.yaml
+    unevaluatedProperties: false
+    description:
+      List of child nodes that specify the regulators.
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-regulator
+              - mediatek,mt6358-regulator
+              - mediatek,mt6397-regulator
+          - items:
+              - enum:
+                  - mediatek,mt6366-regulator
+              - const: mediatek,mt6358-regulator
+
+  audio-codec:
+    type: object
+    additionalProperties: false
+    description:
+      Audio codec support with MT6397 and MT6358.
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6397-codec
+              - mediatek,mt6358-sound
+          - items:
+              - enum:
+                  - mediatek,mt6366-sound
+              - const: mediatek,mt6358-sound
+
+      mediatek,dmic-mode:
+        description: |
+          Indicates how many data pins are used to transmit two channels of PDM
+          signal.
+          0 - two wires;
+          1 - one wire;
+          Default value is 0.
+        enum: [0, 1]
+        default: 0
+
+      Avdd-supply:
+        description: Power source of AVDD.
+
+    required:
+      - compatible
+
+  clocks:
+    type: object
+    additionalProperties: false
+    description:
+      This is a clock buffer node for mt6397. However, there are no sub nodes
+      or any public document exposed in public.
+    properties:
+      compatible:
+        const: mediatek,mt6397-clk
+      '#clock-cells':
+        const: 1
+    required:
+      - compatible
+
+  leds:
+    type: object
+    additionalProperties: false
+    description:
+      MT6323 LED controller is subfunction provided by MT6323 PMIC, so the LED
+      controllers are defined as the subnode of the function node provided by MT6323
+      PMIC controller that is being defined as one kind of Muti-Function Device (MFD)
+      using shared bus called PMIC wrapper for each subfunction to access remote
+      MT6323 PMIC hardware.
+
+      Each led is represented as a child node of the mediatek,mt6323-led that
+      describes the initial behavior for each LED physically and currently only four
+      LED child nodes can be supported.
+
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-led
+              - mediatek,mt6331-led
+              - mediatek,mt6332-led
+      "#address-cells":
+        const: 1
+      "#size-cells":
+        const: 0
+      reg:
+        description:
+          LED channel number (0..3)
+        minimum: 0
+        maximum: 3
+
+  keys:
+    type: object
+    $ref: /schemas/input/mediatek,pmic-keys.yaml
+    unevaluatedProperties: false
+    description:
+      Power and Home keys.
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-keys
+              - mediatek,mt6331-keys
+              - mediatek,mt6358-keys
+              - mediatek,mt6397-keys
+
+  power-controller:
+    type: object
+    additionalProperties: false
+    description:
+      The power controller which could be found on PMIC is responsible for
+      externally powering off or on the remote MediaTek SoC through the
+      circuit BBPU (baseband power up).
+    properties:
+      compatible:
+        const: mediatek,mt6323-pwrc
+      '#power-domain-cells':
+        const: 0
+
+  pinctrl:
+    type: object
+    $ref: /schemas/pinctrl/mediatek,mt65xx-pinctrl.yaml
+    unevaluatedProperties: false
+    description:
+      Pin controller
+    properties:
+      compatible:
+        const: mediatek,mt6397-pinctrl
+
+required:
+  - compatible
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    mt6323_pmic: pmic {
+        compatible = "mediatek,mt6323";
+        interrupt-parent = <&pio>;
+        interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        mt6323_leds: leds {
+                compatible = "mediatek,mt6323-led";
+                #address-cells = <1>;
+                status = "disabled";
+        };
+
+        mt6323_regulator: regulators {
+            compatible = "mediatek,mt6323-regulator";
+            mt6323_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;
+            };
+
+            mt6323_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;
+            };
+
+            mt6323_vpa_reg: buck_vpa {
+                regulator-name = "vpa";
+                regulator-min-microvolt = < 500000>;
+                regulator-max-microvolt = <3650000>;
+            };
+
+            mt6323_vtcxo_reg: ldo_vtcxo {
+                regulator-name = "vtcxo";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <90>;
+                regulator-always-on;
+                regulator-boot-on;
+            };
+
+            mt6323_vcn28_reg: ldo_vcn28 {
+                regulator-name = "vcn28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <185>;
+            };
+
+            mt6323_vcn33_bt_reg: ldo_vcn33_bt {
+                regulator-name = "vcn33_bt";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3600000>;
+                regulator-enable-ramp-delay = <185>;
+            };
+
+            mt6323_vcn33_wifi_reg: ldo_vcn33_wifi {
+                regulator-name = "vcn33_wifi";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3600000>;
+                regulator-enable-ramp-delay = <185>;
+            };
+
+            mt6323_va_reg: ldo_va {
+                regulator-name = "va";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <216>;
+                regulator-always-on;
+                regulator-boot-on;
+            };
+
+            mt6323_vcama_reg: ldo_vcama {
+                regulator-name = "vcama";
+                regulator-min-microvolt = <1500000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vio28_reg: ldo_vio28 {
+                regulator-name = "vio28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <216>;
+                regulator-always-on;
+                regulator-boot-on;
+            };
+
+            mt6323_vusb_reg: ldo_vusb {
+                regulator-name = "vusb";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <216>;
+                regulator-boot-on;
+            };
+
+            mt6323_vmc_reg: ldo_vmc {
+                regulator-name = "vmc";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <36>;
+                regulator-boot-on;
+            };
+
+            mt6323_vmch_reg: ldo_vmch {
+                regulator-name = "vmch";
+                regulator-min-microvolt = <3000000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <36>;
+                regulator-boot-on;
+            };
+
+            mt6323_vemc3v3_reg: ldo_vemc3v3 {
+                regulator-name = "vemc3v3";
+                regulator-min-microvolt = <3000000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <36>;
+                regulator-boot-on;
+            };
+
+            mt6323_vgp1_reg: ldo_vgp1 {
+                regulator-name = "vgp1";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vgp2_reg: ldo_vgp2 {
+                regulator-name = "vgp2";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vgp3_reg: ldo_vgp3 {
+                regulator-name = "vgp3";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vcn18_reg: ldo_vcn18 {
+                regulator-name = "vcn18";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vsim1_reg: ldo_vsim1 {
+                regulator-name = "vsim1";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vsim2_reg: ldo_vsim2 {
+                regulator-name = "vsim2";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vrtc_reg: ldo_vrtc {
+                regulator-name = "vrtc";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-always-on;
+                regulator-boot-on;
+            };
+
+            mt6323_vcamaf_reg: ldo_vcamaf {
+                regulator-name = "vcamaf";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vibr_reg: ldo_vibr {
+                regulator-name = "vibr";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <36>;
+            };
+
+            mt6323_vrf18_reg: ldo_vrf18 {
+                regulator-name = "vrf18";
+                regulator-min-microvolt = <1825000>;
+                regulator-max-microvolt = <1825000>;
+                regulator-enable-ramp-delay = <187>;
+            };
+
+            mt6323_vm_reg: ldo_vm {
+                regulator-name = "vm";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <216>;
+                regulator-always-on;
+                regulator-boot-on;
+            };
+
+            mt6323_vio18_reg: ldo_vio18 {
+                regulator-name = "vio18";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <216>;
+                regulator-always-on;
+                regulator-boot-on;
+            };
+
+            mt6323_vcamd_reg: ldo_vcamd {
+                regulator-name = "vcamd";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+
+            mt6323_vcamio_reg: ldo_vcamio {
+                regulator-name = "vcamio";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <216>;
+            };
+        };
+
+        mt6323_keys: keys {
+                compatible = "mediatek,mt6323-keys";
+                mediatek,long-press-mode = <1>;
+                power-off-time-sec = <0>;
+
+                power {
+                        linux,keycodes = <116>;
+                        wakeup-source;
+                };
+
+                home {
+                        linux,keycodes = <114>;
+                };
+        };
+
+        power-controller {
+            compatible = "mediatek,mt6323-pwrc";
+            #power-domain-cells = <0>;
+        };
+
+        rtc {
+            compatible = "mediatek,mt6323-rtc";
+        };
+    };
+
+  - |
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    mt6358_pmic: pmic {
+        compatible = "mediatek,mt6358";
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        mt6358_codec: audio-codec {
+            compatible = "mediatek,mt6358-sound";
+            Avdd-supply = <&mt6358_vaud28_reg>;
+            mediatek,dmic-mode = <0>;
+        };
+
+        mt6358_regulator: regulators {
+            compatible = "mediatek,mt6358-regulator";
+
+            mt6358_vdram1_reg: buck_vdram1 {
+                regulator-name = "vdram1";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <2087500>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <0>;
+                regulator-always-on;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vcore_reg: buck_vcore {
+                regulator-name = "vcore";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <200>;
+                regulator-always-on;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vpa_reg: buck_vpa {
+                regulator-name = "vpa";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <3650000>;
+                regulator-ramp-delay = <50000>;
+                regulator-enable-ramp-delay = <250>;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vproc11_reg: buck_vproc11 {
+                regulator-name = "vproc11";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <200>;
+                regulator-always-on;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vproc12_reg: buck_vproc12 {
+                regulator-name = "vproc12";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <200>;
+                regulator-always-on;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vgpu_reg: buck_vgpu {
+                regulator-name = "vgpu";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <200>;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vs2_reg: buck_vs2 {
+                regulator-name = "vs2";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <2087500>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <0>;
+                regulator-always-on;
+            };
+
+            mt6358_vmodem_reg: buck_vmodem {
+                regulator-name = "vmodem";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <900>;
+                regulator-always-on;
+                regulator-allowed-modes = <0 1>;
+            };
+
+            mt6358_vs1_reg: buck_vs1 {
+                regulator-name = "vs1";
+                regulator-min-microvolt = <1000000>;
+                regulator-max-microvolt = <2587500>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <0>;
+                regulator-always-on;
+            };
+
+            mt6358_vdram2_reg: ldo_vdram2 {
+                regulator-name = "vdram2";
+                regulator-min-microvolt = <600000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <3300>;
+            };
+
+            mt6358_vsim1_reg: ldo_vsim1 {
+                regulator-name = "vsim1";
+                regulator-min-microvolt = <1700000>;
+                regulator-max-microvolt = <3100000>;
+                regulator-enable-ramp-delay = <540>;
+            };
+
+            mt6358_vibr_reg: ldo_vibr {
+                regulator-name = "vibr";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <60>;
+            };
+
+            mt6358_vrf12_reg: ldo_vrf12 {
+                regulator-name = "vrf12";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <1200000>;
+                regulator-enable-ramp-delay = <120>;
+            };
+
+            mt6358_vio18_reg: ldo_vio18 {
+                regulator-name = "vio18";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <2700>;
+                regulator-always-on;
+            };
+
+            mt6358_vusb_reg: ldo_vusb {
+                regulator-name = "vusb";
+                regulator-min-microvolt = <3000000>;
+                regulator-max-microvolt = <3100000>;
+                regulator-enable-ramp-delay = <270>;
+                regulator-always-on;
+            };
+
+            mt6358_vcamio_reg: ldo_vcamio {
+                regulator-name = "vcamio";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <325>;
+            };
+
+            mt6358_vcamd_reg: ldo_vcamd {
+                regulator-name = "vcamd";
+                regulator-min-microvolt = <900000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <325>;
+            };
+
+            mt6358_vcn18_reg: ldo_vcn18 {
+                regulator-name = "vcn18";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vfe28_reg: ldo_vfe28 {
+                regulator-name = "vfe28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vsram_proc11_reg: ldo_vsram_proc11 {
+                regulator-name = "vsram_proc11";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <240>;
+                regulator-always-on;
+            };
+
+            mt6358_vcn28_reg: ldo_vcn28 {
+                regulator-name = "vcn28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vsram_others_reg: ldo_vsram_others {
+                regulator-name = "vsram_others";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <240>;
+                regulator-always-on;
+            };
+
+            mt6358_vsram_gpu_reg: ldo_vsram_gpu {
+                regulator-name = "vsram_gpu";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <240>;
+            };
+
+            mt6358_vxo22_reg: ldo_vxo22 {
+                regulator-name = "vxo22";
+                regulator-min-microvolt = <2200000>;
+                regulator-max-microvolt = <2200000>;
+                regulator-enable-ramp-delay = <120>;
+                regulator-always-on;
+            };
+
+            mt6358_vefuse_reg: ldo_vefuse {
+                regulator-name = "vefuse";
+                regulator-min-microvolt = <1700000>;
+                regulator-max-microvolt = <1900000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vaux18_reg: ldo_vaux18 {
+                regulator-name = "vaux18";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vmch_reg: ldo_vmch {
+                regulator-name = "vmch";
+                regulator-min-microvolt = <2900000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <60>;
+            };
+
+            mt6358_vbif28_reg: ldo_vbif28 {
+                regulator-name = "vbif28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vsram_proc12_reg: ldo_vsram_proc12 {
+                regulator-name = "vsram_proc12";
+                regulator-min-microvolt = <500000>;
+                regulator-max-microvolt = <1293750>;
+                regulator-ramp-delay = <6250>;
+                regulator-enable-ramp-delay = <240>;
+                regulator-always-on;
+            };
+
+            mt6358_vcama1_reg: ldo_vcama1 {
+                regulator-name = "vcama1";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <325>;
+            };
+
+            mt6358_vemc_reg: ldo_vemc {
+                regulator-name = "vemc";
+                regulator-min-microvolt = <2900000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <60>;
+            };
+
+            mt6358_vio28_reg: ldo_vio28 {
+                regulator-name = "vio28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_va12_reg: ldo_va12 {
+                regulator-name = "va12";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <1200000>;
+                regulator-enable-ramp-delay = <270>;
+                regulator-always-on;
+            };
+
+            mt6358_vrf18_reg: ldo_vrf18 {
+                regulator-name = "vrf18";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                regulator-enable-ramp-delay = <120>;
+            };
+
+            mt6358_vcn33_reg: ldo_vcn33 {
+                regulator-name = "vcn33";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3500000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vcama2_reg: ldo_vcama2 {
+                regulator-name = "vcama2";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <325>;
+            };
+
+            mt6358_vmc_reg: ldo_vmc {
+                regulator-name = "vmc";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <60>;
+            };
+
+            mt6358_vldo28_reg: ldo_vldo28 {
+                regulator-name = "vldo28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vaud28_reg: ldo_vaud28 {
+                regulator-name = "vaud28";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <270>;
+            };
+
+            mt6358_vsim2_reg: ldo_vsim2 {
+                regulator-name = "vsim2";
+                regulator-min-microvolt = <1700000>;
+                regulator-max-microvolt = <3100000>;
+                regulator-enable-ramp-delay = <540>;
+            };
+        };
+
+        mt6358_rtc: rtc {
+            compatible = "mediatek,mt6358-rtc";
+        };
+
+        mt6358_keys: keys {
+            compatible = "mediatek,mt6358-keys";
+            power {
+                linux,keycodes = <KEY_POWER>;
+                wakeup-source;
+            };
+            home {
+                linux,keycodes = <KEY_HOME>;
+            };
+        };
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    mt6397_pmic: pmic {
+        compatible = "mediatek,mt6397";
+        interrupt-parent = <&pio>;
+        interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        mt6397_codec: audio-codec {
+            compatible = "mediatek,mt6397-codec";
+        };
+
+        mt6397_clock: clocks {
+            compatible = "mediatek,mt6397-clk";
+            #clock-cells = <1>;
+        };
+
+        mt6397_pinctrl: pinctrl {
+            compatible = "mediatek,mt6397-pinctrl";
+            gpio-controller;
+            #gpio-cells = <2>;
+        };
+
+        mt6397_regulators: regulators {
+            compatible = "mediatek,mt6397-regulator";
+
+            mt6397_vpca15_reg: buck_vpca15 {
+                regulator-name = "vpca15";
+                regulator-min-microvolt = < 850000>;
+                regulator-max-microvolt = <1350000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <200>;
+            };
+
+            mt6397_vpca7_reg: buck_vpca7 {
+                regulator-name = "vpca7";
+                regulator-min-microvolt = < 850000>;
+                regulator-max-microvolt = <1350000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <115>;
+            };
+
+            mt6397_vsramca15_reg: buck_vsramca15 {
+                regulator-name = "vsramca15";
+                regulator-min-microvolt = < 850000>;
+                regulator-max-microvolt = <1350000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <115>;
+            };
+
+            mt6397_vsramca7_reg: buck_vsramca7 {
+                regulator-name = "vsramca7";
+                regulator-min-microvolt = < 850000>;
+                regulator-max-microvolt = <1350000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <115>;
+            };
+
+            mt6397_vcore_reg: buck_vcore {
+                regulator-name = "vcore";
+                regulator-min-microvolt = < 850000>;
+                regulator-max-microvolt = <1350000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <115>;
+            };
+
+            mt6397_vgpu_reg: buck_vgpu {
+                regulator-name = "vgpu";
+                regulator-min-microvolt = < 700000>;
+                regulator-max-microvolt = <1350000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <115>;
+            };
+
+            mt6397_vdrm_reg: buck_vdrm {
+                regulator-name = "vdrm";
+                regulator-min-microvolt = < 800000>;
+                regulator-max-microvolt = <1400000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <500>;
+            };
+
+            mt6397_vio18_reg: buck_vio18 {
+                regulator-name = "vio18";
+                regulator-min-microvolt = <1500000>;
+                regulator-max-microvolt = <2120000>;
+                regulator-ramp-delay = <12500>;
+                regulator-enable-ramp-delay = <500>;
+            };
+
+            mt6397_vtcxo_reg: ldo_vtcxo {
+                regulator-name = "vtcxo";
+                regulator-min-microvolt = <2800000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <90>;
+            };
+
+            mt6397_va28_reg: ldo_va28 {
+                regulator-name = "va28";
+                /* fixed output 2.8 V */
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vcama_reg: ldo_vcama {
+                regulator-name = "vcama";
+                regulator-min-microvolt = <1500000>;
+                regulator-max-microvolt = <2800000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vio28_reg: ldo_vio28 {
+                regulator-name = "vio28";
+                /* fixed output 2.8 V */
+                regulator-enable-ramp-delay = <240>;
+            };
+
+            mt6397_usb_reg: ldo_vusb {
+                regulator-name = "vusb";
+                /* fixed output 3.3 V */
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vmc_reg: ldo_vmc {
+                regulator-name = "vmc";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vmch_reg: ldo_vmch {
+                regulator-name = "vmch";
+                regulator-min-microvolt = <3000000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vemc_3v3_reg: ldo_vemc3v3 {
+                regulator-name = "vemc_3v3";
+                regulator-min-microvolt = <3000000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vgp1_reg: ldo_vgp1 {
+                regulator-name = "vcamd";
+                regulator-min-microvolt = <1220000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <240>;
+            };
+
+            mt6397_vgp2_reg: ldo_vgp2 {
+                regulator-name = "vcamio";
+                regulator-min-microvolt = <1000000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vgp3_reg: ldo_vgp3 {
+                regulator-name = "vcamaf";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vgp4_reg: ldo_vgp4 {
+                regulator-name = "vgp4";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vgp5_reg: ldo_vgp5 {
+                regulator-name = "vgp5";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3000000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vgp6_reg: ldo_vgp6 {
+                regulator-name = "vgp6";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+
+            mt6397_vibr_reg: ldo_vibr {
+                regulator-name = "vibr";
+                regulator-min-microvolt = <1200000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-enable-ramp-delay = <218>;
+            };
+        };
+
+        mt6397_rtc: rtc {
+            compatible = "mediatek,mt6397-rtc";
+        };
+    };
+
Documentation/devicetree/bindings/mfd/mt6397.txt deleted +0 -110

110 lines not on this page · raw message

Signature · 1 line
2.45.2
#2 lore raw

Re: [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format

Quoted 54 lines · Macpaul Lin

Convert the mfd: mediatek: mt6397 binding to DT schema format.

MT6323/MT6358/MT6397 are PMIC devices with multiple function of subdevices. They have some variant of the combinations of subdevices but share a common PMIC design.

New updates in this conversion:
- RTC:
- Convert rtc-mt6397.txt and add it into parent's mt6397 PMIC DT schema.
- regulators:
- Align generic names "regulators" instead of origin names.
- mt6323-regulator: Replace "txt" reference with mt6323-regulaotr.yaml
- mt6358-regulator: Replace "txt" reference with mt6358-regulator.yaml
- mt6397-regulator: Replace "txt" reference with mt6397-reuglator.yaml
- audio-codec:
- Align generic name "audio-codec" for codec and sound subdevices.
- Add "mediatek,dmic-mode" and "Avdd-supply".
- clocks:
- Align generic name "clocks" for clockbuffer subdevices.
- leds:
- Convert leds-mt6323.txt and add it into parent's mt6397 PMIC DT schema.
- keys:
- Add more specific descriptions for power and home keys.
- Add compatible: mediatek,mt6358-keys
- power-controller:
- Add property #power-domain-cells for fixing dt-binding check error.
- Add "Baseband power up" as the explaination of abbrevitation "BBPU".
- pinctrl:
- Align generic name "pinctrl" instead of "pin-controller".

---
 .../bindings/mfd/mediatek,mt6397.yaml         | 1026 +++++++++++++++++
 .../devicetree/bindings/mfd/mt6397.txt        |  110 --
 2 files changed, 1026 insertions(+), 110 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/mt6397.txt

Changes for v1:
- This patch depends on conversion of mediatek,mt6397-regulator.yaml
[1] https://lore.kernel.org/lkml/[email protected]/T/

Changes for v2:
- This patch has been made base on linux-next/master git repo.
- Keep the parent and child relationship with mediatek,pwrap in description.
[2] https://lore.kernel.org/all/20240826-slurp-earphone-0d5173923ae8@spud/
- Keep the $ref for regulators since dt_binding_check didn't report any issue based on linux-next/master repo.
- Fix description of mt6397/mt6323 devices, use "power management chip" instead of "multifunction device"
- Drop unnecessary comments or description according to the review.
- Convert sub-modules to DT Schema:
- RTC, LEDs, power-controllers, regulators

Quoted 9 lines

- Drop duplicate sub node name and description for sub-modules
- RTC, Keys
- examples:
- drop parent pwrap node
- Add examples from mediatek,mt6323-regulator.yaml
- Add examples from mediatek,mt6358-regulator.yaml
- Add examples from mediatek,mt6397-regulator.yaml
- Complete the examples as could as possible.

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/mediatek,mt6397.example.dtb: pmic: regulators: 'oneOf' conditional failed, one must be fixed:
'buck_vcore', 'buck_vdrm', 'buck_vgpu', 'buck_vio18', 'buck_vpca15', 'buck_vpca7', 'buck_vsramca15', 'buck_vsramca7', 'ldo_va28', 'ldo_vgp4', 'ldo_vgp5', 'ldo_vgp6' do not match any of the regexes: '^(buck_)?v(pa|proc|sys)$', '^(ldo_)?v((io|rf)18)$', '^(ldo_)?v(a|rtc|tcxo|(cn|io)28)$', '^(ldo_)?v(cama|camaf|camd|emc3v3|gp[123]|ibr|m|mc|mch|sim[12])$', '^(ldo_)?v(camio|cn18)$', '^(ldo_)?v(cn33_(bt|wifi))$', '^(ldo_)?vusb$', 'pinctrl-[0-9]+'
'buck_vdrm', 'buck_vio18', 'buck_vpca15', 'buck_vpca7', 'buck_vsramca15', 'buck_vsramca7', 'ldo_va28', 'ldo_vcama', 'ldo_vemc3v3', 'ldo_vgp1', 'ldo_vgp2', 'ldo_vgp3', 'ldo_vgp4', 'ldo_vgp5', 'ldo_vgp6', 'ldo_vtcxo' do not match any of the regexes: '^(buck_)?v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$', '^(ldo_)?v((aux|cn|io|rf)18|camio)$', '^(ldo_)?v(aud|bif|cn|fe|io)28$', '^(ldo_)?v(a|rf)12$', '^(ldo_)?v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|m18|mc|mch|mddr|sim[12])$', '^(ldo_)?vsram[_-](core|gpu|others|proc1[12])$', '^(ldo_)?vusb$', '^(ldo_)?vxo22$', 'pinctrl-[0-9]+'
False schema does not allow {'compatible': ['mediatek,mt6397-regulator'], 'buck_vpca15': {'regulator-name': ['vpca15'], 'regulator-min-microvolt': [[850000]], 'regulator-max-microvolt': [[1350000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 200}, 'buck_vpca7': {'regulator-name': ['vpca7'], 'regulator-min-microvolt': [[850000]], 'regulator-max-microvolt': [[1350000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 115}, 'buck_vsramca15': {'regulator-name': ['vsramca15'], 'regulator-min-microvolt': [[850000]], 'regulator-max-microvolt': [[1350000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 115}, 'buck_vsramca7': {'regulator-name': ['vsramca7'], 'regulator-min-microvolt': [[850000]], 'regulator-max-microvolt': [[1350000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 115}, 'buck_vcore': {'regulator-name': ['vcore'], 'regulator-min-microvolt': [[850000]], 'regulator-max-microvolt': [[1350000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 115}, 'buck_vgpu': {'regulator-name': ['vgpu'], 'regulator-min-microvolt': [[700000]], 'regulator-max-microvolt': [[1350000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 115}, 'buck_vdrm': {'regulator-name': ['vdrm'], 'regulator-min-microvolt': [[800000]], 'regulator-max-microvolt': [[1400000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 500}, 'buck_vio18': {'regulator-name': ['vio18'], 'regulator-min-microvolt': [[1500000]], 'regulator-max-microvolt': [[2120000]], 'regulator-ramp-delay': 12500, 'regulator-enable-ramp-delay': 500}, 'ldo_vtcxo': {'regulator-name': ['vtcxo'], 'regulator-min-microvolt': [[2800000]], 'regulator-max-microvolt': [[2800000]], 'regulator-enable-ramp-delay': 90}, 'ldo_va28': {'regulator-name': ['va28'], 'regulator-enable-ramp-delay': 218}, 'ldo_vcama': {'regulator-name': ['vcama'], 'regulator-min-microvolt': [[1500000]], 'regulator-max-microvolt': [[2800000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vio28': {'regulator-name': ['vio28'], 'regulator-enable-ramp-delay': 240}, 'ldo_vusb': {'regulator-name': ['vusb'], 'regulator-enable-ramp-delay': 218}, 'ldo_vmc': {'regulator-name': ['vmc'], 'regulator-min-microvolt': [[1800000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vmch': {'regulator-name': ['vmch'], 'regulator-min-microvolt': [[3000000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vemc3v3': {'regulator-name': ['vemc_3v3'], 'regulator-min-microvolt': [[3000000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vgp1': {'regulator-name': ['vcamd'], 'regulator-min-microvolt': [[1220000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 240}, 'ldo_vgp2': {'regulator-name': ['vcamio'], 'regulator-min-microvolt': [[1000000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vgp3': {'regulator-name': ['vcamaf'], 'regulator-min-microvolt': [[1200000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vgp4': {'regulator-name': ['vgp4'], 'regulator-min-microvolt': [[1200000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vgp5': {'regulator-name': ['vgp5'], 'regulator-min-microvolt': [[1200000]], 'regulator-max-microvolt': [[3000000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vgp6': {'regulator-name': ['vgp6'], 'regulator-min-microvolt': [[1200000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}, 'ldo_vibr': {'regulator-name': ['vibr'], 'regulator-min-microvolt': [[1200000]], 'regulator-max-microvolt': [[3300000]], 'regulator-enable-ramp-delay': 218}} /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/mediatek,mt6397.example.dtb: pmic: regulators:compatible: 'oneOf' conditional failed, one must be fixed:
['mediatek,mt6397-regulator'] is too short
'mediatek,mt6358-regulator' was expected
'mediatek,mt6366-regulator' was expected
'mediatek,mt6323-regulator' was expected
from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/mediatek,mt6397.example.dtb: pmic: regulators: Unevaluated properties are not allowed ('buck_vcore', 'buck_vdrm', 'buck_vgpu', 'buck_vio18', 'buck_vpca15', 'buck_vpca7', 'buck_vsramca15', 'buck_vsramca7', 'ldo_va28', 'ldo_vcama', 'ldo_vemc3v3', 'ldo_vgp1', 'ldo_vgp2', 'ldo_vgp3', 'ldo_vgp4', 'ldo_vgp5', 'ldo_vgp6', 'ldo_vibr', 'ldo_vio28', 'ldo_vmc', 'ldo_vmch', 'ldo_vtcxo', 'ldo_vusb' were unexpected)
from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

doc reference errors (make refcheckdocs):
Warning: Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/mt6397.txt
Warning: Documentation/devicetree/bindings/leds/leds-mt6323.txt references a file that doesn't exist: Documentation/devicetree/bindings/mfd/mt6397.txt Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml: Documentation/devicetree/bindings/mfd/mt6397.txt Documentation/devicetree/bindings/leds/leds-mt6323.txt: Documentation/devicetree/bindings/mfd/mt6397.txt

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

maintainer
#3 lore raw

Re: [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format

In reply to Macpaul Lin
Quoted 119 lines · Macpaul Lin

Convert the mfd: mediatek: mt6397 binding to DT schema format.

MT6323/MT6358/MT6397 are PMIC devices with multiple function of subdevices. They have some variant of the combinations of subdevices but share a common PMIC design.

New updates in this conversion:
- RTC:
- Convert rtc-mt6397.txt and add it into parent's mt6397 PMIC DT schema.
- regulators:
- Align generic names "regulators" instead of origin names.
- mt6323-regulator: Replace "txt" reference with mt6323-regulaotr.yaml
- mt6358-regulator: Replace "txt" reference with mt6358-regulator.yaml
- mt6397-regulator: Replace "txt" reference with mt6397-reuglator.yaml
- audio-codec:
- Align generic name "audio-codec" for codec and sound subdevices.
- Add "mediatek,dmic-mode" and "Avdd-supply".
- clocks:
- Align generic name "clocks" for clockbuffer subdevices.
- leds:
- Convert leds-mt6323.txt and add it into parent's mt6397 PMIC DT schema.
- keys:
- Add more specific descriptions for power and home keys.
- Add compatible: mediatek,mt6358-keys
- power-controller:
- Add property #power-domain-cells for fixing dt-binding check error.
- Add "Baseband power up" as the explaination of abbrevitation "BBPU".
- pinctrl:
- Align generic name "pinctrl" instead of "pin-controller".

---
 .../bindings/mfd/mediatek,mt6397.yaml         | 1026 +++++++++++++++++
 .../devicetree/bindings/mfd/mt6397.txt        |  110 --
 2 files changed, 1026 insertions(+), 110 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/mt6397.txt

Changes for v1:
- This patch depends on conversion of mediatek,mt6397-regulator.yaml
[1] https://lore.kernel.org/lkml/[email protected]/T/

Changes for v2:
- This patch has been made base on linux-next/master git repo.
- Keep the parent and child relationship with mediatek,pwrap in description.
[2] https://lore.kernel.org/all/20240826-slurp-earphone-0d5173923ae8@spud/
- Keep the $ref for regulators since dt_binding_check didn't report any issue based on linux-next/master repo.
- Fix description of mt6397/mt6323 devices, use "power management chip" instead of "multifunction device"
- Drop unnecessary comments or description according to the review.
- Convert sub-modules to DT Schema:
- RTC, LEDs, power-controllers, regulators
- Drop duplicate sub node name and description for sub-modules
- RTC, Keys
- examples:
- drop parent pwrap node
- Add examples from mediatek,mt6323-regulator.yaml
- Add examples from mediatek,mt6358-regulator.yaml
- Add examples from mediatek,mt6397-regulator.yaml
- Complete the examples as could as possible.

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +50 -0
new file mode 100644
index 0000000..f5bea33
@@ -0,0 +1,1026 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6397/MT6323 Multifunction Device (PMIC)
+
+maintainers:
+  - Sen Chu <[email protected]>
+  - Macpaul Lin <[email protected]>
+
+description: |
+  MT6397/MT6323 is a power management system chip.
+  Please see the sub-modules below for supported features.
+
+  MT6397/MT6323 is a multifunction device with the following sub modules:
+  - Regulators
+  - RTC
+  - Audio codec
+  - GPIO
+  - Clock
+  - LED
+  - Keys
+  - Power controller
+
+  It is interfaced to host controller using SPI interface by a proprietary hardware
+  called PMIC wrapper or pwrap. MT6397/MT6323 PMIC is a child device of pwrap.
+  See the following for pwrap node definitions:
+  Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - mediatek,mt6323
+          - mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
+          - mediatek,mt6357
+          - mediatek,mt6358
+          - mediatek,mt6359
+          - mediatek,mt6397
+      - items:
+          - enum:
+              - mediatek,mt6366
+          - const: mediatek,mt6358
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-controller: true

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 60

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+
+  "#interrupt-cells":
+    const: 2
+
+  rtc:
+    type: object
+    $ref: /schemas/rtc/rtc.yaml#
+    unevaluatedProperties: false
+    description:
+      MT6397 Real Time Clock.

Blank line

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 72

Quoted 12 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +12 -0
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-rtc
+              - mediatek,mt6331-rtc
+              - mediatek,mt6358-rtc
+              - mediatek,mt6397-rtc
+          - items:
+              - enum:
+                  - mediatek,mt6366-rtc
+              - const: mediatek,mt6358-rtc

Blank line between DT properties

Quoted 14 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +14 -0
+      start-year: true
+    required:
+      - compatible
+
+  regulators:
+    type: object
+    oneOf:
+      - $ref: /schemas/regulator/mediatek,mt6323-regulator.yaml
+      - $ref: /schemas/regulator/mediatek,mt6358-regulator.yaml
+      - $ref: /schemas/regulator/mediatek,mt6397-regulator.yaml
+    unevaluatedProperties: false
+    description:
+      List of child nodes that specify the regulators.
+    properties:

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 96

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-regulator
+              - mediatek,mt6358-regulator
+              - mediatek,mt6397-regulator
+          - items:
+              - enum:
+                  - mediatek,mt6366-regulator
+              - const: mediatek,mt6358-regulator

You need the references or compatible, but not both. It's more efficient if you list the compatibles along with a 'additionalProperties: true'. Otherwise, the referenced schemas have to all be applied and the matching one will be applied twice.

Also, for compatible here, just use 'contains' and list all possible compatibles. The exact combinations are enforced in the regulator schemas.

Quoted 41 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +41 -0
+
+  audio-codec:
+    type: object
+    additionalProperties: false
+    description:
+      Audio codec support with MT6397 and MT6358.
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6397-codec
+              - mediatek,mt6358-sound
+          - items:
+              - enum:
+                  - mediatek,mt6366-sound
+              - const: mediatek,mt6358-sound
+
+      mediatek,dmic-mode:
+        description: |
+          Indicates how many data pins are used to transmit two channels of PDM
+          signal.
+          0 - two wires;
+          1 - one wire;
+          Default value is 0.
+        enum: [0, 1]
+        default: 0
+
+      Avdd-supply:
+        description: Power source of AVDD.
+
+    required:
+      - compatible
+
+  clocks:
+    type: object
+    additionalProperties: false
+    description:
+      This is a clock buffer node for mt6397. However, there are no sub nodes
+      or any public document exposed in public.
+    properties:
+      compatible:

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 147

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+        const: mediatek,mt6397-clk
+      '#clock-cells':
+        const: 1
+    required:
+      - compatible
+
+  leds:
+    type: object
+    additionalProperties: false
+    description:

You need '|' or '>' to preserve line breaks.

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 160

Quoted 13 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +13 -0
+      MT6323 LED controller is subfunction provided by MT6323 PMIC, so the LED
+      controllers are defined as the subnode of the function node provided by MT6323
+      PMIC controller that is being defined as one kind of Muti-Function Device (MFD)
+      using shared bus called PMIC wrapper for each subfunction to access remote
+      MT6323 PMIC hardware.
+
+      Each led is represented as a child node of the mediatek,mt6323-led that
+      describes the initial behavior for each LED physically and currently only four
+      LED child nodes can be supported.
+
+    properties:
+      compatible:
+        oneOf:

Only 1 entry, don't need oneOf.

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 166

Quoted 6 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +6 -0
+          - enum:
+              - mediatek,mt6323-led
+              - mediatek,mt6331-led
+              - mediatek,mt6332-led
+      "#address-cells":
+        const: 1

blank line

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 168

Quoted 2 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +2 -0
+      "#size-cells":
+        const: 0

blank line. And so on...

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 173

Quoted 5 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +5 -0
+      reg:
+        description:
+          LED channel number (0..3)
+        minimum: 0
+        maximum: 3

Doesn't use the led binding?

Quoted 40 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +40 -0
+
+  keys:
+    type: object
+    $ref: /schemas/input/mediatek,pmic-keys.yaml
+    unevaluatedProperties: false
+    description:
+      Power and Home keys.
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-keys
+              - mediatek,mt6331-keys
+              - mediatek,mt6358-keys
+              - mediatek,mt6397-keys
+
+  power-controller:
+    type: object
+    additionalProperties: false
+    description:
+      The power controller which could be found on PMIC is responsible for
+      externally powering off or on the remote MediaTek SoC through the
+      circuit BBPU (baseband power up).
+    properties:
+      compatible:
+        const: mediatek,mt6323-pwrc
+      '#power-domain-cells':
+        const: 0
+
+  pinctrl:
+    type: object
+    $ref: /schemas/pinctrl/mediatek,mt65xx-pinctrl.yaml
+    unevaluatedProperties: false
+    description:
+      Pin controller
+    properties:
+      compatible:
+        const: mediatek,mt6397-pinctrl
+
+required:

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 223

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+  - compatible
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    mt6323_pmic: pmic {

Drop unused labels.

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 233

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+        compatible = "mediatek,mt6323";
+        interrupt-parent = <&pio>;
+        interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        mt6323_leds: leds {
+                compatible = "mediatek,mt6323-led";
+                #address-cells = <1>;
+                status = "disabled";

Examples shouldn't be disabled.

Quoted 12 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +12 -0
+        };
+
+        mt6323_regulator: regulators {
+            compatible = "mediatek,mt6323-regulator";
+            mt6323_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;
+            };
author maintainer
#4 lore raw

Re: [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format

Quoted 104 lines · Rob Herring

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 99 lines · Macpaul Lin

Convert the mfd: mediatek: mt6397 binding to DT schema format.

MT6323/MT6358/MT6397 are PMIC devices with multiple function of subdevices. They have some variant of the combinations of subdevices but share a common PMIC design.

New updates in this conversion:
- RTC:
- Convert rtc-mt6397.txt and add it into parent's mt6397 PMIC DT schema.
- regulators:
- Align generic names "regulators" instead of origin names.
- mt6323-regulator: Replace "txt" reference with mt6323-regulaotr.yaml
- mt6358-regulator: Replace "txt" reference with mt6358-regulator.yaml
- mt6397-regulator: Replace "txt" reference with mt6397-reuglator.yaml
- audio-codec:
- Align generic name "audio-codec" for codec and sound subdevices.
- Add "mediatek,dmic-mode" and "Avdd-supply".
- clocks:
- Align generic name "clocks" for clockbuffer subdevices.
- leds:
- Convert leds-mt6323.txt and add it into parent's mt6397 PMIC DT schema.
- keys:
- Add more specific descriptions for power and home keys.
- Add compatible: mediatek,mt6358-keys
- power-controller:
- Add property #power-domain-cells for fixing dt-binding check error.
- Add "Baseband power up" as the explaination of abbrevitation "BBPU".
- pinctrl:
- Align generic name "pinctrl" instead of "pin-controller".

---
 .../bindings/mfd/mediatek,mt6397.yaml         | 1026 +++++++++++++++++
 .../devicetree/bindings/mfd/mt6397.txt        |  110 --
 2 files changed, 1026 insertions(+), 110 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/mt6397.txt

Changes for v1:
- This patch depends on conversion of mediatek,mt6397-regulator.yaml
[1] https://lore.kernel.org/lkml/[email protected]/T/

Changes for v2:
- This patch has been made base on linux-next/master git repo.
- Keep the parent and child relationship with mediatek,pwrap in description.
[2] https://lore.kernel.org/all/20240826-slurp-earphone-0d5173923ae8@spud/
- Keep the $ref for regulators since dt_binding_check didn't report any issue based on linux-next/master repo.
- Fix description of mt6397/mt6323 devices, use "power management chip" instead of "multifunction device"
- Drop unnecessary comments or description according to the review.
- Convert sub-modules to DT Schema:
- RTC, LEDs, power-controllers, regulators
- Drop duplicate sub node name and description for sub-modules
- RTC, Keys
- examples:
- drop parent pwrap node
- Add examples from mediatek,mt6323-regulator.yaml
- Add examples from mediatek,mt6358-regulator.yaml
- Add examples from mediatek,mt6397-regulator.yaml
- Complete the examples as could as possible.

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +30 -0
new file mode 100644
index 0000000..f5bea33
@@ -0,0 +1,1026 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6397/MT6323 Multifunction Device (PMIC)
+
+maintainers:
+  - Sen Chu <[email protected]>
+  - Macpaul Lin <[email protected]>
+
+description: |
+  MT6397/MT6323 is a power management system chip.
+  Please see the sub-modules below for supported features.
+
+  MT6397/MT6323 is a multifunction device with the following sub modules:
+  - Regulators
+  - RTC
+  - Audio codec
+  - GPIO
+  - Clock
+  - LED
+  - Keys
+  - Power controller
+
+  It is interfaced to host controller using SPI interface by a proprietary hardware
+  called PMIC wrapper or pwrap. MT6397/MT6323 PMIC is a child device of pwrap.
+  See the following for pwrap node definitions:
+  Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml

[snip]

Quoted 8 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 60

Quoted 6 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +6 -0
+  rtc:
+    type: object
+    $ref: /schemas/rtc/rtc.yaml#
+    unevaluatedProperties: false
+    description:
+      MT6397 Real Time Clock.

Blank line

Will fix this in v3 version.

Quoted 14 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 72

Quoted 13 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +12 -0
+    properties:
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-rtc
+              - mediatek,mt6331-rtc
+              - mediatek,mt6358-rtc
+              - mediatek,mt6397-rtc
+          - items:
+              - enum:
+                  - mediatek,mt6366-rtc
+              - const: mediatek,mt6358-rtc
Quoted 1 line

Blank line between DT properties

Will fix this in v3 version.

Quoted 25 lines
Quoted 14 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +14 -0
+      start-year: true
+    required:
+      - compatible
+
+  regulators:
+    type: object
+    oneOf:
+      - $ref: /schemas/regulator/mediatek,mt6323-regulator.yaml
+      - $ref: /schemas/regulator/mediatek,mt6358-regulator.yaml
+      - $ref: /schemas/regulator/mediatek,mt6397-regulator.yaml
+    unevaluatedProperties: false
+    description:
+      List of child nodes that specify the regulators.
+    properties:

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 96

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+      compatible:
+        oneOf:
+          - enum:
+              - mediatek,mt6323-regulator
+              - mediatek,mt6358-regulator
+              - mediatek,mt6397-regulator
+          - items:
+              - enum:
+                  - mediatek,mt6366-regulator
+              - const: mediatek,mt6358-regulator
Quoted 8 lines

You need the references or compatible, but not both. It's more efficient if you list the compatibles along with a 'additionalProperties: true'. Otherwise, the referenced schemas have to all be applied and the matching one will be applied twice.

Also, for compatible here, just use 'contains' and list all possible compatibles. The exact combinations are enforced in the regulator schemas.

Both 'addtionalProperties: true' and 'contains' will be added to v3 version. Since there are different regulator nodes in these DT Schema but seems no other common nodes, $ref will be added to if..then.. match rulesfor each compatible.

[snip]

Quoted 7 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 147

Quoted 5 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +5 -0
+
+  leds:
+    type: object
+    additionalProperties: false
+    description:

You need '|' or '>' to preserve line breaks.

Will be fixed in v3 version.

Quoted 7 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 34

Quoted 4 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +4 -0
+
+    properties:
+      compatible:
+        oneOf:

Only 1 entry, don't need oneOf.

Will be fixed in v3 version.

Quoted 8 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 166

Quoted 6 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +6 -0
+          - enum:
+              - mediatek,mt6323-led
+              - mediatek,mt6331-led
+              - mediatek,mt6332-led
+      "#address-cells":
+        const: 1

blank line

Will be fixed in v3 version.

Quoted 4 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml

Quoted 2 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +2 -0
+      "#size-cells":
+        const: 0

blank line. And so on...

Will be fixed in v3 version.

Quoted 7 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 173

Quoted 5 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +5 -0
+      reg:
+        description:
+          LED channel number (0..3)
+        minimum: 0
+        maximum: 3

Doesn't use the led binding?

Will be fixed in v3 version: using led bindings.

[snip]

Quoted 10 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 223

Quoted 8 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +7 -0
+
 
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    mt6323_pmic: pmic {

Drop unused labels.

Will be fixed in v3 version.

Quoted 11 lines

Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml line 233

Quoted 10 lines
Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml new file +10 -0
+        compatible = "mediatek,mt6323";
+        interrupt-parent = <&pio>;
+        interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        mt6323_leds: leds {
+                compatible = "mediatek,mt6323-led";
+                #address-cells = <1>;
+                status = "disabled";
Quoted 1 line

Examples shouldn't be disabled.

Will be fixed in v3 version.

[snip]

Thanks for the review.

Regards,
Macpaul Lin

#5 lore raw

Re: [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format

In reply to Macpaul Lin
kernel test robot noticed the following build warnings:

Hi Macpaul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-regulator/for-next]
[also build test WARNING on lee-mfd/for-mfd-next robh/for-next lee-mfd/for-mfd-fixes linus/master v6.11-rc5 next-20240830] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Macpaul-Lin/dt-bindings-mfd-mediatek-mt6397-Convert-to-DT-schema-format/20240830-191309
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20240830110732.30080-2-macpaul.lin%40mediatek.com
patch subject: [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format
reproduce: (https://download.01.org/0day-ci/archive/20240831/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> Warning: Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/mt6397.txt

Warning: Documentation/devicetree/bindings/leds/leds-mt6323.txt references a file that doesn't exist: Documentation/devicetree/bindings/mfd/mt6397.txt
Warning: Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml references a file that doesn't exist: Documentation/devicetree/bindings/regulator/mt6323-regulator.txt
Warning: Documentation/devicetree/bindings/power/wakeup-source.txt references a file that doesn't exist: Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
Warning: Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
Warning: Documentation/hwmon/g762.rst references a file that doesn't exist: Documentation/devicetree/bindings/hwmon/g762.txt

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#6 lore raw

PATCH v2 3/7 dt-bindings: rtc: mt6397: merge to MFD mediatek,mt6397 DT schema

In reply to Macpaul Lin

Convert rtc-mt6397.txt be compatible with the DT schema. Since this is a simple RTC device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove rtc-mt6397.txt with a separate patch.

---
 .../devicetree/bindings/rtc/rtc-mt6397.txt    | 31 -------------------
 1 file changed, 31 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt6397.txt

Changes for v1 and v2:
- This is the first version of converting rtc-mt6397.txt. This is because converting rtc-mt6397 together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of submitting single patch for each subdevice.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/rtc/rtc-mt6397.txt deleted +0 -31
deleted file mode 100644
index 7212076..0000000
@@ -1,31 +0,0 @@
-Device-Tree bindings for MediaTek PMIC based RTC
-
-MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
-as a type of multi-function device (MFD). The RTC can be configured and set up
-with PMIC wrapper bus which is a common resource shared with the other
-functions found on the same PMIC.
-
-For MediaTek PMIC MFD bindings, see:
-../mfd/mt6397.txt
-
-For MediaTek PMIC wrapper bus bindings, see:
-../soc/mediatek/pwrap.txt
-
-Required properties:
-- compatible: Should be one of follows
-       "mediatek,mt6323-rtc": for MT6323 PMIC
-       "mediatek,mt6358-rtc": for MT6358 PMIC
-       "mediatek,mt6366-rtc", "mediatek,mt6358-rtc": for MT6366 PMIC
-       "mediatek,mt6397-rtc": for MT6397 PMIC
-
-Example:
-
-       pmic {
-               compatible = "mediatek,mt6323";
-
-               ...
-
-               rtc {
-                       compatible = "mediatek,mt6323-rtc";
-               };
-       };
Signature · 1 line
2.45.2
maintainer
#7 lore raw

Re: [PATCH v2 3/7] dt-bindings: rtc: mt6397: merge to MFD mediatek,mt6397 DT schema

Quoted 4 lines · Macpaul Lin

Convert rtc-mt6397.txt be compatible with the DT schema. Since this is a simple RTC device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove rtc-mt6397.txt with a separate patch.

This doesn't match what the patch does. You can just squash this into the MFD patch where you add the schema.

Quoted 6 lines
---
 .../devicetree/bindings/rtc/rtc-mt6397.txt    | 31 -------------------
 1 file changed, 31 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
author maintainer
#8 lore raw

Re: [PATCH v2 3/7] dt-bindings: rtc: mt6397: merge to MFD mediatek,mt6397 DT schema

Quoted 4 lines · Rob Herring

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 9 lines
Quoted 4 lines · Macpaul Lin

Convert rtc-mt6397.txt be compatible with the DT schema. Since this is a simple RTC device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove rtc-mt6397.txt with a separate patch.

This doesn't match what the patch does. You can just squash this into the MFD patch where you add the schema.

[snip]

Will squash the other patches for removing text format files in to the MFD patch in next (v3) version. Thanks!

Regards,
Macpaul Lin

author maintainer
#9 lore raw

PATCH v2 4/7 regulator: dt-bindings: mt6397: move examples to parent PMIC mt6397

In reply to Macpaul Lin

Since the DT schema of multiple function PMIC mt6397 has been converted, move the examples in "mediatek,mt6397-regulator.yaml" to the parent schema "mediatek,mt6397.yaml".

---
 .../regulator/mediatek,mt6397-regulator.yaml  | 173 ------------------
 1 file changed, 173 deletions(-)

Changes for v1 and v2:
- This is because reviewer suggest complete examples in parent device (MFD) as could as possible. Hence we've just move the examples to parent mfd/mediatek,mt6397.yaml. So we've create a patch set
instead of submitting single patch for each subdevice.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/regulator/mediatek,mt6397-regulator.yaml +0 -173
index 50db678..337ac58 100644
@@ -63,176 +63,3 @@ required:
 
 additionalProperties: false
 
-examples:
-  - |
-    #include <dt-bindings/interrupt-controller/arm-gic.h>
-
-    mt6397_regulators: regulators {
-        compatible = "mediatek,mt6397-regulator";
-
-        mt6397_vpca15_reg: buck_vpca15 {
-            regulator-name = "vpca15";
-            regulator-min-microvolt = < 850000>;
-            regulator-max-microvolt = <1350000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <200>;
-        };
-
-        mt6397_vpca7_reg: buck_vpca7 {
-            regulator-name = "vpca7";
-            regulator-min-microvolt = < 850000>;
-            regulator-max-microvolt = <1350000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <115>;
-        };
-
-        mt6397_vsramca15_reg: buck_vsramca15 {
-            regulator-name = "vsramca15";
-            regulator-min-microvolt = < 850000>;
-            regulator-max-microvolt = <1350000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <115>;
-        };
-
-        mt6397_vsramca7_reg: buck_vsramca7 {
-            regulator-name = "vsramca7";
-            regulator-min-microvolt = < 850000>;
-            regulator-max-microvolt = <1350000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <115>;
-        };
-
-        mt6397_vcore_reg: buck_vcore {
-            regulator-name = "vcore";
-            regulator-min-microvolt = < 850000>;
-            regulator-max-microvolt = <1350000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <115>;
-        };
-
-        mt6397_vgpu_reg: buck_vgpu {
-            regulator-name = "vgpu";
-            regulator-min-microvolt = < 700000>;
-            regulator-max-microvolt = <1350000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <115>;
-        };
-
-        mt6397_vdrm_reg: buck_vdrm {
-            regulator-name = "vdrm";
-            regulator-min-microvolt = < 800000>;
-            regulator-max-microvolt = <1400000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <500>;
-        };
-
-        mt6397_vio18_reg: buck_vio18 {
-            regulator-name = "vio18";
-            regulator-min-microvolt = <1500000>;
-            regulator-max-microvolt = <2120000>;
-            regulator-ramp-delay = <12500>;
-            regulator-enable-ramp-delay = <500>;
-        };
-
-        mt6397_vtcxo_reg: ldo_vtcxo {
-            regulator-name = "vtcxo";
-            regulator-min-microvolt = <2800000>;
-            regulator-max-microvolt = <2800000>;
-            regulator-enable-ramp-delay = <90>;
-        };
-
-        mt6397_va28_reg: ldo_va28 {
-            regulator-name = "va28";
-            /* fixed output 2.8 V */
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vcama_reg: ldo_vcama {
-            regulator-name = "vcama";
-            regulator-min-microvolt = <1500000>;
-            regulator-max-microvolt = <2800000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vio28_reg: ldo_vio28 {
-            regulator-name = "vio28";
-            /* fixed output 2.8 V */
-            regulator-enable-ramp-delay = <240>;
-        };
-
-        mt6397_usb_reg: ldo_vusb {
-            regulator-name = "vusb";
-            /* fixed output 3.3 V */
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vmc_reg: ldo_vmc {
-            regulator-name = "vmc";
-            regulator-min-microvolt = <1800000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vmch_reg: ldo_vmch {
-            regulator-name = "vmch";
-            regulator-min-microvolt = <3000000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vemc_3v3_reg: ldo_vemc3v3 {
-            regulator-name = "vemc_3v3";
-            regulator-min-microvolt = <3000000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vgp1_reg: ldo_vgp1 {
-            regulator-name = "vcamd";
-            regulator-min-microvolt = <1220000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <240>;
-        };
-
-        mt6397_vgp2_reg: ldo_vgp2 {
-            regulator-name = "vcamio";
-            regulator-min-microvolt = <1000000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vgp3_reg: ldo_vgp3 {
-            regulator-name = "vcamaf";
-            regulator-min-microvolt = <1200000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vgp4_reg: ldo_vgp4 {
-            regulator-name = "vgp4";
-            regulator-min-microvolt = <1200000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vgp5_reg: ldo_vgp5 {
-            regulator-name = "vgp5";
-            regulator-min-microvolt = <1200000>;
-            regulator-max-microvolt = <3000000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vgp6_reg: ldo_vgp6 {
-            regulator-name = "vgp6";
-            regulator-min-microvolt = <1200000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-
-        mt6397_vibr_reg: ldo_vibr {
-            regulator-name = "vibr";
-            regulator-min-microvolt = <1200000>;
-            regulator-max-microvolt = <3300000>;
-            regulator-enable-ramp-delay = <218>;
-        };
-    };
Signature · 1 line
2.45.2
author maintainer
#10 lore raw

PATCH v2 5/7 dt-bindings: leds: mt6323: merge to MFD mediatek,mt6397 DT schema

In reply to Macpaul Lin

Convert leds-mt6323.txt to be compatible with DT schema. Since this is a simple LED device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove leds-mt6323.txt with a separate patch.

---
 .../devicetree/bindings/leds/leds-mt6323.txt  | 63 -------------------
 1 file changed, 63 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-mt6323.txt

Changes for v1 and v2:
- This is the first version of converting leds-mt6323. This is because converting leds-mt6323 together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of submitting single patch for each subdevice.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/leds/leds-mt6323.txt deleted +0 -63
deleted file mode 100644
index 052dccb8..0000000
@@ -1,63 +0,0 @@
-Device Tree Bindings for LED support on MT6323 PMIC
-
-MT6323 LED controller is subfunction provided by MT6323 PMIC, so the LED
-controllers are defined as the subnode of the function node provided by MT6323
-PMIC controller that is being defined as one kind of Muti-Function Device (MFD)
-using shared bus called PMIC wrapper for each subfunction to access remote
-MT6323 PMIC hardware.
-
-For MT6323 MFD bindings see:
-Documentation/devicetree/bindings/mfd/mt6397.txt
-For MediaTek PMIC wrapper bindings see:
-Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
-
-Required properties:
-- compatible : Must be one of
-  - "mediatek,mt6323-led"
-  - "mediatek,mt6331-led"
-  - "mediatek,mt6332-led"
-- address-cells : Must be 1
-- size-cells : Must be 0
-
-Each led is represented as a child node of the mediatek,mt6323-led that
-describes the initial behavior for each LED physically and currently only four
-LED child nodes can be supported.
-
-Required properties for the LED child node:
-- reg : LED channel number (0..3)
-
-Optional properties for the LED child node:
-- label : See Documentation/devicetree/bindings/leds/common.txt
-- linux,default-trigger : See Documentation/devicetree/bindings/leds/common.txt
-- default-state: See Documentation/devicetree/bindings/leds/common.txt
-
-Example:
-
-	mt6323: pmic {
-		compatible = "mediatek,mt6323";
-
-		...
-
-		mt6323led: leds {
-			compatible = "mediatek,mt6323-led";
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			led@0 {
-				reg = <0>;
-				label = "LED0";
-				linux,default-trigger = "timer";
-				default-state = "on";
-			};
-			led@1 {
-				reg = <1>;
-				label = "LED1";
-				default-state = "off";
-			};
-			led@2 {
-				reg = <2>;
-				label = "LED2";
-				default-state = "on";
-			};
-		};
-	};
Signature · 1 line
2.45.2
#11 lore raw

Re: [PATCH v2 5/7] dt-bindings: leds: mt6323: merge to MFD mediatek,mt6397 DT schema

kernel test robot noticed the following build warnings:

Hi Macpaul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-regulator/for-next]
[also build test WARNING on next-20240830]
[cannot apply to lee-mfd/for-mfd-next robh/for-next lee-mfd/for-mfd-fixes linus/master v6.11-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Macpaul-Lin/dt-bindings-mfd-mediatek-mt6397-Convert-to-DT-schema-format/20240830-191309
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20240830110732.30080-5-macpaul.lin%40mediatek.com
patch subject: [PATCH v2 5/7] dt-bindings: leds: mt6323: merge to MFD mediatek,mt6397 DT schema
reproduce: (https://download.01.org/0day-ci/archive/20240831/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

Warning: Documentation/devicetree/bindings/power/wakeup-source.txt references a file that doesn't exist: Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
Warning: Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
Warning: Documentation/hwmon/g762.rst references a file that doesn't exist: Documentation/devicetree/bindings/hwmon/g762.txt
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/reserved-memory/qcom
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/display/exynos/

>> Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/leds/leds-mt6323.txt

Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt Using alabaster theme

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#12 lore raw

PATCH v2 6/7 dt-bindings: power: reset: mt6323: merge to MFD mediatek,mt6397 DT schema

In reply to Macpaul Lin

Convert mt6323-poweroff.txt to be compatible with DT schema. Since this is a power-controller device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove mt6323-poweroff.txt with a separate patch.

---
 .../bindings/power/reset/mt6323-poweroff.txt  | 20 -------------------
 1 file changed, 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt

Changes for v1 and v2:
- This is the first version of converting mt6323-poweroff.txt. This is because converting mt6323-poweroff.txt together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of submitting single patch for each subdevice.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt deleted +0 -20
deleted file mode 100644
index 933f0c4..0000000
@@ -1,20 +0,0 @@
-Device Tree Bindings for Power Controller on MediaTek PMIC
-
-The power controller which could be found on PMIC is responsible for externally
-powering off or on the remote MediaTek SoC through the circuit BBPU.
-
-Required properties:
-- compatible: Should be one of follows
-       "mediatek,mt6323-pwrc": for MT6323 PMIC
-
-Example:
-
-       pmic {
-               compatible = "mediatek,mt6323";
-
-               ...
-
-               power-controller {
-                       compatible = "mediatek,mt6323-pwrc";
-               };
-       }
Signature · 1 line
2.45.2
#13 lore raw

Re: [PATCH v2 6/7] dt-bindings: power: reset: mt6323: merge to MFD mediatek,mt6397 DT schema

Hi,

Quoted 7 lines · Macpaul Lin

Convert mt6323-poweroff.txt to be compatible with DT schema. Since this is a power-controller device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove mt6323-poweroff.txt with a separate patch.

---

Please merge this into PATCH 2/7 in the next version of the patchset (i.e. the patch creating the new YAML binding).

-- Sebastian

Quoted 41 lines
 .../bindings/power/reset/mt6323-poweroff.txt  | 20 -------------------
 1 file changed, 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt

Changes for v1 and v2:
- This is the first version of converting mt6323-poweroff.txt. This is because converting mt6323-poweroff.txt together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of submitting single patch for each subdevice.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt deleted +0 -20
deleted file mode 100644
index 933f0c4..0000000
@@ -1,20 +0,0 @@
-Device Tree Bindings for Power Controller on MediaTek PMIC
-
-The power controller which could be found on PMIC is responsible for externally
-powering off or on the remote MediaTek SoC through the circuit BBPU.
-
-Required properties:
-- compatible: Should be one of follows
-       "mediatek,mt6323-pwrc": for MT6323 PMIC
-
-Example:
-
-       pmic {
-               compatible = "mediatek,mt6323";
-
-               ...
-
-               power-controller {
-                       compatible = "mediatek,mt6323-pwrc";
-               };
-       }
Signature · 1 line
2.45.2
author maintainer
#14 lore raw

Re: [PATCH v2 6/7] dt-bindings: power: reset: mt6323: merge to MFD mediatek,mt6397 DT schema

Quoted 8 lines · Sebastian Reichel

Hi,

Quoted 5 lines · Macpaul Lin

Convert mt6323-poweroff.txt to be compatible with DT schema. Since this is a power-controller device node, merge it into parent mediatek,mt6397.yaml. Subsequently, remove mt6323-poweroff.txt with a separate patch.

Quoted 8 lines
Quoted 2 lines

---

Please merge this into PATCH 2/7 in the next version of the patchset (i.e. the patch creating the new YAML binding).

-- Sebastian

[snip]

Will squash the other patches for removing text format files in to the MFD patch in next (v3) version. Thanks!

Regards,
Macpaul Lin

author maintainer
#15 lore raw

PATCH v2 7/7 dt-bindings: sound: mt6358: merge to MFD mediatek,mt6397 DT schema

In reply to Macpaul Lin

Convert "sound/mt6358.txt" to be compatible with the DT schema. Since this is a simple audio codec device node, merge it into the parent file mediatek,mt6397.yaml. Subsequently, remove mt6358.txt with a separate patch.

---
 .../devicetree/bindings/sound/mt6358.txt      | 26 -------------------
 1 file changed, 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/mt6358.txt

Changes for v1 and v2:
- This is the first version of converting "sound/mt6358.txt". This is because converting sound/mt6358.txt together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of submitting single patch for each subdevice.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/sound/mt6358.txt deleted +0 -26
deleted file mode 100644
index fbe9e55..0000000
@@ -1,26 +0,0 @@
-Mediatek MT6358 Audio Codec
-
-The communication between MT6358 and SoC is through Mediatek PMIC wrapper.
-For more detail, please visit Mediatek PMIC wrapper documentation.
-
-Must be a child node of PMIC wrapper.
-
-Required properties:
-
-- compatible - "string" - One of:
-    "mediatek,mt6358-sound"
-    "mediatek,mt6366-sound"
-- Avdd-supply : power source of AVDD
-
-Optional properties:
-- mediatek,dmic-mode : Indicates how many data pins are used to transmit two
-	channels of PDM signal. 0 means two wires, 1 means one wire. Default
-	value is 0.
-
-Example:
-
-mt6358_snd {
-	compatible = "mediatek,mt6358-sound";
-	Avdd-supply = <&mt6358_vaud28_reg>;
-	mediatek,dmic-mode = <0>;
-};
Signature · 1 line
2.45.2
#16 lore raw
In reply to Macpaul Lin
Quoted 17 lines · Macpaul Lin

Convert this from the old style text based binding to the new DT schema style.

The examples have been trimmed down and move to parent schema mfd/mediatek,mt6397.yaml.

Add new maintainers and submitter from MediaTek.

---
 .../regulator/mediatek,mt6323-regulator.yaml  |  84 +++++++
 .../bindings/regulator/mt6323-regulator.txt   | 237 ------------------
 2 files changed, 84 insertions(+), 237 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/mt6323-regulator.txt
Quoted 7 lines

Changes for v1 and v2:
- This is the first version of converting mt6323-regulator. This is because converting mt6323-regulator together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of single patch for each skydives.
- This patch has been made base on linux-next/master git repo.

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):
Warning: Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml references a file that doesn't exist: Documentation/devicetree/bindings/regulator/mt6323-regulator.txt Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: Documentation/devicetree/bindings/regulator/mt6323-regulator.txt

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

maintainer
#17 lore raw
In reply to Macpaul Lin
Quoted 53 lines · Macpaul Lin

Convert this from the old style text based binding to the new DT schema style.

The examples have been trimmed down and move to parent schema mfd/mediatek,mt6397.yaml.

Add new maintainers and submitter from MediaTek.

---
 .../regulator/mediatek,mt6323-regulator.yaml  |  84 +++++++
 .../bindings/regulator/mt6323-regulator.txt   | 237 ------------------
 2 files changed, 84 insertions(+), 237 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/mt6323-regulator.txt

Changes for v1 and v2:
- This is the first version of converting mt6323-regulator. This is because converting mt6323-regulator together with mfd/mediatek,mt6397.yaml, so we've create a patch set instead of single patch for each skydives.
- This patch has been made base on linux-next/master git repo.

Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml new file +23 -0
new file mode 100644
index 0000000..f7c2a03
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mediatek,mt6323-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6323 Regulator
+
+maintainers:
+  - John Crispin <[email protected]>
+  - Sen Chu <[email protected]>
+  - Macpaul Lin <[email protected]>
+
+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,mt6323-regulator
+

Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml new file +10 -0
+patternProperties:
+  "^(buck_)?v(pa|proc|sys)$":
+    description: Buck regulators
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v(camio|cn18)$":

Why are buck_ and ldo_ prefixes optional? The old binding didn't reflect actual (upstream) users? If so, that's fine, but mention that in the commit message.

Rob

author maintainer
#18 lore raw
Quoted 15 lines · Rob Herring

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 10 lines · Macpaul Lin

Convert this from the old style text based binding to the new DT schema style.

The examples have been trimmed down and move to parent schema mfd/mediatek,mt6397.yaml.

Add new maintainers and submitter from MediaTek.

[snip]

Quoted 16 lines

Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml line 33

Quoted 11 lines
Documentation/devicetree/bindings/regulator/mediatek,mt6323-regulator.yaml new file +11 -0
+
+patternProperties:
+  "^(buck_)?v(pa|proc|sys)$":
+    description: Buck regulators
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes: false
+    unevaluatedProperties: false
+
+  "^(ldo_)?v(camio|cn18)$":

Why are buck_ and ldo_ prefixes optional? The old binding didn't reflect actual (upstream) users? If so, that's fine, but mention that in the commit message.

Quoted 2 lines

Rob

Will use "^buck_v" and "^ldo_v" as the prefixes of each items in patternProperties. Thanks!

Regards,
Macpaul Lin

#19 lore raw
In reply to Macpaul Lin
kernel test robot noticed the following build warnings:

Hi Macpaul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-regulator/for-next]
[also build test WARNING on lee-mfd/for-mfd-next robh/for-next lee-mfd/for-mfd-fixes linus/master v6.11-rc5 next-20240830] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Macpaul-Lin/dt-bindings-mfd-mediatek-mt6397-Convert-to-DT-schema-format/20240830-191309
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20240830110732.30080-1-macpaul.lin%40mediatek.com
patch subject: [PATCH v2 1/7] regulator: dt-bindings: mt6323: Convert to DT schema
reproduce: (https://download.01.org/0day-ci/archive/20240831/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> Warning: Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml references a file that doesn't exist: Documentation/devicetree/bindings/regulator/mt6323-regulator.txt

Warning: Documentation/devicetree/bindings/power/wakeup-source.txt references a file that doesn't exist: Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
Warning: Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
Warning: Documentation/hwmon/g762.rst references a file that doesn't exist: Documentation/devicetree/bindings/hwmon/g762.txt
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/reserved-memory/qcom
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/display/exynos/

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki