All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML
@ 2020-09-26 17:35 Artur Rojek
  2020-09-26 17:35 ` [PATCH v3 2/2] dt-bindings: power: ingenic,battery: add new compatibles Artur Rojek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Artur Rojek @ 2020-09-26 17:35 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring
  Cc: Paul Cercueil, linux-pm, devicetree, linux-kernel, Artur Rojek

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
    
    v3: - drop description of `io-channels` property and set its maxItems,
        - remove redundant quotes in `io-channel-names` property,
        - drop `items` for `monitored-battery` property

 .../bindings/power/supply/ingenic,battery.txt | 31 -----------
 .../power/supply/ingenic,battery.yaml         | 55 +++++++++++++++++++
 2 files changed, 55 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..658ef92a5b82
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
@@ -0,0 +1,55 @@
+# 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:
+    maxItems: 1
+
+  io-channel-names:
+    const: battery
+
+  monitored-battery:
+    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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] dt-bindings: power: ingenic,battery: add new compatibles
  2020-09-26 17:35 [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Artur Rojek
@ 2020-09-26 17:35 ` Artur Rojek
  2020-09-29 19:21 ` [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Rob Herring
  2020-09-29 23:18 ` Sebastian Reichel
  2 siblings, 0 replies; 4+ messages in thread
From: Artur Rojek @ 2020-09-26 17:35 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring
  Cc: Paul Cercueil, linux-pm, devicetree, linux-kernel, Artur Rojek,
	Rob Herring

This binding can support Ingenic JZ4725B and JZ4770 SoCs, as they are
compatible with Ingenic JZ4740 battery.

Introduce the following compatible property combinations:
 compatible = "ingenic,jz4725b-battery", "ingenic,jz4740-battery",
 compatible = "ingenic,jz4770-battery", "ingenic,jz4740-battery"

Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Reviewed-by: Rob Herring <robh@kernel.org>
---

Changes:
    v2: new patch
    
    v3: no change

 .../devicetree/bindings/power/supply/ingenic,battery.yaml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
index 658ef92a5b82..683fa79ba2f3 100644
--- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
+++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
@@ -12,7 +12,13 @@ maintainers:
 
 properties:
   compatible:
-    const: ingenic,jz4740-battery
+    oneOf:
+      - const: ingenic,jz4740-battery
+      - items:
+        - enum:
+          - ingenic,jz4725b-battery
+          - ingenic,jz4770-battery
+        - const: ingenic,jz4740-battery
 
   io-channels:
     maxItems: 1
-- 
2.28.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML
  2020-09-26 17:35 [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Artur Rojek
  2020-09-26 17:35 ` [PATCH v3 2/2] dt-bindings: power: ingenic,battery: add new compatibles Artur Rojek
@ 2020-09-29 19:21 ` Rob Herring
  2020-09-29 23:18 ` Sebastian Reichel
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2020-09-29 19:21 UTC (permalink / raw)
  To: Artur Rojek
  Cc: linux-pm, Sebastian Reichel, devicetree, Paul Cercueil,
	linux-kernel, Rob Herring

On Sat, 26 Sep 2020 19:35:28 +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
> 
>     v3: - drop description of `io-channels` property and set its maxItems,
>         - remove redundant quotes in `io-channel-names` property,
>         - drop `items` for `monitored-battery` property
> 
>  .../bindings/power/supply/ingenic,battery.txt | 31 -----------
>  .../power/supply/ingenic,battery.yaml         | 55 +++++++++++++++++++
>  2 files changed, 55 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
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML
  2020-09-26 17:35 [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Artur Rojek
  2020-09-26 17:35 ` [PATCH v3 2/2] dt-bindings: power: ingenic,battery: add new compatibles Artur Rojek
  2020-09-29 19:21 ` [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Rob Herring
@ 2020-09-29 23:18 ` Sebastian Reichel
  2 siblings, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2020-09-29 23:18 UTC (permalink / raw)
  To: Artur Rojek
  Cc: Rob Herring, Paul Cercueil, linux-pm, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4359 bytes --]

Hi,

On Sat, Sep 26, 2020 at 07:35:28PM +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>
> ---

Thanks, queued (both patches).

-- Sebastian

> 
> Changes:
>     v2: move introduction of new compatibles into a separate patch
>     
>     v3: - drop description of `io-channels` property and set its maxItems,
>         - remove redundant quotes in `io-channel-names` property,
>         - drop `items` for `monitored-battery` property
> 
>  .../bindings/power/supply/ingenic,battery.txt | 31 -----------
>  .../power/supply/ingenic,battery.yaml         | 55 +++++++++++++++++++
>  2 files changed, 55 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..658ef92a5b82
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> @@ -0,0 +1,55 @@
> +# 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:
> +    maxItems: 1
> +
> +  io-channel-names:
> +    const: battery
> +
> +  monitored-battery:
> +    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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-29 23:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26 17:35 [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Artur Rojek
2020-09-26 17:35 ` [PATCH v3 2/2] dt-bindings: power: ingenic,battery: add new compatibles Artur Rojek
2020-09-29 19:21 ` [PATCH v3 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Rob Herring
2020-09-29 23:18 ` Sebastian Reichel

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.