mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrej Picej <andrej.picej@norik.com>
To: barebox@lists.infradead.org
Cc: upstream@lists.phytec.de
Subject: [PATCH v2 2/2] ARM: boards: phytec-som-imx6: probe all gpio devices before PMIC
Date: Tue, 29 Mar 2022 09:33:33 +0200	[thread overview]
Message-ID: <20220329073333.435822-2-andrej.picej@norik.com> (raw)
In-Reply-To: <20220329073333.435822-1-andrej.picej@norik.com>

GPIO lines in da9063 are assigned dynamically, while majority of SOC
GPIO drivers assign their GPIOs in static manner (GPIO line numbers can
be calculated).

This introduces regression if deep probe support is used. If da9063
GPIOs are registered before the SOCs GPIOs, there is a good chance that
the SOCs statically computed GPIO line numbers will already be used by
PMIC.

Ensure all SOCs GPIO drivers and GPIO lines get registered before the
da9063 registers its own gpiochip.

Signed-off-by: Andrej Picej <andrej.picej@norik.com>
---
Changes in v2:
- move function from da9062 probe to board file
---
 arch/arm/boards/phytec-som-imx6/board.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c
index 1e515a093a..5dc7f676ed 100644
--- a/arch/arm/boards/phytec-som-imx6/board.c
+++ b/arch/arm/boards/phytec-som-imx6/board.c
@@ -111,6 +111,10 @@ static int phycore_da9062_setup_buck_mode(void)
 	if (!pmic_np)
 		return -ENODEV;
 
+	ret = of_device_ensure_probed_by_alias_stem(pmic_np, "gpio");
+	if (ret)
+		return ret;
+
 	ret = of_device_ensure_probed(pmic_np);
 	if (ret)
 		return ret;
-- 
2.25.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-03-29  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  7:33 [PATCH v2 1/2] of: implement new of_device_ensure_probed_by_alias_stem Andrej Picej
2022-03-29  7:33 ` Andrej Picej [this message]
2022-03-29  8:56 ` Sascha Hauer
2022-03-29 10:43   ` Andrej Picej

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=20220329073333.435822-2-andrej.picej@norik.com \
    --to=andrej.picej@norik.com \
    --cc=barebox@lists.infradead.org \
    --cc=upstream@lists.phytec.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