Commit 983b6297 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Lee Jones
Browse files

dt-bindings: mfd: bd9571mwv: Convert to json-schema



Convert the ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit
(PMIC) Device Tree binding documentation to json-schema.

Make the "regulators" subnode optional, as not all users describe the
regulators.

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/76fdd209e6a2dada7ff50b8ad03eb14e7f3547a6.1635338031.git.geert+renesas@glider.be
parent 8b2051a1
Loading
Loading
Loading
Loading
+0 −69
Original line number Diff line number Diff line
* ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit (PMIC) bindings

Required properties:
 - compatible		: Should be "rohm,bd9571mwv" or "rohm,bd9574mwf".
 - reg			: I2C slave address.
 - interrupts		: The interrupt line the device is connected to.
 - interrupt-controller	: Marks the device node as an interrupt controller.
 - #interrupt-cells	: The number of cells to describe an IRQ, should be 2.
			    The first cell is the IRQ number.
			    The second cell is the flags, encoded as trigger
			    masks from ../interrupt-controller/interrupts.txt.
 - gpio-controller      : Marks the device node as a GPIO Controller.
 - #gpio-cells          : Should be two.  The first cell is the pin number and
                            the second cell is used to specify flags.
                            See ../gpio/gpio.txt for more information.
 - regulators:          : List of child nodes that specify the regulator
                            initialization data. Child nodes must be named
                            after their hardware counterparts:
			     - vd09
			     - vd18
			     - vd25
			     - vd33
			     - dvfs
			    Each child node is defined using the standard
			    binding for regulators.

Optional properties:
  - rohm,ddr-backup-power : Value to use for DDR-Backup Power (default 0).
			    This is a bitmask that specifies which DDR power
			    rails need to be kept powered when backup mode is
			    entered, for system suspend:
			      - bit 0: DDR0
			      - bit 1: DDR1
			      - bit 2: DDR0C
			      - bit 3: DDR1C
			    These bits match the KEEPON_DDR* bits in the
			    documentation for the "BKUP Mode Cnt" register.
  - rohm,rstbmode-level: The RSTB signal is configured for level mode, to
			 accommodate a toggle power switch (the RSTBMODE pin is
			 strapped low).
  - rohm,rstbmode-pulse: The RSTB signal is configured for pulse mode, to
			 accommodate a momentary power switch (the RSTBMODE pin
			 is strapped high).
			 The two properties above are mutually exclusive.

Example:

	pmic: pmic@30 {
		compatible = "rohm,bd9571mwv";
		reg = <0x30>;
		interrupt-parent = <&gpio2>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
		interrupt-controller;
		#interrupt-cells = <2>;
		gpio-controller;
		#gpio-cells = <2>;
		rohm,ddr-backup-power = <0xf>;
		rohm,rstbmode-pulse;

		regulators {
			dvfs: dvfs {
				regulator-name = "dvfs";
				regulator-min-microvolt = <750000>;
				regulator-max-microvolt = <1030000>;
				regulator-boot-on;
				regulator-always-on;
			};
		};
	};
+127 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/rohm,bd9571mwv.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit (PMIC)

maintainers:
  - Marek Vasut <marek.vasut@gmail.com>

properties:
  compatible:
    enum:
      - rohm,bd9571mwv
      - rohm,bd9574mwf

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  interrupt-controller: true

  '#interrupt-cells':
    const: 2

  gpio-controller: true

  '#gpio-cells':
    const: 2

  rohm,ddr-backup-power:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0x0
    maximum: 0xf
    description: |
      Value to use for DDR-Backup Power (default 0).
      This is a bitmask that specifies which DDR power rails need to be kept
      powered when backup mode is entered, for system suspend:
        - bit 0: DDR0
        - bit 1: DDR1
        - bit 2: DDR0C
        - bit 3: DDR1C
      These bits match the KEEPON_DDR* bits in the documentation for the "BKUP
      Mode Cnt" register.

  rohm,rstbmode-level:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      The RSTB signal is configured for level mode, to accommodate a toggle
      power switch (the RSTBMODE pin is strapped low).

  rohm,rstbmode-pulse:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      The RSTB signal is configured for pulse mode, to accommodate a momentary
      power switch (the RSTBMODE pin is strapped high).

  regulators:
    type: object
    description:
      List of child nodes that specify the regulator initialization data.
      Child nodes must be named after their hardware counterparts.

    patternProperties:
      "^(vd09|vd18|vd25|vd33|dvfs)$":
        type: object
        $ref: ../regulator/regulator.yaml#

        properties:
          regulator-name:
            pattern: "^(vd09|vd18|vd25|vd33|dvfs)$"

        unevaluatedProperties: false

    additionalProperties: false

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - interrupt-controller
  - '#interrupt-cells'
  - gpio-controller
  - '#gpio-cells'

oneOf:
  - required:
      - rohm,rstbmode-level
  - required:
      - rohm,rstbmode-pulse

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c {
          #address-cells = <1>;
          #size-cells = <0>;

          pmic: pmic@30 {
                  compatible = "rohm,bd9571mwv";
                  reg = <0x30>;
                  interrupt-parent = <&gpio2>;
                  interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
                  interrupt-controller;
                  #interrupt-cells = <2>;
                  gpio-controller;
                  #gpio-cells = <2>;
                  rohm,ddr-backup-power = <0xf>;
                  rohm,rstbmode-pulse;

                  regulators {
                          dvfs: dvfs {
                                  regulator-name = "dvfs";
                                  regulator-min-microvolt = <750000>;
                                  regulator-max-microvolt = <1030000>;
                                  regulator-boot-on;
                                  regulator-always-on;
                          };
                  };
          };
    };