dt-bindings: power: supply: define monitored-battery in common place
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 2 Nov 2022 18:44:59 +0000 (14:44 -0400)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sat, 5 Nov 2022 20:18:47 +0000 (21:18 +0100)
Define the type of monitored-battery in power-supply.yaml common schema.
Reference the schema where applicable to enforce the above in bindings
which have monitored-battery property.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Documentation/devicetree/bindings/mfd/ene-kb930.yaml
Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml
Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
Documentation/devicetree/bindings/power/supply/power-supply.yaml
Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml
Documentation/devicetree/bindings/power/supply/sc2731-charger.yaml

index 06ed9ec8f4bbce472cc0a7d52253f9e371ca031f..7c0a42390f18941fb980399ccb50340ca6df5bd8 100644 (file)
@@ -13,6 +13,8 @@ description: |
 maintainers:
   - Dmitry Osipenko <digetx@gmail.com>
 
+$ref: /schemas/power/supply/power-supply.yaml
+
 properties:
   compatible:
     items:
@@ -22,15 +24,13 @@ properties:
   reg:
     maxItems: 1
 
-  monitored-battery: true
-  power-supplies: true
   system-power-controller: true
 
 required:
   - compatible
   - reg
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
index 935e17099213febbe712abb1bc480a3ce493dc27..269fb85b20278c9a4507df8ee9752e235600f2ca 100644 (file)
@@ -124,6 +124,8 @@ properties:
       The child node for the charger to hold additional properties. If a
       battery is not in use, this node can be omitted.
     type: object
+    $ref: /schemas/power/supply/power-supply.yaml
+
     properties:
       monitored-battery:
         description: |
index 65fc6049efc1409fa8a91bc4a6c0f61174ed6c3e..347d4433adc5f560dd8ec0e77a79c60dc5604bd2 100644 (file)
@@ -60,13 +60,11 @@ properties:
 
   monitored-battery:
     description: |
-       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.yaml
 
   power-supplies: true
 
index 46527038bf22743c36a414a96ec50dccb263cb33..42fcfc0269726c84fe1824f16e6691f753b59773 100644 (file)
@@ -10,6 +10,8 @@ title: Ingenic JZ47xx battery bindings
 maintainers:
   - Artur Rojek <contact@artur-rojek.eu>
 
+$ref: power-supply.yaml#
+
 properties:
   compatible:
     oneOf:
@@ -28,8 +30,6 @@ properties:
 
   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.yaml, with the following properties being required:
       - voltage-min-design-microvolt: drained battery voltage,
index 2f672e6e8d72c08ab7efdab9ceb3fc91e488e26c..4e54c937973ee71be411964360c7ca8e43bd1034 100644 (file)
@@ -18,4 +18,10 @@ properties:
       This property is added to a supply in order to list the devices which
       supply it power, referenced by their phandles.
 
+  monitored-battery:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      The battery (with "simple-battery" compatible) being monitored by this
+      power supply.
+
 additionalProperties: true
index 24b06957b4ca52058513f357667de1977f81b6ea..14d9b42eda27da20c254ef88db4124915838f478 100644 (file)
@@ -18,6 +18,7 @@ description: |
   provides a Dual-source Battery Charger, two port BC1.2 detection and a
   Battery Monitor.
 
+$ref: power-supply.yaml#
 
 properties:
   compatible:
index eeb043f9bb4f2fc264c86a874b3f1ae497295b7b..735f7d372ae172ac47f8e6a20ebaba1d85f68c4d 100644 (file)
@@ -28,7 +28,6 @@ properties:
       The charger uses the following battery properties
       - charge-term-current-microamp: current for charge termination phase.
       - constant-charge-voltage-max-microvolt: maximum constant input voltage.
-      See Documentation/devicetree/bindings/power/supply/battery.yaml
 
 additionalProperties: false