From: Rob Herring <robh@kernel.org>
To: Anson Huang <Anson.Huang@nxp.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org, paul.liu@linaro.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Linux-imx@nxp.com
Subject: Re: [PATCH] dt-bindings: regulator: Convert anatop regulator to json-schema
Date: Thu, 28 May 2020 14:31:58 -0600 [thread overview]
Message-ID: <20200528203158.GA624130@bogus> (raw)
In-Reply-To: <1589788505-18024-1-git-send-email-Anson.Huang@nxp.com>
On Mon, May 18, 2020 at 03:55:05PM +0800, Anson Huang wrote:
> Convert the anatop regulator binding to DT schema format using json-schema.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> .../bindings/regulator/anatop-regulator.txt | 40 ---------
> .../bindings/regulator/anatop-regulator.yaml | 94 ++++++++++++++++++++++
> 2 files changed, 94 insertions(+), 40 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/regulator/anatop-regulator.txt
> create mode 100644 Documentation/devicetree/bindings/regulator/anatop-regulator.yaml
>
> diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
> deleted file mode 100644
> index a3106c7..0000000
> --- a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -Anatop Voltage regulators
> -
> -Required properties:
> -- compatible: Must be "fsl,anatop-regulator"
> -- regulator-name: A string used as a descriptive name for regulator outputs
> -- anatop-reg-offset: Anatop MFD register offset
> -- anatop-vol-bit-shift: Bit shift for the register
> -- anatop-vol-bit-width: Number of bits used in the register
> -- anatop-min-bit-val: Minimum value of this register
> -- anatop-min-voltage: Minimum voltage of this regulator
> -- anatop-max-voltage: Maximum voltage of this regulator
> -
> -Optional properties:
> -- anatop-delay-reg-offset: Anatop MFD step time register offset
> -- anatop-delay-bit-shift: Bit shift for the step time register
> -- anatop-delay-bit-width: Number of bits used in the step time register
> -- vin-supply: The supply for this regulator
> -- anatop-enable-bit: Regulator enable bit offset
> -
> -Any property defined as part of the core regulator
> -binding, defined in regulator.txt, can also be used.
> -
> -Example:
> -
> - regulator-vddpu {
> - compatible = "fsl,anatop-regulator";
> - regulator-name = "vddpu";
> - regulator-min-microvolt = <725000>;
> - regulator-max-microvolt = <1300000>;
> - regulator-always-on;
> - anatop-reg-offset = <0x140>;
> - anatop-vol-bit-shift = <9>;
> - anatop-vol-bit-width = <5>;
> - anatop-delay-reg-offset = <0x170>;
> - anatop-delay-bit-shift = <24>;
> - anatop-delay-bit-width = <2>;
> - anatop-min-bit-val = <1>;
> - anatop-min-voltage = <725000>;
> - anatop-max-voltage = <1300000>;
> - };
> diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.yaml b/Documentation/devicetree/bindings/regulator/anatop-regulator.yaml
> new file mode 100644
> index 0000000..a8c9dd0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.yaml
> @@ -0,0 +1,94 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/anatop-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale Anatop Voltage Regulators
> +
> +maintainers:
> + - Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
> +
> +allOf:
> + - $ref: "regulator.yaml#"
> +
> +properties:
> + compatible:
> + const: fsl,anatop-regulator
> +
> + regulator-name:
> + $ref: '/schemas/types.yaml#/definitions/string'
> + description: string used as a descriptive name for regulator outputs
Standard property, right? It already has a definition.
> +
> + anatop-reg-offset:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the anatop MFD register offset.
> +
> + anatop-vol-bit-shift:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the bit shift for the register.
> +
> + anatop-vol-bit-width:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the number of bits used in the register.
> +
> + anatop-min-bit-val:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the minimum value of this register.
> +
> + anatop-min-voltage:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the minimum voltage of this regulator.
> +
> + anatop-max-voltage:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the maximum voltage of this regulator.
> +
> + anatop-delay-reg-offset:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the anatop MFD step time register offset.
> +
> + anatop-delay-bit-shift:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the bit shift for the step time register.
> +
> + anatop-delay-bit-width:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the number of bits used in the step time register.
> +
> + anatop-enable-bit:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing regulator enable bit offset.
> +
> + vin-supply:
> + $ref: '/schemas/types.yaml#/definitions/phandle'
> + description: input supply phandle.
> +
> +required:
> + - compatible
> + - regulator-name
> + - anatop-reg-offset
> + - anatop-vol-bit-shift
> + - anatop-vol-bit-width
> + - anatop-min-bit-val
> + - anatop-min-voltage
> + - anatop-max-voltage
Add here:
unevaluatedProperties: false
> +
> +examples:
> + - |
> + regulator-vddpu {
> + compatible = "fsl,anatop-regulator";
> + regulator-name = "vddpu";
> + regulator-min-microvolt = <725000>;
> + regulator-max-microvolt = <1300000>;
> + regulator-always-on;
> + anatop-reg-offset = <0x140>;
> + anatop-vol-bit-shift = <9>;
> + anatop-vol-bit-width = <5>;
> + anatop-delay-reg-offset = <0x170>;
> + anatop-delay-bit-shift = <24>;
> + anatop-delay-bit-width = <2>;
> + anatop-min-bit-val = <1>;
> + anatop-min-voltage = <725000>;
> + anatop-max-voltage = <1300000>;
> + };
> --
> 2.7.4
>
prev parent reply other threads:[~2020-05-28 20:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 7:55 [PATCH] dt-bindings: regulator: Convert anatop regulator to json-schema Anson Huang
2020-05-28 20:31 ` Rob Herring [this message]
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=20200528203158.GA624130@bogus \
--to=robh@kernel.org \
--cc=Anson.Huang@nxp.com \
--cc=Linux-imx@nxp.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.liu@linaro.org \
/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).