1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/supply/lltc,ltc294x.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: LTC2941, LTC2942, LTC2943 and LTC2944 battery fuel gauges
8
9description: |
10  All chips measure battery capacity.
11  The LTC2942 is pin compatible with the LTC2941, it adds voltage and
12  temperature monitoring, and is runtime detected. LTC2943 and LTC2944
13  are software compatible, uses a slightly different conversion formula
14  for the charge counter and adds voltage, current and temperature monitoring.
15
16maintainers:
17  - Sebastian Reichel <sre@kernel.org>
18
19allOf:
20  - $ref: power-supply.yaml#
21
22properties:
23  compatible:
24    enum:
25      - lltc,ltc2941
26      - lltc,ltc2942
27      - lltc,ltc2943
28      - lltc,ltc2944
29
30  reg:
31    maxItems: 1
32
33  lltc,resistor-sense:
34    $ref: /schemas/types.yaml#/definitions/int32
35    description: |
36      Sense resistor value in milli-ohms.
37      Can be negative value when the battery has been connected to the wrong end of the resistor.
38
39  lltc,prescaler-exponent:
40    $ref: /schemas/types.yaml#/definitions/uint32
41    description: |
42      The prescaler exponent as explained in the datasheet.
43      This determines the range and accuracy of the gauge.
44      The value is programmed into the chip only if it differs from the current setting.
45      The setting is lost when the battery is disconnected.
46
47required:
48  - compatible
49  - reg
50  - lltc,resistor-sense
51  - lltc,prescaler-exponent
52
53additionalProperties: false
54
55examples:
56  - |
57    i2c {
58      #address-cells = <1>;
59      #size-cells = <0>;
60      battery@64 {
61        compatible = "lltc,ltc2943";
62        reg = <0x64>;
63        lltc,resistor-sense = <15>;
64        lltc,prescaler-exponent = <5>; /* 2^(2*5) = 1024 */
65      };
66    };
67