]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
power: pmic/regulator: Support pca9452
authorJoy Zou <joy.zou@nxp.com>
Mon, 23 Sep 2024 13:11:32 +0000 (21:11 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 10 Oct 2024 18:17:46 +0000 (12:17 -0600)
Add PCA9452 PMIC/Regulator support.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/power/pmic/pca9450.c
drivers/power/regulator/pca9450.c
include/power/pca9450.h

index 07af6273d8aece5f94dccd7358539118deca004d..5025e2d338b990a3350f4abd54178188016de763 100644 (file)
@@ -121,6 +121,7 @@ static const struct udevice_id pca9450_ids[] = {
        { .compatible = "nxp,pca9450b", .data = NXP_CHIP_TYPE_PCA9450BC, },
        { .compatible = "nxp,pca9450c", .data = NXP_CHIP_TYPE_PCA9450BC, },
        { .compatible = "nxp,pca9451a", .data = NXP_CHIP_TYPE_PCA9451A, },
+       { .compatible = "nxp,pca9452",  .data = NXP_CHIP_TYPE_PCA9452, },
        { }
 };
 
index 86b22ead6299933321bea338fbf89a014b9edcae..a2a342447234dc7c8c1dd90bc5215ff238ede233 100644 (file)
@@ -288,7 +288,7 @@ 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 &&
-           type != NXP_CHIP_TYPE_PCA9451A) {
+           type != NXP_CHIP_TYPE_PCA9451A && type != NXP_CHIP_TYPE_PCA9452) {
                debug("Unknown PMIC type\n");
                return -EINVAL;
        }
@@ -299,7 +299,8 @@ static int pca9450_regulator_probe(struct udevice *dev)
 
        val = ret;
 
-       if (type == NXP_CHIP_TYPE_PCA9451A && (val & PCA9450_REG_PWRCTRL_TOFF_DEB))
+       if ((type == NXP_CHIP_TYPE_PCA9451A || type == NXP_CHIP_TYPE_PCA9452) &&
+           (val & PCA9450_REG_PWRCTRL_TOFF_DEB))
                pmic_trim = true;
 
        for (i = 0; i < ARRAY_SIZE(pca9450_reg_data); i++) {
@@ -326,6 +327,12 @@ static int pca9450_regulator_probe(struct udevice *dev)
                        continue;
                }
 
+               if (type == NXP_CHIP_TYPE_PCA9452 &&
+                   (!strcmp(pca9450_reg_data[i].name, "BUCK3") ||
+                   !strcmp(pca9450_reg_data[i].name, "LDO2"))) {
+                       continue;
+               }
+
                *plat = pca9450_reg_data[i];
 
                return 0;
index f896d829d37a92c179f7052312c411e73fc4fcf8..e5ab09fb8c83ca9e9c5fe726544f6fbdc5e5f6eb 100644 (file)
@@ -62,6 +62,7 @@ enum {
        NXP_CHIP_TYPE_PCA9450A = 0,
        NXP_CHIP_TYPE_PCA9450BC,
        NXP_CHIP_TYPE_PCA9451A,
+       NXP_CHIP_TYPE_PCA9452,
        NXP_CHIP_TYPE_AMOUNT
 };