Skip to content

Commit 66628d2

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 66628d2

File tree

5 files changed

+247
-0
lines changed

5 files changed

+247
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
regulator:
24+
type: object
25+
$ref: ../regulator/maxim,max77840-regulator.yaml#
26+
27+
charger:
28+
type: object
29+
$ref: ../power/supply/maxim,max77840-charger.yaml#
30+
31+
fuelgauge:
32+
type: object
33+
$ref: ../power/supply/maxim,max77840-fuelgauge.yaml#
34+
35+
charger-detect:
36+
type: object
37+
properties:
38+
compatible:
39+
const: maxim,max77840-charger-detect
40+
41+
additionalProperties: false
42+
43+
required:
44+
- compatible
45+
- reg
46+
47+
additionalProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/interrupt-controller/irq.h>
52+
#include <dt-bindings/gpio/gpio.h>
53+
54+
i2c {
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
58+
max77840@66 {
59+
compatible = "maxim,max77840";
60+
reg = <0x66>;
61+
interrupt-parent = <&gpio>;
62+
interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
63+
status = "okay";
64+
65+
regulator {
66+
SAFEOUT1 {
67+
regulator-boot-on;
68+
regulator-always-on;
69+
};
70+
};
71+
72+
charger {
73+
compatible = "maxim,max77840-charger";
74+
fast_charge_timer = <0>; // disable
75+
fast_charge_current = <1500>; // mA
76+
charge_termination_voltage = <4350>; // mV
77+
topoff_timer = <30>; // min
78+
topoff_current = <150>; // mA
79+
restart_threshold = <150>; // mV
80+
input_current_limit = <500>; // mA
81+
};
82+
83+
charger-detect {
84+
compatible = "maxim,max77840-charger-detect";
85+
};
86+
87+
fuelgauge {
88+
compatible = "maxim,max77840-fuelgauge";
89+
};
90+
};
91+
};
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)