All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Saravanan Sekar <sravanhome@gmail.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org, mark.rutland@arm.com,
	mripard@kernel.org, shawnguo@kernel.org, heiko@sntech.de,
	sam@ravnborg.org, icenowy@aosc.io,
	laurent.pinchart@ideasonboard.com, gregkh@linuxfoundation.org,
	Jonathan.Cameron@huawei.com, davem@davemloft.net,
	mchehab+samsung@kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/4] dt-bindings: regulator: add document bindings for mpq7920
Date: Fri, 3 Jan 2020 16:18:42 -0700	[thread overview]
Message-ID: <20200103231842.GA25920@bogus> (raw)
In-Reply-To: <20191226222930.8882-3-sravanhome@gmail.com>

On Thu, Dec 26, 2019 at 11:29:28PM +0100, Saravanan Sekar wrote:
> Add device tree binding information for mpq7920 regulator driver.
> Example bindings for mpq7920 are added.
> 
> Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
> ---
>  .../bindings/regulator/mpq7920.yaml           | 143 ++++++++++++++++++

Convention is use the compatible string: mps,mpq7920.yaml

>  1 file changed, 143 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mpq7920.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/mpq7920.yaml b/Documentation/devicetree/bindings/regulator/mpq7920.yaml
> new file mode 100644
> index 000000000000..54e9177dfd1b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mpq7920.yaml
> @@ -0,0 +1,143 @@
> +# SPDX-License-Identifier: GPL-2.0

Dual license new bindings:

(GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mpq7920.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Monolithic Power System MPQ7920 PMIC
> +
> +maintainers:
> +  - Saravanan Sekar <sravanhome@gmail.com>
> +
> +properties:
> +  $nodename:
> +    pattern: "pmic@[0-9a-f]{1,2}"
> +  compatible:
> +    enum:
> +      - mps,mpq7920
> +
> +  reg:
> +    maxItems: 1
> +
> +  mps,time-slot:
> +    description:
> +      each regulator output shall be delayed during power on/off sequence which
> +      based on configurable time slot value, must be one of following corresponding
> +      value 0.5ms, 2ms, 8ms, 16ms

These values map to 0-3?

This value is how long each time slot is?

> +    allOf:
> +      - $ref: "/schemas/types.yaml#/definitions/uint8"
> +      - enum: [ 0, 1, 2, 3 ]
> +      - default: 0

Only $ref needs to be under the allOf, so move enum and default to same 
level as allOf.

> +
> +  mps,fixed-on-time:
> +     description:
> +       select power on sequence with fixed time output delay mentioned in
> +       time-slot reg for all the regulators.
> +     type: boolean
> +
> +  mps,fixed-off-time:
> +     description:
> +        select power off sequence with fixed time output delay mentioned in
> +        time-slot reg for all the regulators.
> +     type: boolean
> +
> +  mps,inc-off-time:
> +     description: |
> +        mutually exclusive to mps,fixed-off-time an array of 8, linearly increase
> +        output delay during power off sequence based on factor of time slot/interval
> +        for each regulator.
> +     allOf:
> +       - $ref: "/schemas/types.yaml#/definitions/uint8-array"
> +       - minimum: 0
> +       - maximum: 15
> +       - default: [ 0, 6, 0, 6, 7, 7, 7, 9 ]

Each value corresponds to a regulator? Why not a per regulator property?

> +
> +  mps,inc-on-time:
> +     description: |
> +        mutually exclusive to mps,fixed-on-time an array of 8, linearly increase
> +        output delay during power on sequence based on factor of time slot/interval
> +        for each regulator.
> +     allOf:
> +       - $ref: "/schemas/types.yaml#/definitions/uint8-array"
> +       - minimum: 0
> +       - maximum: 15
> +       - default: [ 0, 6, 0, 6, 7, 7, 7, 9 ]
> +
> +  mps,switch-freq:
> +     description: |
> +        switching frequency must be one of following corresponding value
> +        1.1MHz, 1.65MHz, 2.2MHz, 2.75MHz

Seems like this should be a common property.

> +     allOf:
> +       - $ref: "/schemas/types.yaml#/definitions/uint8"
> +       - enum: [ 0, 1, 2, 3 ]
> +       - default: 2
> +
> +  mps,buck-softstart:
> +     description: |
> +        An array of 4 contains soft start time of each buck, must be one of
> +        following corresponding values 150us, 300us, 610us, 920us
> +     allOf:
> +       - $ref: "/schemas/types.yaml#/definitions/uint8-array"
> +       - enum: [ 0, 1, 2, 3 ]

As this is an array, should be:

items:
  enum: ...

Constraints on the size of the array?

Though again, why not a per regulator property? Also, a fairly common 
thing for buck regulators?

> +       - default: [ 1, 1, 1, 1 ]
> +
> +  mps,buck-ovp:
> +     description: |
> +        An array of 4 contains over voltage protection of each buck, must be
> +        one of above values
> +     allOf:
> +       - $ref: "/schemas/types.yaml#/definitions/uint8-array"
> +       - enum: [ 0, 1 ]
> +       - default: [ 1, 1, 1, 1 ]
> +
> +  mps,buck-phase-delay:
> +     description: |
> +        An array of 4 contains phase delay of each buck must be one of above values
> +        corresponding to 0deg, 90deg, 180deg, 270deg
> +     allOf:
> +       - $ref: "/schemas/types.yaml#/definitions/uint8-array"
> +       - enum: [ 0, 1, 2, 3 ]
> +       - default: [ 0, 0, 1, 1 ]
> +
> +  regulators:
> +    type: object
> +    description:
> +      list of regulators provided by this controller, must be named
> +      after their hardware counterparts BUCK[1-4], one LDORTC, and LDO[2-5]
> +      The valid names for regulators are
> +      buck1, buck2, buck3, buck4, ldortc, ldo2, ldo3, ldo4, ldo5

You need buck[1-4] and ldo(rtc|[2-5]) child nodes defined here which 
reference regulators.yaml.

> +
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        pmic@69 {
> +          compatible = "mps,mpq7920";
> +          reg = <0x69>;
> +
> +          mps,switch-freq = <1>;
> +          mps,buck-softstart = /bits/ 8 <1 2 1 3>;
> +          mps,buck-ovp = /bits/ 8 <1 0 1 1>;
> +
> +          regulators {
> +            buck1 {
> +             regulator-name = "buck1";
> +             regulator-min-microvolt = <400000>;
> +             regulator-max-microvolt = <3587500>;
> +             regulator-min-microamp  = <460000>;
> +             regulator-max-microamp  = <7600000>;
> +             regulator-boot-on;
> +            };
> +
> +            ldo2 {
> +             regulator-name = "ldo2";
> +             regulator-min-microvolt = <650000>;
> +             regulator-max-microvolt = <3587500>;
> +            };
> +         };
> +       };
> +     };
> +...
> -- 
> 2.17.1
> 

  reply	other threads:[~2020-01-03 23:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 22:29 [PATCH v4 0/4] Add regulator support for mpq7920 Saravanan Sekar
2019-12-26 22:29 ` [PATCH v4 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
2020-01-03 22:44   ` Rob Herring
2019-12-26 22:29 ` [PATCH v4 2/4] dt-bindings: regulator: add document bindings for mpq7920 Saravanan Sekar
2020-01-03 23:18   ` Rob Herring [this message]
2019-12-26 22:29 ` [PATCH v4 3/4] regulator: mpq7920: add mpq7920 regulator driver Saravanan Sekar
2019-12-26 22:29 ` [PATCH v4 4/4] MAINTAINERS: Add entry for mpq7920 PMIC driver Saravanan Sekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200103231842.GA25920@bogus \
    --to=robh@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=broonie@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=icenowy@aosc.io \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab+samsung@kernel.org \
    --cc=mripard@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=shawnguo@kernel.org \
    --cc=sravanhome@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.