diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c index 8671c58100..8b77b3143e 100644 --- a/drivers/power/pmic/pmic-uclass.c +++ b/drivers/power/pmic/pmic-uclass.c @@ -64,6 +64,17 @@ int pmic_bind_children(struct udevice *pmic, ofnode parent, continue; } + /* + * If some child info->prefix are the same, try to + * distinguish them by parent addr. + * + * Example: pmic@20, pmic@1a... + */ + if (info->addr) { + if (!strstr(dev_read_name(pmic), info->addr)) + continue; + } + drv = lists_driver_lookup_name(info->driver); if (!drv) { debug(" - driver: '%s' not found!\n", diff --git a/include/power/pmic.h b/include/power/pmic.h index 8ba9809f03..8eca9680f7 100644 --- a/include/power/pmic.h +++ b/include/power/pmic.h @@ -189,6 +189,7 @@ enum pmic_op_type { * @driver - driver name for the sub-node with prefix */ struct pmic_child_info { + const char *addr; const char *prefix; const char *driver; };