mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Frank Wunderlich <frank-w@public-files.de>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 5/6] regulator: fixed: request vin-supply as needed
Date: Sun, 24 Jul 2022 08:06:28 +0200	[thread overview]
Message-ID: <20220724060629.1772193-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220724060629.1772193-1-a.fatoum@pengutronix.de>

So far, we never considered fixed-regulator vin-supply. This worked as
long as the vin-supply on the board was already turned on.

Do as Linux does and request vin-supply as needed. For deep probe
enabled boards, this may result in breakage that can be resolved with
barebox,allow-dummy-supply. For other boards, a warning will be
printed and the vin-supply populated with the dummy regulator.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
  - new patch
---
 drivers/regulator/fixed.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index ec64f39b86c7..bdb01c0a9554 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -72,6 +72,9 @@ static int regulator_fixed_probe(struct device_d *dev)
 	if (!of_property_read_u32(np, "off-on-delay-us", &delay))
 		fix->rdesc.off_on_delay = delay;
 
+	if (of_find_property(np, "vin-supply", NULL))
+		fix->rdesc.supply_name = "vin";
+
 	ret = of_regulator_register(&fix->rdev, np);
 	if (ret)
 		goto err;
-- 
2.30.2




  parent reply	other threads:[~2022-07-24  6:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  6:06 [PATCH v2 1/6] mfd: implement mfd_add_devices Ahmad Fatoum
2022-07-24  6:06 ` [PATCH v2 2/6] regmap: implement regmap_init_i2c_smbus Ahmad Fatoum
2022-07-24  6:06 ` [PATCH v2 3/6] regulator: consult min_uv, max_uv for regulator_get_voltage Ahmad Fatoum
2022-07-24  6:06 ` [PATCH v2 4/6] regulator: recursively enable/disable regulator dependency tree Ahmad Fatoum
2022-07-24  6:06 ` Ahmad Fatoum [this message]
2022-07-24  6:06 ` [PATCH v2 6/6] regulator: add Rockchip rk808 support Ahmad Fatoum

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=20220724060629.1772193-5-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=frank-w@public-files.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