diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2020-10-16 13:46:31 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-10-28 18:48:55 +0300 |
commit | 90a979d7887ba75b05143f6704c9638e775635e2 (patch) | |
tree | 89095058cf3dd7c955cbb287d86e113516ea8498 /drivers/mux/mux-uclass.c | |
parent | 0ad40b2463053947da052e74be72938fa5e4735e (diff) | |
download | u-boot-90a979d7887ba75b05143f6704c9638e775635e2.tar.xz |
dm: board: complete the initialization of the muxes in initr_dm()
This will probe the multiplexer devices that have a "u-boot,mux-autoprobe"
property. As a consequence they will be put in their idle state.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/mux/mux-uclass.c')
-rw-r--r-- | drivers/mux/mux-uclass.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mux/mux-uclass.c b/drivers/mux/mux-uclass.c index 815df938aa..a35c3d9c94 100644 --- a/drivers/mux/mux-uclass.c +++ b/drivers/mux/mux-uclass.c @@ -304,6 +304,29 @@ static int mux_uclass_post_probe(struct udevice *dev) return 0; } +int dm_mux_init(void) +{ + struct uclass *uc; + struct udevice *dev; + int ret; + + ret = uclass_get(UCLASS_MUX, &uc); + if (ret < 0) { + log_debug("unable to get MUX uclass\n"); + return ret; + } + uclass_foreach_dev(dev, uc) { + if (dev_read_bool(dev, "u-boot,mux-autoprobe")) { + ret = device_probe(dev); + if (ret) + log_debug("unable to probe device %s\n", + dev->name); + } + } + + return 0; +} + UCLASS_DRIVER(mux) = { .id = UCLASS_MUX, .name = "mux", |