1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/supply/sbs,sbs-manager.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: SBS compliant manager
8
9maintainers:
10  - Sebastian Reichel <sre@kernel.org>
11
12allOf:
13  - $ref: power-supply.yaml#
14
15properties:
16  compatible:
17    oneOf:
18      - items:
19          - enum:
20              - lltc,ltc1760
21          - enum:
22              - sbs,sbs-manager
23      - items:
24          - const: sbs,sbs-manager
25
26  reg:
27    const: 0xa
28
29  "#address-cells":
30    const: 1
31
32  "#size-cells":
33    const: 0
34
35  gpio-controller: true
36
37  "#gpio-cells":
38    const: 2
39
40required:
41  - compatible
42  - reg
43
44additionalProperties: false
45
46patternProperties:
47  "^i2c@[1-4]$":
48    type: object
49    $ref: /schemas/i2c/i2c-controller.yaml#
50
51examples:
52  - |
53    #include <dt-bindings/interrupt-controller/irq.h>
54    #include <dt-bindings/gpio/gpio.h>
55
56    i2c {
57      #address-cells = <1>;
58      #size-cells = <0>;
59
60      batman: battery-manager@a {
61        compatible = "lltc,ltc1760", "sbs,sbs-manager";
62        reg = <0x0a>;
63        #address-cells = <1>;
64        #size-cells = <0>;
65
66        gpio-controller;
67        #gpio-cells = <2>;
68
69        i2c@1 {
70          #address-cells = <1>;
71          #size-cells = <0>;
72          reg = <1>;
73
74          battery@b {
75            compatible = "ti,bq20z65", "sbs,sbs-battery";
76            reg = <0x0b>;
77            sbs,battery-detect-gpios = <&batman 1 1>;
78          };
79        };
80
81        i2c@2 {
82          #address-cells = <1>;
83          #size-cells = <0>;
84          reg = <2>;
85
86          battery@b {
87            compatible = "ti,bq20z65", "sbs,sbs-battery";
88            reg = <0x0b>;
89            sbs,battery-detect-gpios = <&batman 2 1>;
90          };
91        };
92
93        i2c@3 {
94          #address-cells = <1>;
95          #size-cells = <0>;
96          reg = <3>;
97
98          battery@b {
99            compatible = "ti,bq20z65", "sbs,sbs-battery";
100            reg = <0x0b>;
101            sbs,battery-detect-gpios = <&batman 3 1>;
102          };
103        };
104      };
105    };
106