linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: power: Convert power_supply text to yaml
@ 2020-04-30 15:18 Dan Murphy
  2020-05-01 16:58 ` Sebastian Reichel
  2020-05-01 21:13 ` Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Murphy @ 2020-04-30 15:18 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, devicetree, Dan Murphy, Rob Herring

Convert the power_supply.txt to power-supply.yaml.
This conversion entailed fixing up the binding to being yaml and dt
checker compliant.

Added a note in the power_supply.txt to reference the power-supply.yaml

CC: Rob Herring <robh@kernel.org>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 .../bindings/power/supply/power-supply.yaml   | 40 +++++++++++++++++++
 .../bindings/power/supply/power_supply.txt    | 25 +-----------
 2 files changed, 42 insertions(+), 23 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/supply/power-supply.yaml

diff --git a/Documentation/devicetree/bindings/power/supply/power-supply.yaml b/Documentation/devicetree/bindings/power/supply/power-supply.yaml
new file mode 100644
index 000000000000..cfbc79833ed8
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/power-supply.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/power/supply/power_supply.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Power Supply Core Support
+
+maintainers:
+  - Sebastian Reichel <sre@kernel.org>
+
+properties:
+  power-supplies:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      This property is added to a supply in order to list the devices which
+      supply it power, referenced by their phandles.
+
+examples:
+  - |
+    power {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      usb_charger:power@e {
+        compatible = "some,usb-charger";
+        reg = <0xe>;
+      };
+
+      ac_charger:power@c {
+        compatible = "some,ac-charger";
+        reg = <0xc>;
+      };
+
+      battery:battery@b {
+        compatible = "some,battery";
+        reg = <0xb>;
+        power-supplies = <&usb_charger>, <&ac_charger>;
+      };
+    };
diff --git a/Documentation/devicetree/bindings/power/supply/power_supply.txt b/Documentation/devicetree/bindings/power/supply/power_supply.txt
index 8391bfa0edac..d9693e054509 100644
--- a/Documentation/devicetree/bindings/power/supply/power_supply.txt
+++ b/Documentation/devicetree/bindings/power/supply/power_supply.txt
@@ -1,23 +1,2 @@
-Power Supply Core Support
-
-Optional Properties:
- - power-supplies : This property is added to a supply in order to list the
-   devices which supply it power, referenced by their phandles.
-
-Example:
-
-	usb-charger: power@e {
-		compatible = "some,usb-charger";
-		...
-	};
-
-	ac-charger: power@c {
-		compatible = "some,ac-charger";
-		...
-	};
-
-	battery@b {
-		compatible = "some,battery";
-		...
-		power-supplies = <&usb-charger>, <&ac-charger>;
-	};
+This binding has been converted to yaml please see power-supply.yaml in this
+directory.
-- 
2.25.1


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

* Re: [PATCH] dt-bindings: power: Convert power_supply text to yaml
  2020-04-30 15:18 [PATCH] dt-bindings: power: Convert power_supply text to yaml Dan Murphy
@ 2020-05-01 16:58 ` Sebastian Reichel
  2020-05-01 17:00   ` Dan Murphy
  2020-05-01 21:13 ` Rob Herring
  1 sibling, 1 reply; 4+ messages in thread
From: Sebastian Reichel @ 2020-05-01 16:58 UTC (permalink / raw)
  To: Dan Murphy; +Cc: linux-pm, linux-kernel, devicetree, Rob Herring

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

Hi,

On Thu, Apr 30, 2020 at 10:18:41AM -0500, Dan Murphy wrote:
> Convert the power_supply.txt to power-supply.yaml.
> This conversion entailed fixing up the binding to being yaml and dt
> checker compliant.

Looks mostly good to me, thanks for taking care of it.

> Added a note in the power_supply.txt to reference the power-supply.yaml

Yes, we should keep the file until all bindings referencing the file
have been converted to YAML.

> CC: Rob Herring <robh@kernel.org>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  .../bindings/power/supply/power-supply.yaml   | 40 +++++++++++++++++++
>  .../bindings/power/supply/power_supply.txt    | 25 +-----------
>  2 files changed, 42 insertions(+), 23 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/power/supply/power-supply.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/power-supply.yaml b/Documentation/devicetree/bindings/power/supply/power-supply.yaml
> new file mode 100644
> index 000000000000..cfbc79833ed8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/power-supply.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/power/supply/power_supply.yaml#"

This should be power-supply instead of power_supply, which is also
reported by dtb_binding_check on my system :)

> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Power Supply Core Support
> +
> +maintainers:
> +  - Sebastian Reichel <sre@kernel.org>
> +
> +properties:
> +  power-supplies:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description:
> +      This property is added to a supply in order to list the devices which
> +      supply it power, referenced by their phandles.
> +
> +examples:
> +  - |
> +    power {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      usb_charger:power@e {
> +        compatible = "some,usb-charger";
> +        reg = <0xe>;
> +      };
> +
> +      ac_charger:power@c {

^^^ while at it, let's also fix this up and use
charger instead of power (for both entries).

> +        compatible = "some,ac-charger";
> +        reg = <0xc>;
> +      };
> +
> +      battery:battery@b {
> +        compatible = "some,battery";
> +        reg = <0xb>;
> +        power-supplies = <&usb_charger>, <&ac_charger>;
> +      };
> +    };
> diff --git a/Documentation/devicetree/bindings/power/supply/power_supply.txt b/Documentation/devicetree/bindings/power/supply/power_supply.txt
> index 8391bfa0edac..d9693e054509 100644
> --- a/Documentation/devicetree/bindings/power/supply/power_supply.txt
> +++ b/Documentation/devicetree/bindings/power/supply/power_supply.txt
> @@ -1,23 +1,2 @@
> -Power Supply Core Support
> -
> -Optional Properties:
> - - power-supplies : This property is added to a supply in order to list the
> -   devices which supply it power, referenced by their phandles.
> -
> -Example:
> -
> -	usb-charger: power@e {
> -		compatible = "some,usb-charger";
> -		...
> -	};
> -
> -	ac-charger: power@c {
> -		compatible = "some,ac-charger";
> -		...
> -	};
> -
> -	battery@b {
> -		compatible = "some,battery";
> -		...
> -		power-supplies = <&usb-charger>, <&ac-charger>;
> -	};
> +This binding has been converted to yaml please see power-supply.yaml in this
> +directory.
> -- 
> 2.25.1
> 

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

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

* Re: [PATCH] dt-bindings: power: Convert power_supply text to yaml
  2020-05-01 16:58 ` Sebastian Reichel
@ 2020-05-01 17:00   ` Dan Murphy
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Murphy @ 2020-05-01 17:00 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, linux-kernel, devicetree, Rob Herring

Sebastian

On 5/1/20 11:58 AM, Sebastian Reichel wrote:
> Hi,
>
> On Thu, Apr 30, 2020 at 10:18:41AM -0500, Dan Murphy wrote:
>> Convert the power_supply.txt to power-supply.yaml.
>> This conversion entailed fixing up the binding to being yaml and dt
>> checker compliant.
> Looks mostly good to me, thanks for taking care of it.
>
>> Added a note in the power_supply.txt to reference the power-supply.yaml
> Yes, we should keep the file until all bindings referencing the file
> have been converted to YAML.
Ack
>> CC: Rob Herring <robh@kernel.org>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
>>   .../bindings/power/supply/power-supply.yaml   | 40 +++++++++++++++++++
>>   .../bindings/power/supply/power_supply.txt    | 25 +-----------
>>   2 files changed, 42 insertions(+), 23 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/power/supply/power-supply.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/power/supply/power-supply.yaml b/Documentation/devicetree/bindings/power/supply/power-supply.yaml
>> new file mode 100644
>> index 000000000000..cfbc79833ed8
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/supply/power-supply.yaml
>> @@ -0,0 +1,40 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/power/supply/power_supply.yaml#"
> This should be power-supply instead of power_supply, which is also
> reported by dtb_binding_check on my system :)

Yeah I had an untracked file called power_supply.yaml and removed it 
after checking it in.

I will change this

>
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>> +
>> +title: Power Supply Core Support
>> +
>> +maintainers:
>> +  - Sebastian Reichel <sre@kernel.org>
>> +
>> +properties:
>> +  power-supplies:
>> +    $ref: /schemas/types.yaml#/definitions/phandle-array
>> +    description:
>> +      This property is added to a supply in order to list the devices which
>> +      supply it power, referenced by their phandles.
>> +
>> +examples:
>> +  - |
>> +    power {
>> +      #address-cells = <1>;
>> +      #size-cells = <0>;
>> +
>> +      usb_charger:power@e {
>> +        compatible = "some,usb-charger";
>> +        reg = <0xe>;
>> +      };
>> +
>> +      ac_charger:power@c {
> ^^^ while at it, let's also fix this up and use
> charger instead of power (for both entries).

Ack

Dan

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

* Re: [PATCH] dt-bindings: power: Convert power_supply text to yaml
  2020-04-30 15:18 [PATCH] dt-bindings: power: Convert power_supply text to yaml Dan Murphy
  2020-05-01 16:58 ` Sebastian Reichel
@ 2020-05-01 21:13 ` Rob Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2020-05-01 21:13 UTC (permalink / raw)
  To: Dan Murphy
  Cc: sre, linux-pm, linux-kernel, devicetree, Dan Murphy, Rob Herring

On Thu, 30 Apr 2020 10:18:41 -0500, Dan Murphy wrote:
> Convert the power_supply.txt to power-supply.yaml.
> This conversion entailed fixing up the binding to being yaml and dt
> checker compliant.
> 
> Added a note in the power_supply.txt to reference the power-supply.yaml
> 
> CC: Rob Herring <robh@kernel.org>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  .../bindings/power/supply/power-supply.yaml   | 40 +++++++++++++++++++
>  .../bindings/power/supply/power_supply.txt    | 25 +-----------
>  2 files changed, 42 insertions(+), 23 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/power/supply/power-supply.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

Documentation/devicetree/bindings/power/supply/power-supply.yaml: $id: relative path/filename doesn't match actual path or filename
	expected: http://devicetree.org/schemas/power/supply/power-supply.yaml#

See https://patchwork.ozlabs.org/patch/1280522

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.

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

end of thread, other threads:[~2020-05-01 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 15:18 [PATCH] dt-bindings: power: Convert power_supply text to yaml Dan Murphy
2020-05-01 16:58 ` Sebastian Reichel
2020-05-01 17:00   ` Dan Murphy
2020-05-01 21:13 ` Rob Herring

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).