]> git.baikalelectronics.ru Git - uboot.git/commitdiff
power: pmic: Add NXP PCA9451A PMIC support
authorYe Li <ye.li@nxp.com>
Fri, 3 Feb 2023 10:24:36 +0000 (18:24 +0800)
committerStefano Babic <sbabic@denx.de>
Wed, 29 Mar 2023 22:45:39 +0000 (00:45 +0200)
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.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
drivers/power/pmic/pca9450.c
drivers/power/regulator/pca9450.c
include/power/pca9450.h

index 2427abfb7a5bdb0225080e17bb98b7f0d17be7cf..e99ece8fb0838d1adecf174d5a1b2b3eae8f0eb9 100644 (file)
@@ -120,6 +120,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, },
        { }
 };
 
index fe1869397cd7c1963e76ccff1458423c9b397326..7ca20d1f7f87191c3493803b24d0573cfcd2c6ce 100644 (file)
@@ -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;
index 6efecee96c8f9e72e4d3b0d37926d61fb3780d3e..b8219d535ad8023ed93f39135f7be79f1d13d8ce 100644 (file)
@@ -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
 };