dm: pmic: add "addr" field for binding children
If some child info->prefix are the same, try to distinguish them by parent addr. Example: pmic@20, pmic@1a... Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: I504cd887e232bb309d8e1790f6d55910172d08b5
This commit is contained in:
parent
d3f5f12c3c
commit
50454a094f
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue