1# SPDX-License-Identifier: GPL-2.0
2# Copyright (C) 2021 Sebastian Reichel
3%YAML 1.2
4---
5$id: "http://devicetree.org/schemas/power/supply/stericsson,ab8500-fg.yaml#"
6$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8title: AB8500 Fuel Gauge
9
10maintainers:
11  - Sebastian Reichel <sre@kernel.org>
12
13allOf:
14  - $ref: power-supply.yaml#
15
16properties:
17  compatible:
18    const: stericsson,ab8500-fg
19
20  monitored-battery:
21    $ref: /schemas/types.yaml#/definitions/phandle
22    description: phandle to battery node
23
24  battery:
25    $ref: /schemas/types.yaml#/definitions/phandle
26    deprecated: true
27
28  interrupts:
29    maxItems: 5
30
31  interrupt-names:
32    items:
33      - const: NCONV_ACCU
34      - const: BATT_OVV
35      - const: LOW_BAT_F
36      - const: CC_INT_CALIB
37      - const: CCEOC
38
39  io-channels:
40    maxItems: 1
41
42  io-channel-names:
43    items:
44      - const: main_bat_v
45
46required:
47  - compatible
48  - monitored-battery
49  - interrupts
50  - interrupt-names
51  - io-channels
52  - io-channel-names
53
54additionalProperties: false
55
56examples:
57  - |
58    #include <dt-bindings/interrupt-controller/irq.h>
59    pmic {
60      fuel-gauge {
61        compatible = "stericsson,ab8500-fg";
62        monitored-battery = <&battery>;
63        interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
64                     <8 IRQ_TYPE_LEVEL_HIGH>,
65                     <28 IRQ_TYPE_LEVEL_HIGH>,
66                     <27 IRQ_TYPE_LEVEL_HIGH>,
67                     <26 IRQ_TYPE_LEVEL_HIGH>;
68        interrupt-names = "NCONV_ACCU",
69                          "BATT_OVV",
70                          "LOW_BAT_F",
71                          "CC_INT_CALIB",
72                          "CCEOC";
73        io-channels = <&gpadc 0x08>;
74        io-channel-names = "main_bat_v";
75      };
76    };
77