From 90a979d7887ba75b05143f6704c9638e775635e2 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Fri, 16 Oct 2020 16:16:31 +0530 Subject: 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 Reviewed-by: Simon Glass Signed-off-by: Pratyush Yadav --- drivers/mux/mux-uclass.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'drivers/mux') 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", -- cgit v1.2.3