diff mbox series

[v1,1/4] dt-bindings: power: supply: maxim,max17040: update properties

Message ID 20230308084419.11934-2-clamor95@gmail.com
State Accepted
Commit ddf5bbee5fa6cb157ecef4fe5263f3f36635e1c3
Headers show
Series Add optional properties to MAX17040 | expand

Commit Message

Svyatoslav Ryhel March 8, 2023, 8:44 a.m. UTC
Add simple cell, status, health and temperature properties.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 .../bindings/power/supply/maxim,max17040.yaml | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)

Comments

Sebastian Reichel May 15, 2023, 10:17 p.m. UTC | #1
Hi,

On Wed, Mar 08, 2023 at 10:44:16AM +0200, Svyatoslav Ryhel wrote:
> Add simple cell, status, health and temperature properties.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  .../bindings/power/supply/maxim,max17040.yaml | 37 +++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
> index 3a529326ecbd..6f1c25b4729f 100644
> --- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
> @@ -55,6 +55,20 @@ properties:
>    interrupts:
>      maxItems: 1
>  
> +  monitored-battery:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: phandle to the battery node being monitored
> +
> +  power-supplies: true

The above two should not be needed, since the binding inherits them:

```
allOf:
  - $ref: power-supply.yaml#

unevaluatedProperties: false
```

Otherwise LGTM.

-- Sebastian

> +
> +  io-channels:
> +    items:
> +      - description: battery temperature
> +
> +  io-channel-names:
> +    items:
> +      - const: temp
> +
>    wakeup-source:
>      type: boolean
>      description: |
> @@ -95,3 +109,26 @@ examples:
>          wakeup-source;
>        };
>      };
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c0 {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      fuel-gauge@36 {
> +        compatible = "maxim,max17043";
> +        reg = <0x36>;
> +
> +        interrupt-parent = <&gpio>;
> +        interrupts = <144 IRQ_TYPE_EDGE_FALLING>;
> +
> +        monitored-battery = <&battery>;
> +        power-supplies = <&charger>;
> +
> +        io-channels = <&adc 8>;
> +        io-channel-names = "temp";
> +
> +        maxim,alert-low-soc-level = <10>;
> +        wakeup-source;
> +      };
> +    };
> -- 
> 2.37.2
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
index 3a529326ecbd..6f1c25b4729f 100644
--- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
+++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
@@ -55,6 +55,20 @@  properties:
   interrupts:
     maxItems: 1
 
+  monitored-battery:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle to the battery node being monitored
+
+  power-supplies: true
+
+  io-channels:
+    items:
+      - description: battery temperature
+
+  io-channel-names:
+    items:
+      - const: temp
+
   wakeup-source:
     type: boolean
     description: |
@@ -95,3 +109,26 @@  examples:
         wakeup-source;
       };
     };
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c0 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      fuel-gauge@36 {
+        compatible = "maxim,max17043";
+        reg = <0x36>;
+
+        interrupt-parent = <&gpio>;
+        interrupts = <144 IRQ_TYPE_EDGE_FALLING>;
+
+        monitored-battery = <&battery>;
+        power-supplies = <&charger>;
+
+        io-channels = <&adc 8>;
+        io-channel-names = "temp";
+
+        maxim,alert-low-soc-level = <10>;
+        wakeup-source;
+      };
+    };