xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/maxim,max17040.yaml (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/power/supply/maxim,max17040.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: Maxim 17040 fuel gauge series
8
9maintainers:
10  - Sebastian Reichel <sre@kernel.org>
11
12allOf:
13  - $ref: power-supply.yaml#
14
15properties:
16  compatible:
17    enum:
18      - maxim,max17040
19      - maxim,max17041
20      - maxim,max17043
21      - maxim,max17044
22      - maxim,max17048
23      - maxim,max17049
24      - maxim,max17058
25      - maxim,max17059
26      - maxim,max77836-battery
27
28  reg:
29    maxItems: 1
30
31  maxim,alert-low-soc-level:
32    $ref: /schemas/types.yaml#/definitions/uint32
33    minimum: 1
34    maximum: 32
35    description: |
36      The alert threshold that sets the state of charge level (%) where an interrupt is generated.
37      If skipped the power up default value of 4 (%) will be used.
38
39  maxim,double-soc:
40    type: boolean
41    description: |
42      Certain devices return double the capacity.
43      Specify this to divide the reported value in 2 and thus normalize it.
44      SoC == State of Charge == Capacity.
45
46  maxim,rcomp:
47    $ref: /schemas/types.yaml#/definitions/uint32
48    description: |
49      A value to compensate readings for various battery chemistries and operating temperatures.
50      max17040,41 have 2 byte rcomp, default to 0x97 0x00.
51      All other devices have one byte rcomp, default to 0x97.
52
53  interrupts:
54    maxItems: 1
55
56  wakeup-source:
57    type: boolean
58    description: |
59      Use this property to use alert low SoC level interrupt as wake up source.
60
61required:
62  - compatible
63  - reg
64
65additionalProperties: false
66
67examples:
68  - |
69    i2c0 {
70      #address-cells = <1>;
71      #size-cells = <0>;
72
73      battery@36 {
74        compatible = "maxim,max17048";
75        reg = <0x36>;
76        maxim,rcomp = /bits/ 8 <0x56>;
77        maxim,alert-low-soc-level = <10>;
78        maxim,double-soc;
79      };
80    };
81  - |
82    #include <dt-bindings/interrupt-controller/irq.h>
83    i2c0 {
84      #address-cells = <1>;
85      #size-cells = <0>;
86
87      battery@36 {
88        compatible = "maxim,max77836-battery";
89        reg = <0x36>;
90        maxim,alert-low-soc-level = <10>;
91        interrupt-parent = <&gpio7>;
92        interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
93        wakeup-source;
94      };
95    };
96