summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
blob: e13305afea6932e141c84cdaa9fb2b8ecba30b93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: "http://devicetree.org/schemas/power/supply/stericsson,ab8500-charger.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: AB8500 Charger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    const: stericsson,ab8500-charger

  battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to battery node

  vddadc-supply:
    description: Supply for USB and Main charger

  autopower_cfg:
    type: boolean
    description: automatic poweron after powerloss

  interrupts:
    maxItems: 14

  interrupt-names:
    items:
      - const: MAIN_CH_UNPLUG_DET
      - const: MAIN_CHARGE_PLUG_DET
      - const: MAIN_EXT_CH_NOT_OK
      - const: MAIN_CH_TH_PROT_R
      - const: MAIN_CH_TH_PROT_F
      - const: VBUS_DET_F
      - const: VBUS_DET_R
      - const: USB_LINK_STATUS
      - const: USB_CH_TH_PROT_R
      - const: USB_CH_TH_PROT_F
      - const: USB_CHARGER_NOT_OKR
      - const: VBUS_OVV
      - const: CH_WD_EXP
      - const: VBUS_CH_DROP_END

  io-channels:
    minItems: 2
    maxItems: 4

  io-channel-names:
    oneOf:
      - items:
          - const: main_charger_v
          - const: main_charger_c
          - const: vbus_v
          - const: usb_charger_c
      - items:
          - const: vbus_v
          - const: usb_charger_c


required:
  - compatible
  - battery
  - vddadc-supply
  - interrupts
  - interrupt-names
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      charger {
        compatible = "stericsson,ab8500-charger";
        battery = <&ab8500_battery>;
        vddadc-supply = <&ab8500_ldo_tvout_reg>;
        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
                     <11 IRQ_TYPE_LEVEL_HIGH>,
                     <0 IRQ_TYPE_LEVEL_HIGH>,
                     <107 IRQ_TYPE_LEVEL_HIGH>,
                     <106 IRQ_TYPE_LEVEL_HIGH>,
                     <14 IRQ_TYPE_LEVEL_HIGH>,
                     <15 IRQ_TYPE_LEVEL_HIGH>,
                     <79 IRQ_TYPE_LEVEL_HIGH>,
                     <105 IRQ_TYPE_LEVEL_HIGH>,
                     <104 IRQ_TYPE_LEVEL_HIGH>,
                     <89 IRQ_TYPE_LEVEL_HIGH>,
                     <22 IRQ_TYPE_LEVEL_HIGH>,
                     <21 IRQ_TYPE_LEVEL_HIGH>,
                     <16 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "MAIN_CH_UNPLUG_DET",
                          "MAIN_CHARGE_PLUG_DET",
                          "MAIN_EXT_CH_NOT_OK",
                          "MAIN_CH_TH_PROT_R",
                          "MAIN_CH_TH_PROT_F",
                          "VBUS_DET_F",
                          "VBUS_DET_R",
                          "USB_LINK_STATUS",
                          "USB_CH_TH_PROT_R",
                          "USB_CH_TH_PROT_F",
                          "USB_CHARGER_NOT_OKR",
                          "VBUS_OVV",
                          "CH_WD_EXP",
                          "VBUS_CH_DROP_END";
        io-channels = <&gpadc 0x03>,
                      <&gpadc 0x0a>,
                      <&gpadc 0x09>,
                      <&gpadc 0x0b>;
        io-channel-names = "main_charger_v",
                           "main_charger_c",
                           "vbus_v",
                           "usb_charger_c";
      };
    };