From: Rob Herring <robh@kernel.org>
To: Artur Rojek <contact@artur-rojek.eu>
Cc: Sebastian Reichel <sre@kernel.org>,
Paul Cercueil <paul@crapouillou.net>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML
Date: Mon, 14 Sep 2020 19:09:22 -0600 [thread overview]
Message-ID: <20200915010922.GA629419@bogus> (raw)
In-Reply-To: <20200906144726.8852-1-contact@artur-rojek.eu>
On Sun, Sep 06, 2020 at 04:47:25PM +0200, Artur Rojek wrote:
> Convert the textual documentation of Device Tree bindings for the
> Ingenic JZ47xx SoCs battery to YAML.
>
> Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
> ---
>
> Changes:
> v2: move introduction of new compatibles into a separate patch
>
> .../bindings/power/supply/ingenic,battery.txt | 31 ----------
> .../power/supply/ingenic,battery.yaml | 60 +++++++++++++++++++
> 2 files changed, 60 insertions(+), 31 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/power/supply/ingenic,battery.txt
> create mode 100644 Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
>
> diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt
> deleted file mode 100644
> index 66430bf73815..000000000000
> --- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -* Ingenic JZ47xx battery bindings
> -
> -Required properties:
> -
> -- compatible: Must be "ingenic,jz4740-battery".
> -- io-channels: phandle and IIO specifier pair to the IIO device.
> - Format described in iio-bindings.txt.
> -- monitored-battery: phandle to a "simple-battery" compatible node.
> -
> -The "monitored-battery" property must be a phandle to a node using the format
> -described in battery.txt, with the following properties being required:
> -
> -- voltage-min-design-microvolt: Drained battery voltage.
> -- voltage-max-design-microvolt: Fully charged battery voltage.
> -
> -Example:
> -
> -#include <dt-bindings/iio/adc/ingenic,adc.h>
> -
> -simple_battery: battery {
> - compatible = "simple-battery";
> - voltage-min-design-microvolt = <3600000>;
> - voltage-max-design-microvolt = <4200000>;
> -};
> -
> -ingenic_battery {
> - compatible = "ingenic,jz4740-battery";
> - io-channels = <&adc INGENIC_ADC_BATTERY>;
> - io-channel-names = "battery";
> - monitored-battery = <&simple_battery>;
> -};
> diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> new file mode 100644
> index 000000000000..b4e0275ac63a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> @@ -0,0 +1,60 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2019-2020 Artur Rojek
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/power/supply/ingenic,battery.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Ingenic JZ47xx battery bindings
> +
> +maintainers:
> + - Artur Rojek <contact@artur-rojek.eu>
> +
> +properties:
> + compatible:
> + const: ingenic,jz4740-battery
> +
> + io-channels:
> + items:
> + - description: >
> + phandle and IIO specifier pair to the IIO device.
> + See Documentation/devicetree/bindings/iio/iio-bindings.txt for more
> + details.
No need to redefine common properties. 'maxItems: 1' is sufficient here.
> +
> + io-channel-names:
> + const: "battery"
Don't need quotes.
> +
> + monitored-battery:
> + items:
> + - description: >
'monitored-battery' is always a single item. So just need 'description'.
> + phandle to a "simple-battery" compatible node.
> +
> + This property must be a phandle to a node using the format described
> + in battery.txt, with the following properties being required:
> + - voltage-min-design-microvolt: drained battery voltage,
> + - voltage-max-design-microvolt: fully charged battery voltage.
> +
> +required:
> + - compatible
> + - io-channels
> + - io-channel-names
> + - monitored-battery
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/iio/adc/ingenic,adc.h>
> +
> + simple_battery: battery {
> + compatible = "simple-battery";
> + voltage-min-design-microvolt = <3600000>;
> + voltage-max-design-microvolt = <4200000>;
> + };
> +
> + ingenic-battery {
> + compatible = "ingenic,jz4740-battery";
> + io-channels = <&adc INGENIC_ADC_BATTERY>;
> + io-channel-names = "battery";
> + monitored-battery = <&simple_battery>;
> + };
> --
> 2.28.0
>
prev parent reply other threads:[~2020-09-15 1:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-06 14:47 [PATCH v2 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Artur Rojek
2020-09-06 14:47 ` [PATCH v2 2/2] dt-bindings: power: ingenic,battery: add new compatibles Artur Rojek
2020-09-15 1:09 ` Rob Herring
2020-09-15 1:09 ` 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=20200915010922.GA629419@bogus \
--to=robh@kernel.org \
--cc=contact@artur-rojek.eu \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=sre@kernel.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).