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-charger.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: AB8500 Charger
9
10maintainers:
11  - Sebastian Reichel <sre@kernel.org>
12
13allOf:
14  - $ref: power-supply.yaml#
15
16properties:
17  compatible:
18    const: stericsson,ab8500-charger
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  vddadc-supply:
29    description: Supply for USB and Main charger
30
31  autopower_cfg:
32    type: boolean
33    description: automatic poweron after powerloss
34
35  interrupts:
36    maxItems: 14
37
38  interrupt-names:
39    items:
40      - const: MAIN_CH_UNPLUG_DET
41      - const: MAIN_CHARGE_PLUG_DET
42      - const: MAIN_EXT_CH_NOT_OK
43      - const: MAIN_CH_TH_PROT_R
44      - const: MAIN_CH_TH_PROT_F
45      - const: VBUS_DET_F
46      - const: VBUS_DET_R
47      - const: USB_LINK_STATUS
48      - const: USB_CH_TH_PROT_R
49      - const: USB_CH_TH_PROT_F
50      - const: USB_CHARGER_NOT_OKR
51      - const: VBUS_OVV
52      - const: CH_WD_EXP
53      - const: VBUS_CH_DROP_END
54
55  io-channels:
56    minItems: 2
57    maxItems: 4
58
59  io-channel-names:
60    oneOf:
61      - items:
62          - const: main_charger_v
63          - const: main_charger_c
64          - const: vbus_v
65          - const: usb_charger_c
66      - items:
67          - const: vbus_v
68          - const: usb_charger_c
69
70
71required:
72  - compatible
73  - monitored-battery
74  - vddadc-supply
75  - interrupts
76  - interrupt-names
77  - io-channels
78  - io-channel-names
79
80additionalProperties: false
81
82examples:
83  - |
84    #include <dt-bindings/interrupt-controller/irq.h>
85    pmic {
86      charger {
87        compatible = "stericsson,ab8500-charger";
88        monitored-battery = <&battery>;
89        vddadc-supply = <&ab8500_ldo_tvout_reg>;
90        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
91                     <11 IRQ_TYPE_LEVEL_HIGH>,
92                     <0 IRQ_TYPE_LEVEL_HIGH>,
93                     <107 IRQ_TYPE_LEVEL_HIGH>,
94                     <106 IRQ_TYPE_LEVEL_HIGH>,
95                     <14 IRQ_TYPE_LEVEL_HIGH>,
96                     <15 IRQ_TYPE_LEVEL_HIGH>,
97                     <79 IRQ_TYPE_LEVEL_HIGH>,
98                     <105 IRQ_TYPE_LEVEL_HIGH>,
99                     <104 IRQ_TYPE_LEVEL_HIGH>,
100                     <89 IRQ_TYPE_LEVEL_HIGH>,
101                     <22 IRQ_TYPE_LEVEL_HIGH>,
102                     <21 IRQ_TYPE_LEVEL_HIGH>,
103                     <16 IRQ_TYPE_LEVEL_HIGH>;
104        interrupt-names = "MAIN_CH_UNPLUG_DET",
105                          "MAIN_CHARGE_PLUG_DET",
106                          "MAIN_EXT_CH_NOT_OK",
107                          "MAIN_CH_TH_PROT_R",
108                          "MAIN_CH_TH_PROT_F",
109                          "VBUS_DET_F",
110                          "VBUS_DET_R",
111                          "USB_LINK_STATUS",
112                          "USB_CH_TH_PROT_R",
113                          "USB_CH_TH_PROT_F",
114                          "USB_CHARGER_NOT_OKR",
115                          "VBUS_OVV",
116                          "CH_WD_EXP",
117                          "VBUS_CH_DROP_END";
118        io-channels = <&gpadc 0x03>,
119                      <&gpadc 0x0a>,
120                      <&gpadc 0x09>,
121                      <&gpadc 0x0b>;
122        io-channel-names = "main_charger_v",
123                           "main_charger_c",
124                           "vbus_v",
125                           "usb_charger_c";
126      };
127    };
128