Skip to content

Commit eccd3d9

Browse files
committed
regulator: add new PMIC PF0900 support
Merge series from Joy Zou <joy.zou@nxp.com>: Add binding document and driver. Signed-off-by: Joy Zou <joy.zou@nxp.com> --- Changes in v3: binding part - change regulator node names into lowercase. - add more description for nxp,i2c-crc-enable. - remove the unnecessary nxp,dvs-run/standby-voltage property. These changes come from review comments: https://lore.kernel.org/imx/e9f38e38-7df7-4d19-b5c0-2f18aeebcc78@kernel.org/ - add regulator-state-mem property for example. driver part - convert to use maple tree register cache. - change of_match_ptr() name to lowercase since dt-binding changed. - add more nxp,i2c-crc-enable description for commit message. - remove the of_parse_cb and dvs from pf0900_regulators since the unnecessary property nxp,dvs-run/standby-voltage removed. - add set_suspend_enable/disable/voltage for the SW regulator_ops. the run/standby voltage can be adjusted via the API which regulator driver provides is recommended. These changes come from binding review comments: https://lore.kernel.org/imx/e9f38e38-7df7-4d19-b5c0-2f18aeebcc78@kernel.org/ - add bitfield.h header due to build issue. - correct the sw4 id. - add PF0900 prefix for short macro define in order to avoid duplication. - merge the same mask define in order to simplify code. - Link to v2: https://lore.kernel.org/r/20250721-b4-pf09-v2-v2-0-e2c568548032@nxp.com Changes in v2: binding part - modify the binding file name to match compatible string. - add one space for dt_binding_check warning. - remove unnecessary quotes from "VAON". - remove the unnecessary empty line. - move unevaluatedProperties after the $ref. - move additionalProperties after regulator type. - remove unnecessary regulator description driver part - modify the copyright comment block to C++ style. - add reg_read/write for regmap_bus. - remove original pf0900_pmic_read/write. - remove many regulator operations. - use regmap_read replace pf0900_pmic_read. - use regmap_update_bits and regmap_write_bits replace pf0900_pmic_write. - move the code from pf0900.h to pf0900-regulator.c and delete the header file. - remove unmask status interrupts and add unmask regulator interrupts. - remove many interrupts check warning print from irq_handler. - add notifier for regulator event. - remove unused macro define. - add PF0900 prefix for IRQ macro define in order to avoid duplication. - use GENMASK() and BIT() to replace mask marco define - remove redundant enum pf0900_chip_type. - remove redundant print info and comments. - add dvs property present check because this property is optional. - remove ret == -EINVAL check from sw_set_dvs() function. - Link to v1: https://lore.kernel.org/imx/20250617102025.3455544-1-joy.zou@nxp.com/ --- Joy Zou (2): dt-bindings: regulator: add PF0900 regulator yaml regulator: pf0900: Add PMIC PF0900 support .../devicetree/bindings/regulator/nxp,pf0900.yaml | 163 ++++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/pf0900-regulator.c | 975 +++++++++++++++++++++ 4 files changed, 1147 insertions(+) --- base-commit: 84b92a4 change-id: 20250714-b4-pf09-v2-91cdee6d1272 Best regards, -- Joy Zou <joy.zou@nxp.com>
2 parents a54ef14 + 162e236 commit eccd3d9

4 files changed

Lines changed: 1147 additions & 0 deletions

File tree

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/regulator/nxp,pf0900.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP PF0900 Power Management Integrated Circuit regulators
8+
9+
maintainers:
10+
- Joy Zou <joy.zou@nxp.com>
11+
12+
description:
13+
The PF0900 is a power management integrated circuit (PMIC) optimized
14+
for high performance i.MX9x based applications. It features five high
15+
efficiency buck converters, three linear and one vaon regulators. It
16+
provides low quiescent current in Standby and low power off Modes.
17+
18+
properties:
19+
compatible:
20+
enum:
21+
- nxp,pf0900
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
maxItems: 1
28+
29+
regulators:
30+
type: object
31+
additionalProperties: false
32+
33+
properties:
34+
vaon:
35+
type: object
36+
$ref: regulator.yaml#
37+
unevaluatedProperties: false
38+
39+
patternProperties:
40+
"^ldo[1-3]$":
41+
type: object
42+
$ref: regulator.yaml#
43+
unevaluatedProperties: false
44+
45+
"^sw[1-5]$":
46+
type: object
47+
$ref: regulator.yaml#
48+
unevaluatedProperties: false
49+
50+
nxp,i2c-crc-enable:
51+
type: boolean
52+
description:
53+
The CRC enabled during register read/write. Controlled by customer
54+
unviewable fuse bits OTP_I2C_CRC_EN. Check chip part number.
55+
56+
required:
57+
- compatible
58+
- reg
59+
- interrupts
60+
- regulators
61+
62+
additionalProperties: false
63+
64+
examples:
65+
- |
66+
#include <dt-bindings/interrupt-controller/irq.h>
67+
68+
i2c {
69+
#address-cells = <1>;
70+
#size-cells = <0>;
71+
72+
pmic@8 {
73+
compatible = "nxp,pf0900";
74+
reg = <0x08>;
75+
interrupt-parent = <&pcal6524>;
76+
interrupts = <89 IRQ_TYPE_LEVEL_LOW>;
77+
nxp,i2c-crc-enable;
78+
79+
regulators {
80+
vaon {
81+
regulator-name = "VAON";
82+
regulator-min-microvolt = <1800000>;
83+
regulator-max-microvolt = <3300000>;
84+
regulator-boot-on;
85+
regulator-always-on;
86+
};
87+
88+
sw1 {
89+
regulator-name = "SW1";
90+
regulator-min-microvolt = <500000>;
91+
regulator-max-microvolt = <3300000>;
92+
regulator-boot-on;
93+
regulator-always-on;
94+
regulator-ramp-delay = <1950>;
95+
regulator-state-mem {
96+
regulator-on-in-suspend;
97+
regulator-suspend-max-microvolt = <650000>;
98+
regulator-suspend-min-microvolt = <650000>;
99+
};
100+
};
101+
102+
sw2 {
103+
regulator-name = "SW2";
104+
regulator-min-microvolt = <300000>;
105+
regulator-max-microvolt = <3300000>;
106+
regulator-boot-on;
107+
regulator-always-on;
108+
regulator-ramp-delay = <1950>;
109+
};
110+
111+
sw3 {
112+
regulator-name = "SW3";
113+
regulator-min-microvolt = <300000>;
114+
regulator-max-microvolt = <3300000>;
115+
regulator-boot-on;
116+
regulator-always-on;
117+
regulator-ramp-delay = <1950>;
118+
};
119+
120+
sw4 {
121+
regulator-name = "SW4";
122+
regulator-min-microvolt = <300000>;
123+
regulator-max-microvolt = <3300000>;
124+
regulator-boot-on;
125+
regulator-always-on;
126+
regulator-ramp-delay = <1950>;
127+
};
128+
129+
sw5 {
130+
regulator-name = "SW5";
131+
regulator-min-microvolt = <300000>;
132+
regulator-max-microvolt = <3300000>;
133+
regulator-boot-on;
134+
regulator-always-on;
135+
regulator-ramp-delay = <1950>;
136+
};
137+
138+
ldo1 {
139+
regulator-name = "LDO1";
140+
regulator-min-microvolt = <750000>;
141+
regulator-max-microvolt = <3300000>;
142+
regulator-boot-on;
143+
regulator-always-on;
144+
};
145+
146+
ldo2 {
147+
regulator-name = "LDO2";
148+
regulator-min-microvolt = <650000>;
149+
regulator-max-microvolt = <3300000>;
150+
regulator-boot-on;
151+
regulator-always-on;
152+
};
153+
154+
ldo3 {
155+
regulator-name = "LDO3";
156+
regulator-min-microvolt = <650000>;
157+
regulator-max-microvolt = <3300000>;
158+
regulator-boot-on;
159+
regulator-always-on;
160+
};
161+
};
162+
};
163+
};

drivers/regulator/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,14 @@ config REGULATOR_PCAP
10061006
This driver provides support for the voltage regulators of the
10071007
PCAP2 PMIC.
10081008

1009+
config REGULATOR_PF0900
1010+
tristate "NXP PF0900/PF0901/PF09XX regulator driver"
1011+
depends on I2C
1012+
select REGMAP_I2C
1013+
help
1014+
Say y here to support the NXP PF0900/PF0901/PF09XX PMIC
1015+
regulator driver.
1016+
10091017
config REGULATOR_PF8X00
10101018
tristate "NXP PF8100/PF8121A/PF8200 regulator driver"
10111019
depends on I2C && OF

drivers/regulator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ obj-$(CONFIG_REGULATOR_QCOM_SPMI) += qcom_spmi-regulator.o
124124
obj-$(CONFIG_REGULATOR_QCOM_USB_VBUS) += qcom_usb_vbus-regulator.o
125125
obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
126126
obj-$(CONFIG_REGULATOR_PCA9450) += pca9450-regulator.o
127+
obj-$(CONFIG_REGULATOR_PF0900) += pf0900-regulator.o
127128
obj-$(CONFIG_REGULATOR_PF9453) += pf9453-regulator.o
128129
obj-$(CONFIG_REGULATOR_PF8X00) += pf8x00-regulator.o
129130
obj-$(CONFIG_REGULATOR_PFUZE100) += pfuze100-regulator.o

0 commit comments

Comments
 (0)