mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Michael Riesch <michael.riesch@wolfvision.net>
Subject: [PATCH 2/3] ARM: Wolfvision PF5: of_probe only once
Date: Tue,  1 Oct 2024 12:47:37 +0200	[thread overview]
Message-ID: <20241001104738.1069237-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20241001104738.1069237-1-s.hauer@pengutronix.de>

When overlays have been applied we have to call of_clk_init() and
of_probe() once to have the changes from the overlays take effect.  We
only have to do it once though after all overlays have been applied, not
after each overlay.

Doing it after each overlay has the undesired side effect that the VOP2
will be probed right after the io-expander board has been detected. At
that time the display overlay is not yet included, so the VOP2 probes
without the display and it won't be available later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/boards/wolfvision/common.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
index 9a56b39b01..fe3417e81f 100644
--- a/common/boards/wolfvision/common.c
+++ b/common/boards/wolfvision/common.c
@@ -48,8 +48,7 @@ int wolfvision_apply_overlay(const struct wv_overlay *overlay, char **files)
 			return ret;
 		}
 
-		of_clk_init();
-		of_probe();
+		return 1;
 	}
 
 	return 0;
@@ -106,6 +105,7 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
 				int num_extensions, char **overlays)
 {
 	int i, hwid, ret;
+	bool do_of_probe = false;
 
 	ret = of_device_ensure_probed_by_alias("saradc");
 	if (ret)
@@ -130,12 +130,19 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
 		if (overlay->name) {
 			pr_info("Detected %s %s\n", overlay->name,
 				extension->name);
-			wolfvision_apply_overlay(overlay, overlays);
+			ret = wolfvision_apply_overlay(overlay, overlays);
+			if (ret > 0)
+				do_of_probe = true;
 		} else {
 			pr_warning("Detected unknown %s HWID %d\n",
 				   extension->name, hwid);
 		}
 	}
 
+	if (do_of_probe) {
+		of_clk_init();
+		of_probe();
+	}
+
 	return 0;
 }
-- 
2.39.5




  reply	other threads:[~2024-10-01 10:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 10:47 [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Sascha Hauer
2024-10-01 10:47 ` Sascha Hauer [this message]
2024-10-01 10:47 ` [PATCH 3/3] ARM: Wolfvision PF5: add display overlay Sascha Hauer
2024-10-02  7:14 ` [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Michael Riesch
2024-10-02 11:58 ` Sascha Hauer

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=20241001104738.1069237-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=michael.riesch@wolfvision.net \
    /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