regulator: add new PMIC PF9453 support
Frank Li
maintainerv3 cover regulator: add new PMIC PF9453 support
Add binding doc and driver.
DTS part wait for
https://lore.kernel.org/imx/Z04W5chGq5TitB9f@lizhi-Precision-Tower-5810/
---
Changes in v3:
binding part
- Change to LDO-SNVS from LDO_SNVS
driver part
- remove pf9453.h
- remove double space
- use low case hex value
- remove , after terminate
- use GEMASK
- change to LDO-SNVS
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Reuse nxp,pca9450-regulator.yaml. Add nxp,pf9453 in nxp,pca9450-regulator.yaml instead of create new one.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Frank Li (1):
regulator: dt-bindings: pca9450: Add nxp,pf9453 compatible string
Joy Zou (1):
regulator: pf9453: add PMIC PF9453 support
.../bindings/regulator/nxp,pca9450-regulator.yaml | 24 +- drivers/regulator/Kconfig | 7 + drivers/regulator/Makefile | 1 + drivers/regulator/pf9453-regulator.c | 879 +++++++++++++++++++++ 4 files changed, 910 insertions(+), 1 deletion(-)
---
base-commit: 0768222687cbdbe7c300c4428f0c0c6b153386e3
change-id: 20241205-pf9453-90e8dbda562a
Best regards,
---
Frank Li <[email protected]>
Frank Li
maintainerPATCH v3 1/2 regulator: dt-bindings: pca9450: Add nxp,pf9453 compatible string
Add the compatible string "nxp,pf9453" for the PF9453 regulator. The PF9453 is similar to the PCA9460 but supports only LDO1, LDO2, LDO_SVNS, and BUCK[1-4].
Restrict LDO and BUCK numbers for nxp,pf9453 and keep the same restriction for other compatible strings.
---
change from v2 to v3
- LDO_SNVS to LDO-SNVS
--- .../bindings/regulator/nxp,pca9450-regulator.yaml | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml +23 -1
@@ -17,6 +17,9 @@ description: | Datasheet is available at https://www.nxp.com/docs/en/data-sheet/PCA9450DS.pdf + Support PF9453, Datasheet is available at + https://www.nxp.com/docs/en/data-sheet/PF9453_SDS.pdf + # The valid names for PCA9450 regulator nodes are: # BUCK1, BUCK2, BUCK3, BUCK4, BUCK5, BUCK6, # LDO1, LDO2, LDO3, LDO4, LDO5
@@ -29,6 +32,7 @@ properties: - nxp,pca9450b - nxp,pca9450c - nxp,pca9451a + - nxp,pf9453 reg: maxItems: 1
@@ -42,7 +46,7 @@ properties: list of regulators provided by this controller patternProperties: - "^LDO[1-5]$": + "^LDO([1-5]|-SNVS)$": type: object $ref: regulator.yaml# description:
@@ -100,6 +104,24 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + const: nxp,pf9453 + then: + properties: + regulators: + patternProperties: + "^LDO[3-5]$": false + "^BUCK[5-6]$": false + else: + properties: + regulators: + properties: + LDO-SNVS: false + examples: - | #include <dt-bindings/interrupt-controller/irq.h>
Signature · 1 line
2.34.1
Re: [PATCH v3 1/2] regulator: dt-bindings: pca9450: Add nxp,pf9453 compatible string
Quoted 7 lines · Frank Li
Add the compatible string "nxp,pf9453" for the PF9453 regulator. The PF9453 is similar to the PCA9460 but supports only LDO1, LDO2,
LDO_SVNS, and BUCK[1-4].Restrict LDO and BUCK numbers for nxp,pf9453 and keep the same restriction for other compatible strings.
Quoted 7 lines
Signed-off-by Frank Li <[email protected]>---
change from v2 to v3
-LDO_SNVSto LDO-SNVS--- .../bindings/regulator/nxp,pca9450-regulator.yaml | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
Best regards,
Krzysztof
Frank Li
maintainerPATCH v3 2/2 regulator: pf9453: add PMIC PF9453 support
In reply to Frank LiFrom: Joy Zou <[email protected]>
Support new PMIC PF9453, which is totally difference with PCA9450. So create new file for it.
The PF9453 is a single chip Power Management IC (PMIC) specifically designed for i.MX 91 processor. It provides power supply solutions for IoT (Internet of Things), smart appliance, and portable applications where size and efficiency are critical. The device provides four high efficiency step-down regulators, three LDOs, one 400 mA load switch and 32.768 kHz crystal oscillator driver.
---
change from v2 to v3
- remove pf9453.h
- remove double space
- use low case hex value
- remove , after terminate
- use GEMASK
- change to LDO-SNVS
--- drivers/regulator/Kconfig | 7 + drivers/regulator/Makefile | 1 + drivers/regulator/pf9453-regulator.c | 879 +++++++++++++++++++++++++++++++++++ 3 files changed, 887 insertions(+)
drivers/regulator/Kconfig +7 -0
@@ -981,6 +981,13 @@ config REGULATOR_PCA9450 Say y here to support the NXP PCA9450A/PCA9450B/PCA9450C PMIC regulator driver. +config REGULATOR_PF9453 + tristate "NXP PF9453 regulator driver" + depends on I2C + select REGMAP_I2C + help + Say y here to support the NXP PF9453 PMIC regulator driver. + config REGULATOR_PCAP tristate "Motorola PCAP2 regulator driver" depends on EZX_PCAP
drivers/regulator/Makefile +1 -0
@@ -123,6 +123,7 @@ obj-$(CONFIG_REGULATOR_QCOM_SPMI) += qcom_spmi-regulator.o obj-$(CONFIG_REGULATOR_QCOM_USB_VBUS) += qcom_usb_vbus-regulator.o obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o obj-$(CONFIG_REGULATOR_PCA9450) += pca9450-regulator.o +obj-$(CONFIG_REGULATOR_PF9453) += pf9453-regulator.o obj-$(CONFIG_REGULATOR_PF8X00) += pf8x00-regulator.o obj-$(CONFIG_REGULATOR_PFUZE100) += pfuze100-regulator.o obj-$(CONFIG_REGULATOR_PV88060) += pv88060-regulator.o
drivers/regulator/pf9453-regulator.c new file +879 -0
879 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v3 2/2] regulator: pf9453: add PMIC PF9453 support
Le 13/12/2024 à 21:46, Frank Li a écrit :
Quoted 11 lines
From: Joy Zou <[email protected]>
Support new PMIC PF9453, which is totally difference with PCA9450. So create new file for it.
The PF9453 is a single chip Power Management IC (PMIC) specifically designed for i.MX 91 processor. It provides power supply solutions for IoT (Internet of Things), smart appliance, and portable applications where size and efficiency are critical. The device provides four high efficiency step-down regulators, three LDOs, one 400 mA load switch and 32.768 kHz crystal oscillator driver.
...
drivers/regulator/pf9453-regulator.c line 129
Quoted 2 lines
drivers/regulator/pf9453-regulator.c new file +2
-0+/* PF9453_REG_BUCK2_CTRL bits */ +#define BUCK2_RAMP_MASK GENMASK(7, 4)
This was 0xC0 in previous patch, so GENMASK(7, 6) if I'm correct. Which one is the good one?
(the datasheet I've found does not give any details, so I can't check)
Quoted 4 lines
drivers/regulator/pf9453-regulator.c new file +4
-0+#define BUCK2_RAMP_25MV 0x0 +#define BUCK2_RAMP_12P5MV 0x1 +#define BUCK2_RAMP_6P25MV 0x2 +#define BUCK2_RAMP_3P125MV 0x3
...
drivers/regulator/pf9453-regulator.c line 176
Quoted 6 lines
drivers/regulator/pf9453-regulator.c new file +6
-0+/* PF9453_REG_LDO2_VOLT bits */ +#define LDO2_EN_MASK GENMASK(1, 0) +#define LDO2OUT_MASK GENMASK(6, 0) + +/* PF9453_REG_LDOSNVS_VOLT bits */ +#define LDOSNVS_EN_MASK 0x1
GENMASK(0, 0) to be consistent?
Quoted 4 lines
drivers/regulator/pf9453-regulator.c new file +4
-0+#define LDOSNVSCFG1_MASK GENMASK(6, 0) + +/* PF9453_REG_IRQ bits */ +#define IRQ_RSVD 0x80
drivers/regulator/pf9453-regulator.c line 190
Quoted 10 lines
drivers/regulator/pf9453-regulator.c new file +10
-0+#define IRQ_RSTB 0x40 +#define IRQ_ONKEY 0x20 +#define IRQ_RESETKEY 0x10 +#define IRQ_VR_FLT1 0x08 +#define IRQ_LOWVSYS 0x04 +#define IRQ_THERM_100 0x02 +#define IRQ_THERM_80 0x01 + +/* PF9453_REG_RESET_CTRL bits */ +#define WDOG_B_CFG_MASK GENMASK(7, 4)
This was 0xC0 in previous patch, so GENMASK(7, 6) if I'm correct. Which one is the good one?
drivers/regulator/pf9453-regulator.c line 193
Quoted 3 lines
drivers/regulator/pf9453-regulator.c new file +3
-0+#define WDOG_B_CFG_NONE 0x00 +#define WDOG_B_CFG_WARM 0x40 +#define WDOG_B_CFG_COLD 0x80
...
CJ
Frank Li
maintainerRe: [PATCH v3 2/2] regulator: pf9453: add PMIC PF9453 support
Quoted 15 lines · Christophe JAILLET
Le 13/12/2024 à 21:46, Frank Li a écrit :
Quoted 11 lines
From: Joy Zou <[email protected]>
Support new PMIC PF9453, which is totally difference with PCA9450. So create new file for it.
The PF9453 is a single chip Power Management IC (PMIC) specifically designed for i.MX 91 processor. It provides power supply solutions for IoT (Internet of Things), smart appliance, and portable applications where size and efficiency are critical. The device provides four high efficiency step-down regulators, three LDOs, one 400 mA load switch and 32.768 kHz crystal oscillator driver.
...
Quoted 7 lines
drivers/regulator/pf9453-regulator.c line 129
Quoted 2 lines
drivers/regulator/pf9453-regulator.c new file +2
-0+/* PF9453_REG_BUCK2_CTRL bits */ +#define BUCK2_RAMP_MASK GENMASK(7, 4)This was
0xC0in previous patch, soGENMASK(7, 6)if I'm correct. Which one is the good one?(the datasheet I've found does not give any details, so I can't check)
Good capture! It should be GENMASK(7, 6)
Frank
Quoted 42 lines
Quoted 5 lines
drivers/regulator/pf9453-regulator.c new file +4
-0+#define BUCK2_RAMP_25MV 0x0 +#define BUCK2_RAMP_12P5MV 0x1 +#define BUCK2_RAMP_6P25MV 0x2 +#define BUCK2_RAMP_3P125MV 0x3...
drivers/regulator/pf9453-regulator.c line 176
Quoted 6 lines
drivers/regulator/pf9453-regulator.c new file +6
-0+/* PF9453_REG_LDO2_VOLT bits */ +#define LDO2_EN_MASK GENMASK(1, 0) +#define LDO2OUT_MASK GENMASK(6, 0) + +/* PF9453_REG_LDOSNVS_VOLT bits */ +#define LDOSNVS_EN_MASK 0x1
GENMASK(0, 0)to be consistent?Quoted 4 lines
drivers/regulator/pf9453-regulator.c new file +4
-0+#define LDOSNVSCFG1_MASK GENMASK(6, 0) + +/* PF9453_REG_IRQ bits */ +#define IRQ_RSVD 0x80drivers/regulator/pf9453-regulator.c line 190
Quoted 10 lines
drivers/regulator/pf9453-regulator.c new file +10
-0+#define IRQ_RSTB 0x40 +#define IRQ_ONKEY 0x20 +#define IRQ_RESETKEY 0x10 +#define IRQ_VR_FLT1 0x08 +#define IRQ_LOWVSYS 0x04 +#define IRQ_THERM_100 0x02 +#define IRQ_THERM_80 0x01 + +/* PF9453_REG_RESET_CTRL bits */ +#define WDOG_B_CFG_MASK GENMASK(7, 4)This was
0xC0in previous patch, soGENMASK(7, 6)if I'm correct. Which one is the good one?drivers/regulator/pf9453-regulator.c line 193
Quoted 3 lines
drivers/regulator/pf9453-regulator.c new file +3
-0+#define WDOG_B_CFG_NONE 0x00 +#define WDOG_B_CFG_WARM 0x40 +#define WDOG_B_CFG_COLD 0x80...
CJ