1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/hwmon/adi,ltc4282.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices LTC4282 I2C High Current Hot Swap Controller over I2C
8
9maintainers:
10  - Nuno Sa <nuno.sa@analog.com>
11
12description: |
13  Analog Devices LTC4282 I2C High Current Hot Swap Controller over I2C.
14
15  https://www.analog.com/media/en/technical-documentation/data-sheets/ltc4282.pdf
16
17properties:
18  compatible:
19    enum:
20      - adi,ltc4282
21
22  reg:
23    maxItems: 1
24
25  vdd-supply: true
26
27  clocks:
28    maxItems: 1
29
30  '#clock-cells':
31    const: 0
32
33  adi,rsense-nano-ohms:
34    description: Value of the sense resistor.
35
36  adi,vin-mode-microvolt:
37    description:
38      Selects operating range for the Undervoltage, Overvoltage and Foldback
39      pins. Also for the ADC. Should be set to the nominal input voltage.
40    enum: [3300000, 5000000, 12000000, 24000000]
41    default: 12000000
42
43  adi,fet-bad-timeout-ms:
44    description:
45      From the moment a FET bad conditions is present, this property selects the
46      wait time/timeout for a FET-bad fault to be signaled. Setting this to 0,
47      disables FET bad faults to be reported.
48    default: 255
49    maximum: 255
50
51  adi,overvoltage-dividers:
52    description: |
53      Select which dividers to use for VDD Overvoltage detection. Note that
54      when the internal dividers are used the threshold is referenced to VDD.
55      The percentages in the datasheet are misleading since the actual values
56      to look for are in the "Absolute Maximum Ratings" table in the
57      "Comparator Inputs" section. In there there's a line for each of the 5%,
58      10% and 15% settings with the actual min, typical and max tolerances.
59    $ref: /schemas/types.yaml#/definitions/string
60    enum: [external, vdd_5_percent, vdd_10_percent, vdd_15_percent]
61    default: external
62
63  adi,undervoltage-dividers:
64    description: |
65      Select which dividers to use for VDD Overvoltage detection. Note that
66      when the internal dividers are used the threshold is referenced to VDD.
67      The percentages in the datasheet are misleading since the actual values
68      to look for are in the "Absolute Maximum Ratings" table in the
69      "Comparator Inputs" section. In there there's a line for each of the 5%,
70      10% and 15% settings with the actual min, typical and max tolerances.
71    $ref: /schemas/types.yaml#/definitions/string
72    enum: [external, vdd_5_percent, vdd_10_percent, vdd_15_percent]
73    default: external
74
75  adi,current-limit-sense-microvolt:
76    description:
77      The current limit sense voltage of the chip is adjustable between
78      12.5mV and 34.4mV in 3.1mV steps. This effectively limits the current
79      on the load.
80    enum: [12500, 15625, 18750, 21875, 25000, 28125, 31250, 34375]
81    default: 25000
82
83  adi,overcurrent-retry:
84    description:
85      If set, enables the chip to auto-retry 256 timer cycles after an
86      Overcurrent fault.
87    type: boolean
88
89  adi,overvoltage-retry-disable:
90    description:
91      If set, disables the chip to auto-retry 50ms after an Overvoltage fault.
92      It's enabled by default.
93    type: boolean
94
95  adi,undervoltage-retry-disable:
96    description:
97      If set, disables the chip to auto-retry 50ms after an Undervoltage fault.
98      It's enabled by default.
99    type: boolean
100
101  adi,fault-log-enable:
102    description:
103      If set, enables the FAULT_LOG and ADC_ALERT_LOG registers to be written
104      to the EEPROM when a fault bit transitions high and hence, will be
105      available after a power cycle (the chip loads the contents of
106      the EE_FAULT_LOG register - the one in EEPROM - into FAULT_LOG at boot).
107    type: boolean
108
109  adi,gpio1-mode:
110    description: Defines the function of the Pin. It can indicate that power is
111      good (PULL the pin low when power is not good) or that power is bad (Go
112      into high-z when power is not good).
113    $ref: /schemas/types.yaml#/definitions/string
114    enum: [power_bad, power_good]
115    default: power_good
116
117  adi,gpio2-mode:
118    description: Defines the function of the Pin. It can be set as the input for
119      the ADC or indicating that the MOSFET is in stress (dissipating power).
120    $ref: /schemas/types.yaml#/definitions/string
121    enum: [adc_input, stress_fet]
122    default: adc_input
123
124  adi,gpio3-monitor-enable:
125    description: If set, gpio3 is set as input for the ADC instead of gpio2.
126    type: boolean
127
128allOf:
129  - if:
130      required:
131        - adi,gpio3-monitor-enable
132    then:
133      properties:
134        adi,gpio2-mode:
135          const: stress_fet
136
137required:
138  - compatible
139  - reg
140  - adi,rsense-nano-ohms
141
142additionalProperties: false
143
144examples:
145  - |
146    i2c {
147        #address-cells = <1>;
148        #size-cells = <0>;
149
150        hwmon@50 {
151            compatible = "adi,ltc4282";
152            reg = <0x50>;
153            adi,rsense-nano-ohms = <500>;
154
155            adi,gpio1-mode = "power_good";
156            adi,gpio2-mode = "adc_input";
157        };
158    };
159...
160