aboutsummaryrefslogtreecommitdiff
path: root/drivers/mux
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2020-10-16 16:16:31 +0530
committerTom Rini <trini@konsulko.com>2020-10-28 11:48:55 -0400
commit90a979d7887ba75b05143f6704c9638e775635e2 (patch)
tree89095058cf3dd7c955cbb287d86e113516ea8498 /drivers/mux
parent0ad40b2463053947da052e74be72938fa5e4735e (diff)
downloadu-boot-90a979d7887ba75b05143f6704c9638e775635e2.zip
u-boot-90a979d7887ba75b05143f6704c9638e775635e2.tar.gz
u-boot-90a979d7887ba75b05143f6704c9638e775635e2.tar.bz2
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')
-rw-r--r--drivers/mux/mux-uclass.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mux/mux-uclass.c b/drivers/mux/mux-uclass.c
index 815df93..a35c3d9 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",