xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/stericsson,ab8500-fg.yaml (revision 994297b01b98816bea1abf45ae4bac1bc69ee7a0)
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  battery:
21    $ref: /schemas/types.yaml#/definitions/phandle
22    description: phandle to battery node
23
24  interrupts:
25    maxItems: 5
26
27  interrupt-names:
28    items:
29      - const: NCONV_ACCU
30      - const: BATT_OVV
31      - const: LOW_BAT_F
32      - const: CC_INT_CALIB
33      - const: CCEOC
34
35  io-channels:
36    maxItems: 1
37
38  io-channel-names:
39    items:
40      - const: main_bat_v
41
42required:
43  - compatible
44  - battery
45  - interrupts
46  - interrupt-names
47  - io-channels
48  - io-channel-names
49
50additionalProperties: false
51
52examples:
53  - |
54    #include <dt-bindings/interrupt-controller/irq.h>
55    pmic {
56      fuel-gauge {
57        compatible = "stericsson,ab8500-fg";
58        battery = <&ab8500_battery>;
59        interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
60                     <8 IRQ_TYPE_LEVEL_HIGH>,
61                     <28 IRQ_TYPE_LEVEL_HIGH>,
62                     <27 IRQ_TYPE_LEVEL_HIGH>,
63                     <26 IRQ_TYPE_LEVEL_HIGH>;
64        interrupt-names = "NCONV_ACCU",
65                          "BATT_OVV",
66                          "LOW_BAT_F",
67                          "CC_INT_CALIB",
68                          "CCEOC";
69        io-channels = <&gpadc 0x08>;
70        io-channel-names = "main_bat_v";
71      };
72    };
73