Re: [PATCH] dt-bindings: power: Convert bq27xxx dt to yaml

From: Andrew F. Davis
Date: Mon May 04 2020 - 13:08:41 EST


On 5/4/20 12:44 PM, Dan Murphy wrote:
> Adding Andrew in manually.
>
> On 5/4/20 11:41 AM, Dan Murphy wrote:
>> Convert the bq27xxx.txt to yaml format
>>
>> CC: Pali RohÃr <pali@xxxxxxxxxx>
>> CC: Andrew F. Davis" <afd@xxxxxx>
>> Signed-off-by: Dan Murphy <dmurphy@xxxxxx>
>> ---
>> Â .../bindings/power/supply/bq27xxx.txtÂÂÂÂÂÂÂÂ | 56 -----------
>> Â .../bindings/power/supply/bq27xxx.yamlÂÂÂÂÂÂÂ | 95 +++++++++++++++++++
>> Â 2 files changed, 95 insertions(+), 56 deletions(-)
>> Â delete mode 100644
>> Documentation/devicetree/bindings/power/supply/bq27xxx.txt
>> Â create mode 100644
>> Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>>
>> diff --git
>> a/Documentation/devicetree/bindings/power/supply/bq27xxx.txt
>> b/Documentation/devicetree/bindings/power/supply/bq27xxx.txt
>> deleted file mode 100644
>> index 4fa8e08df2b6..000000000000
>> --- a/Documentation/devicetree/bindings/power/supply/bq27xxx.txt
>> +++ /dev/null
>> @@ -1,56 +0,0 @@
>> -TI BQ27XXX fuel gauge family
>> -
>> -Required properties:
>> -- compatible: contains one of the following:
>> - * "ti,bq27200" - BQ27200
>> - * "ti,bq27210" - BQ27210
>> - * "ti,bq27500" - deprecated, use revision specific property below
>> - * "ti,bq27510" - deprecated, use revision specific property below
>> - * "ti,bq27520" - deprecated, use revision specific property below
>> - * "ti,bq27500-1" - BQ27500/1
>> - * "ti,bq27510g1" - BQ27510-g1
>> - * "ti,bq27510g2" - BQ27510-g2
>> - * "ti,bq27510g3" - BQ27510-g3
>> - * "ti,bq27520g1" - BQ27520-g1
>> - * "ti,bq27520g2" - BQ27520-g2
>> - * "ti,bq27520g3" - BQ27520-g3
>> - * "ti,bq27520g4" - BQ27520-g4
>> - * "ti,bq27521" - BQ27521
>> - * "ti,bq27530" - BQ27530
>> - * "ti,bq27531" - BQ27531
>> - * "ti,bq27541" - BQ27541
>> - * "ti,bq27542" - BQ27542
>> - * "ti,bq27546" - BQ27546
>> - * "ti,bq27742" - BQ27742
>> - * "ti,bq27545" - BQ27545
>> - * "ti,bq27411" - BQ27411
>> - * "ti,bq27421" - BQ27421
>> - * "ti,bq27425" - BQ27425
>> - * "ti,bq27426" - BQ27426
>> - * "ti,bq27441" - BQ27441
>> - * "ti,bq27621" - BQ27621
>> -- reg: integer, I2C address of the fuel gauge.
>> -
>> -Optional properties:
>> -- monitored-battery: phandle of battery characteristics node
>> -ÂÂÂ The fuel gauge uses the following battery properties:
>> -ÂÂÂ + energy-full-design-microwatt-hours
>> -ÂÂÂ + charge-full-design-microamp-hours
>> -ÂÂÂ + voltage-min-design-microvolt
>> -Â Both or neither of the *-full-design-*-hours properties must be set.
>> -Â See Documentation/devicetree/bindings/power/supply/battery.txt
>> -
>> -Example:
>> -
>> -ÂÂÂ bat: battery {
>> -ÂÂÂÂÂÂÂ compatible = "simple-battery";
>> -ÂÂÂÂÂÂÂ voltage-min-design-microvolt = <3200000>;
>> -ÂÂÂÂÂÂÂ energy-full-design-microwatt-hours = <5290000>;
>> -ÂÂÂÂÂÂÂ charge-full-design-microamp-hours = <1430000>;
>> -ÂÂÂ };
>> -
>> -ÂÂÂ bq27510g3: fuel-gauge@55 {
>> -ÂÂÂÂÂÂÂ compatible = "ti,bq27510g3";
>> -ÂÂÂÂÂÂÂ reg = <0x55>;
>> -ÂÂÂÂÂÂÂ monitored-battery = <&bat>;
>> -ÂÂÂ };
>> diff --git
>> a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>> b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>> new file mode 100644
>> index 000000000000..6c53ee849004
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>> @@ -0,0 +1,95 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (C) 2020 Texas Instruments Incorporated
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/power/supply/bq27xxx.yaml#";
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#";
>> +
>> +title: TI BQ27XXX fuel gauge family
>> +
>> +maintainers:
>> +Â - Pali RohÃr <pali@xxxxxxxxxx>
>> +Â - Andrew F. Davis" <afd@xxxxxx>


Extra " at end of name.


>> +Â - Sebastian Reichel <sre@xxxxxxxxxx>
>> +
>> +description: |
>> +Â Support various Texas Instruments fuel gauge devices that share
>> similar
>> +Â register maps and power supply properties
>> +
>> +properties:
>> +Â compatible:
>> +ÂÂÂ enum:
>> +ÂÂÂÂÂ - ti,bq27200 - BQ27200
>> +ÂÂÂÂÂ - ti,bq27210 - BQ27210
>> +ÂÂÂÂÂ - ti,bq27500 - deprecated, use revision specific property below
>> +ÂÂÂÂÂ - ti,bq27510 - deprecated, use revision specific property below
>> +ÂÂÂÂÂ - ti,bq27520 - deprecated, use revision specific property below
>> +ÂÂÂÂÂ - ti,bq27500-1 - BQ27500/1
>> +ÂÂÂÂÂ - ti,bq27510g1 - BQ27510-g1
>> +ÂÂÂÂÂ - ti,bq27510g2 - BQ27510-g2
>> +ÂÂÂÂÂ - ti,bq27510g3 - BQ27510-g3
>> +ÂÂÂÂÂ - ti,bq27520g1 - BQ27520-g1
>> +ÂÂÂÂÂ - ti,bq27520g2 - BQ27520-g2
>> +ÂÂÂÂÂ - ti,bq27520g3 - BQ27520-g3
>> +ÂÂÂÂÂ - ti,bq27520g4 - BQ27520-g4
>> +ÂÂÂÂÂ - ti,bq27521 - BQ27521
>> +ÂÂÂÂÂ - ti,bq27530 - BQ27530
>> +ÂÂÂÂÂ - ti,bq27531 - BQ27531
>> +ÂÂÂÂÂ - ti,bq27541 - BQ27541
>> +ÂÂÂÂÂ - ti,bq27542 - BQ27542
>> +ÂÂÂÂÂ - ti,bq27546 - BQ27546
>> +ÂÂÂÂÂ - ti,bq27742 - BQ27742
>> +ÂÂÂÂÂ - ti,bq27545 - BQ27545
>> +ÂÂÂÂÂ - ti,bq27411 - BQ27411
>> +ÂÂÂÂÂ - ti,bq27421 - BQ27421
>> +ÂÂÂÂÂ - ti,bq27425 - BQ27425
>> +ÂÂÂÂÂ - ti,bq27426 - BQ27426
>> +ÂÂÂÂÂ - ti,bq27441 - BQ27441
>> +ÂÂÂÂÂ - ti,bq27621 - BQ27621
>> +
>> +Â reg:
>> +ÂÂÂ maxItems: 1
>> +ÂÂÂ description: integer, I2C address of the fuel gauge.
>> +
>> +Â monitored-battery:
>> +ÂÂÂ description: phandle of battery characteristics node
>> +
>> +Â energy-full-design-microwatt-hours:
>> +ÂÂÂ description: |
>> +ÂÂÂÂÂ See Documentation/devicetree/bindings/power/supply/battery.txt.
>> +ÂÂÂÂÂ If this property is set then charge-full-design-microamp-hours
>> must be
>> +ÂÂÂÂÂ set as well.


These are properties of the battery node and should be described in
their binding, they are not part of the fuel gauge node here.

Andrew


>> +
>> +Â charge-full-design-microamp-hours:
>> +ÂÂÂ description: |
>> +ÂÂÂÂÂ See Documentation/devicetree/bindings/power/supply/battery.txt.
>> +ÂÂÂÂÂ If this property is set then energy-full-design-microwatt-hours
>> must be
>> +ÂÂÂÂÂ set as well.
>> +
>> +Â voltage-min-design-microvolt:
>> +ÂÂÂ description: |
>> +ÂÂÂÂÂ See Documentation/devicetree/bindings/power/supply/battery.txt.
>> +
>> +required:
>> +Â - compatible
>> +Â - reg
>> +additionalProperties: false
>> +
>> +examples:
>> +Â - |
>> +ÂÂÂ i2c0 {
>> +ÂÂÂÂÂ #address-cells = <1>;
>> +ÂÂÂÂÂ #size-cells = <0>;
>> +ÂÂÂÂÂ bat: battery {
>> +ÂÂÂÂÂÂÂ compatible = "simple-battery";
>> +ÂÂÂÂÂÂÂ voltage-min-design-microvolt = <3200000>;
>> +ÂÂÂÂÂÂÂ energy-full-design-microwatt-hours = <5290000>;
>> +ÂÂÂÂÂÂÂ charge-full-design-microamp-hours = <1430000>;
>> +ÂÂÂÂÂ };
>> +
>> +ÂÂÂÂÂ bq27510g3: fuel-gauge@55 {
>> +ÂÂÂÂÂÂÂ compatible = "ti,bq27510g3";
>> +ÂÂÂÂÂÂÂ reg = <0x55>;
>> +ÂÂÂÂÂÂÂ monitored-battery = <&bat>;
>> +ÂÂÂÂÂ };
>> +ÂÂÂ };