Skip to contentSkip to conversation

power: pmic: Add NXP PCA9451A PMIC support

PATCH In review Ye Li 3 participants 3 messages Feb 3, 2023 – Mar 30, 2023

lore
Share & tools
lore

Ye Li

author
#0 lore raw

PATCH 1/1 power: pmic: Add NXP PCA9451A PMIC support

PCA9451A uses similar BUCKs and LDO regulators as PCA9450B/C but has LDO2 and LDO3 removed. So reuse pca9450 PMIC and regulator driver and add new type for PCA9451A.

---
 drivers/power/pmic/pca9450.c      |  1 +
 drivers/power/regulator/pca9450.c | 11 ++++++++++-
 include/power/pca9450.h           |  1 +
 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/power/pmic/pca9450.c +1 -0
index a186edc..3c4f520 100644
@@ -111,6 +111,7 @@ static const struct udevice_id pca9450_ids[] = {
 	{ .compatible = "nxp,pca9450a", .data = NXP_CHIP_TYPE_PCA9450A, },
 	{ .compatible = "nxp,pca9450b", .data = NXP_CHIP_TYPE_PCA9450BC, },
 	{ .compatible = "nxp,pca9450c", .data = NXP_CHIP_TYPE_PCA9450BC, },
+	{ .compatible = "nxp,pca9451a", .data = NXP_CHIP_TYPE_PCA9451A, },
 	{ }
 };
 
drivers/power/regulator/pca9450.c +10 -1
index fe18693..7ca20d1 100644
@@ -276,7 +276,8 @@ static int pca9450_regulator_probe(struct udevice *dev)
 
 	type = dev_get_driver_data(dev_get_parent(dev));
 
-	if (type != NXP_CHIP_TYPE_PCA9450A && type != NXP_CHIP_TYPE_PCA9450BC) {
+	if (type != NXP_CHIP_TYPE_PCA9450A && type != NXP_CHIP_TYPE_PCA9450BC &&
+	    type != NXP_CHIP_TYPE_PCA9451A) {
 		debug("Unknown PMIC type\n");
 		return -EINVAL;
 	}
@@ -291,6 +292,14 @@ static int pca9450_regulator_probe(struct udevice *dev)
 			continue;
 		}
 
+		/* PCA9451A uses BUCK3 in dual-phase and don't have LDO2 and LDO3 */
+		if (type == NXP_CHIP_TYPE_PCA9451A &&
+		    (!strcmp(pca9450_reg_data[i].name, "BUCK3") ||
+		    !strcmp(pca9450_reg_data[i].name, "LDO2") ||
+		    !strcmp(pca9450_reg_data[i].name, "LDO3"))) {
+			continue;
+		}
+
 		*plat = pca9450_reg_data[i];
 
 		return 0;
include/power/pca9450.h +1 -0
index fa0405fc..f6d546f 100644
@@ -59,6 +59,7 @@ int power_pca9450_init(unsigned char bus, unsigned char addr);
 enum {
 	NXP_CHIP_TYPE_PCA9450A = 0,
 	NXP_CHIP_TYPE_PCA9450BC,
+	NXP_CHIP_TYPE_PCA9451A,
 	NXP_CHIP_TYPE_AMOUNT
 };
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 power: pmic: Add NXP PCA9451A PMIC support

In reply to Ye Li
Quoted 5 lines

PCA9451A uses similar BUCKs and LDO regulators as PCA9450B/C but has LDO2 and LDO3 removed. So reuse pca9450 PMIC and regulator driver and add new type for PCA9451A.

Applied to u-boot-imx, next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================