Skip to content

Commit 1cb9da5

Browse files
committed
dt-bindings: mfd: Add bindings for MAX77840 PMIC and submodules
Add device tree bindings to support the MAX77840 PMIC and its submodules, enabling configuration and control through device tree. Signed-off-by: joan-na-good <joan.na@analog.com>
1 parent f1a9a8d commit 1cb9da5

File tree

5 files changed

+248
-0
lines changed

5 files changed

+248
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mfd/maxim,max77840.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX77840 PMIC
8+
9+
maintainers:
10+
- Joan Na <joan.na@analog.com>
11+
12+
13+
properties:
14+
compatible:
15+
const: maxim,max77840
16+
17+
reg:
18+
maxItems: 1
19+
20+
interrupts:
21+
maxItems: 1
22+
23+
patternProperties:
24+
regulator:
25+
type: object
26+
$ref: regulator/maxim,max77840-regulator.yaml#
27+
28+
charger:
29+
type: object
30+
$ref: power/supply/maxim,max77840-charger.yaml#
31+
32+
fuelgauge:
33+
type: object
34+
$ref: power/supply/maxim,max77840-fuelgauge.yaml#
35+
36+
charger-detect:
37+
type: object
38+
properties:
39+
compatible:
40+
const: maxim,max77840-charger-detect
41+
42+
additionalProperties: false
43+
44+
required:
45+
- compatible
46+
- reg
47+
48+
additionalProperties: false
49+
50+
examples:
51+
- |
52+
#include <dt-bindings/interrupt-controller/irq.h>
53+
#include <dt-bindings/gpio/gpio.h>
54+
55+
i2c {
56+
#address-cells = <1>;
57+
#size-cells = <0>;
58+
59+
max77840@66 {
60+
compatible = "maxim,max77840";
61+
reg = <0x66>;
62+
interrupt-parent = <&gpio>;
63+
interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
64+
status = "okay";
65+
66+
regulator {
67+
SAFEOUT1 {
68+
regulator-boot-on;
69+
regulator-always-on;
70+
};
71+
};
72+
73+
charger {
74+
compatible = "maxim,max77840-charger";
75+
fast_charge_timer = <0>; // disable
76+
fast_charge_current = <1500>; // mA
77+
charge_termination_voltage = <4350>; // mV
78+
topoff_timer = <30>; // min
79+
topoff_current = <150>; // mA
80+
restart_threshold = <150>; // mV
81+
input_current_limit = <500>; // mA
82+
};
83+
84+
charger-detect {
85+
compatible = "maxim,max77840-charger-detect";
86+
};
87+
88+
fuelgauge {
89+
compatible = "maxim,max77840-fuelgauge";
90+
};
91+
};
92+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/maxim,max77840-charger-detect.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX77840 Charger Detect
8+
9+
maintainers:
10+
- Joan Na <joan.na@analog.com>
11+
12+
properties:
13+
compatible:
14+
const: maxim,max77840-charger-detect
15+
16+
required:
17+
- compatible
18+
19+
additionalProperties: false
20+
21+
examples:
22+
- |
23+
charger {
24+
compatible = "maxim,max77840-charger-detect";
25+
};
26+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/maxim,max77840-charger.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX77840 Charger
8+
9+
maintainers:
10+
- Joan Na <joan.na@analog.com>
11+
12+
properties:
13+
compatible:
14+
const: maxim,max77840-charger
15+
16+
fast_charge_timer:
17+
description: Fast charge timer in hours
18+
$ref: /schemas/types.yaml#/definitions/uint32
19+
20+
fast_charge_current:
21+
description: Fast charge current in milliamps
22+
$ref: /schemas/types.yaml#/definitions/uint32
23+
24+
charge_termination_voltage:
25+
description: Charge termination (CV) voltage in millivolts
26+
$ref: /schemas/types.yaml#/definitions/uint32
27+
28+
topoff_timer:
29+
description: Top-off timer in minutes
30+
$ref: /schemas/types.yaml#/definitions/uint32
31+
32+
topoff_current:
33+
description: Top-off current in milliamps (mA)
34+
$ref: /schemas/types.yaml#/definitions/uint32
35+
36+
restart_threshold:
37+
description: Restart threshold in millivolts (mV)
38+
$ref: /schemas/types.yaml#/definitions/uint32
39+
40+
input_current_limit:
41+
description: Input current limit in milliamps (mA)
42+
$ref: /schemas/types.yaml#/definitions/uint32
43+
44+
required:
45+
- compatible
46+
47+
additionalProperties: false
48+
49+
examples:
50+
- |
51+
charger {
52+
compatible = "maxim,max77840-charger";
53+
fast_charge_timer = <5>;
54+
fast_charge_current = <1500>;
55+
charge_termination_voltage = <4200>;
56+
topoff_timer = <20>;
57+
topoff_current = <100>;
58+
restart_threshold = <100>;
59+
input_current_limit = <500>;
60+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/maxim,max77840-fuelgauge.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX77840 Fuel Gauge
8+
9+
maintainers:
10+
- Joan Na <joan.na@analog.com>
11+
12+
properties:
13+
compatible:
14+
const: maxim,max77840-fuelgauge
15+
16+
required:
17+
- compatible
18+
19+
additionalProperties: false
20+
21+
examples:
22+
- |
23+
fuelgauge {
24+
compatible = "maxim,max77840-fuelgauge";
25+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/regulator/maxim,max77840-regulator.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX77840 Regulator
8+
9+
maintainers:
10+
- Joan Na <joan.na@analog.com>
11+
12+
properties:
13+
compatible:
14+
const: maxim,max77840-regulator
15+
16+
reg:
17+
maxItems: 1
18+
19+
regulators:
20+
type: object
21+
22+
properties:
23+
SAFEOUT1:
24+
$ref: regulator.yaml#
25+
26+
additionalProperties: false
27+
28+
required:
29+
- compatible
30+
- reg
31+
- regulators
32+
33+
additionalProperties: false
34+
35+
examples:
36+
- |
37+
38+
regulators {
39+
SAFEOUT1 {
40+
regulator-name = "SAFEOUT1";
41+
regulator-boot-on;
42+
regulator-always-on;
43+
};
44+
};
45+

0 commit comments

Comments
 (0)