From: Rob Herring <robh@kernel.org>
To: Jisheng Zhang <jszhang3@mail.ustc.edu.cn>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Saravanan Sekar <sravanhome@gmail.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 4/4] dt-bindings: regulator: Convert mp886x to json-schema
Date: Fri, 31 Jul 2020 15:20:44 -0600 [thread overview]
Message-ID: <20200731212044.GB806331@bogus> (raw)
In-Reply-To: <20200729131052.39e40311@xhacker>
On Wed, Jul 29, 2020 at 01:10:52PM +0800, Jisheng Zhang wrote:
> From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
>
> Convert the mp886x binding to DT schema format using json-schema.
>
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> ---
> .../devicetree/bindings/regulator/mp886x.txt | 31 ----------
> .../bindings/regulator/mps,mp886x.yaml | 58 +++++++++++++++++++
> 2 files changed, 58 insertions(+), 31 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/regulator/mp886x.txt
> create mode 100644 Documentation/devicetree/bindings/regulator/mps,mp886x.yaml
>
> diff --git a/Documentation/devicetree/bindings/regulator/mp886x.txt b/Documentation/devicetree/bindings/regulator/mp886x.txt
> deleted file mode 100644
> index e747000cebba..000000000000
> --- a/Documentation/devicetree/bindings/regulator/mp886x.txt
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -Monolithic Power Systems MP8867/MP8869 voltage regulator
> -
> -Required properties:
> -- compatible: Must be one of the following.
> - "mps,mp8867"
> - "mps,mp8869"
> -- reg: I2C slave address.
> -- enable-gpios: enable gpios.
> -- mps,fb-voltage-divider: An array of two integers containing the resistor
> - values R1 and R2 of the feedback voltage divider in kilo ohms.
> -
> -Optional properties:
> -- mps,switch-frequency: The valid switch frequency in Hertz. Available values
> - are: 500000, 750000, 1000000, 1250000, 1500000
> -
> -Any property defined as part of the core regulator binding, defined in
> -./regulator.txt, can also be used.
> -
> -Example:
> -
> - vcpu: regulator@62 {
> - compatible = "mps,mp8869";
> - regulator-name = "vcpu";
> - regulator-min-microvolt = <700000>;
> - regulator-max-microvolt = <850000>;
> - regulator-always-on;
> - regulator-boot-on;
> - enable-gpios = <&porta 1 GPIO_ACTIVE_LOW>;
> - mps,fb-voltage-divider = <80 240>;
> - reg = <0x62>;
> - };
> diff --git a/Documentation/devicetree/bindings/regulator/mps,mp886x.yaml b/Documentation/devicetree/bindings/regulator/mps,mp886x.yaml
> new file mode 100644
> index 000000000000..991f2de7eda8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mps,mp886x.yaml
> @@ -0,0 +1,58 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mps,mp886x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Monolithic Power Systems MP8867/MP8869 voltage regulator
> +
> +maintainers:
> + - Jisheng Zhang <jszhang@kernel.org>
Needs a $ref to regulator.yaml.
> +
> +properties:
> + compatible:
> + enum:
> + - mps,mp8867
> + - mps,mp8869
> +
> + reg:
> + maxItems: 1
> +
> + enable-gpios:
> + description: GPIO to enable/disable the regulator.
> + maxItems: 1
> +
> + mps,fb-voltage-divider:
> + description: An array of two integers containing the resistor
Sounds like a constraint. Add 'maxItems: 2'.
> + values R1 and R2 of the feedback voltage divider in kilo ohms.
> + $ref: "/schemas/types.yaml#/definitions/uint32-array"
> +
> + mps,switch-frequency:
> + description: The valid switch frequency in Hertz.
> + enum: [500000, 750000, 1000000, 1250000, 1500000]
> + $ref: "/schemas/types.yaml#/definitions/uint32"
With -hz added, the type will already be defined, so you can drop the
$ref.
> +
> +required:
> + - compatible
> + - reg
> + - enable-gpios
> + - mps,fb-voltage-divider
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + regulator@62 {
> + compatible = "mps,mp8869";
> + regulator-name = "vcpu";
> + regulator-min-microvolt = <800000>;
> + regulator-max-microvolt = <1150000>;
> + enable-gpios = <&porta 1 GPIO_ACTIVE_LOW>;
> + mps,fb-voltage-divider = <80 240>;
> + reg = <0x62>;
> + };
> + };
> +
> +...
> --
> 2.28.0.rc1
>
>
next prev parent reply other threads:[~2020-07-31 21:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 5:08 [PATCH v2 0/4] regulator: mp886x: two features and dt json convert Jisheng Zhang
2020-07-29 5:09 ` [PATCH v2 1/4] regulator: mp886x: implement set_ramp_delay Jisheng Zhang
2020-07-29 5:09 ` [PATCH v2 2/4] dt-bindings: regulator: mp886x: support mps,switch-frequency Jisheng Zhang
2020-07-31 21:18 ` Rob Herring
2020-07-29 5:10 ` [PATCH v2 3/4] regulator: mp886x: support setting switch freq Jisheng Zhang
2020-07-29 5:10 ` [PATCH v2 4/4] dt-bindings: regulator: Convert mp886x to json-schema Jisheng Zhang
2020-07-31 21:20 ` Rob Herring [this message]
2020-08-03 15:52 ` [PATCH v2 0/4] regulator: mp886x: two features and dt json convert Mark Brown
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=20200731212044.GB806331@bogus \
--to=robh@kernel.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jszhang3@mail.ustc.edu.cn \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).