From: Vignesh Raghavendra <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/4] dm: board: complete the initialization of the muxes in initr_dm()
Date: Tue, 5 Nov 2019 18:35:09 +0530 [thread overview]
Message-ID: <b802d832-a672-25b3-c06f-22aa58ef04ec@ti.com> (raw)
In-Reply-To: <20191105115019.25484-3-jjhiblot@ti.com>
Hi JJ,
On 05/11/19 5:20 PM, Jean-Jacques Hiblot wrote:
> 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>
>
> ---
[...]
> diff --git a/drivers/mux/mux-uclass.c b/drivers/mux/mux-uclass.c
> index 6aaf4dc964..71392e9e50 100644
> --- a/drivers/mux/mux-uclass.c
> +++ b/drivers/mux/mux-uclass.c
> @@ -262,6 +262,28 @@ int mux_uclass_post_probe(struct udevice *dev)
> return 0;
> }
>
> +void dm_mux_init(void)
> +{
> + struct uclass *uc;
> + struct udevice *dev;
> + int ret;
> +
> + ret = uclass_get(UCLASS_MUX, &uc);
> + if (ret < 0) {
> + debug("unable to get MUX uclass\n");
> + return;
> + }
> + uclass_foreach_dev(dev, uc) {
> + if (dev_read_bool(dev, "u-boot,mux-autoprobe")) {
> + ret = device_probe(dev);
> + if (ret)
> + debug("unable to probe device %s\n", dev->name);
> + } else {
> + printf("not found for dev %s\n", dev->name);
> + }
Is "u-boot,mux-autoprobe" a required property? The fact that its in DT
makes me think its optional. If that's the case, above printf() should
be reduced to debug() to avoid confusion
> + }
> +}
> +
> UCLASS_DRIVER(mux) = {
> .id = UCLASS_MUX,
> .name = "mux",
> diff --git a/include/mux.h b/include/mux.h
> index 060f71a47c..2467723951 100644
> --- a/include/mux.h
> +++ b/include/mux.h
> @@ -75,6 +75,8 @@ void mux_control_put(struct mux_control *mux);
>
> struct mux_control *devm_mux_control_get(struct udevice *dev,
> const char *mux_name);
> +void dm_mux_init(void);
> +
> #else
> unsigned int mux_control_states(struct mux_control *mux)
> {
>
--
Regards
Vignesh
next prev parent reply other threads:[~2019-11-05 13:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 11:50 [U-Boot] [PATCH v2 0/4] drivers: Add a framework for MUX drivers Jean-Jacques Hiblot
2019-11-05 11:50 ` [U-Boot] [PATCH v2 1/4] drivers: Add a new framework for multiplexer devices Jean-Jacques Hiblot
2019-12-24 15:58 ` Simon Glass
2019-11-05 11:50 ` [U-Boot] [PATCH v2 2/4] dm: board: complete the initialization of the muxes in initr_dm() Jean-Jacques Hiblot
2019-11-05 13:05 ` Vignesh Raghavendra [this message]
2019-11-05 15:13 ` Jean-Jacques Hiblot
2019-12-24 15:58 ` Simon Glass
2019-11-05 11:50 ` [U-Boot] [PATCH v2 3/4] drivers: mux: mmio-based syscon mux controller Jean-Jacques Hiblot
2019-11-08 12:16 ` Alexandru Marginean
2019-11-08 16:25 ` Jean-Jacques Hiblot
2019-12-24 15:58 ` Simon Glass
2019-11-05 11:50 ` [U-Boot] [PATCH v2 4/4] test: Add tests for the multiplexer framework Jean-Jacques Hiblot
2019-12-24 15:58 ` Simon Glass
2019-12-24 16:02 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b802d832-a672-25b3-c06f-22aa58ef04ec@ti.com \
--to=vigneshr@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox