mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] regulator: fixed: add off-on-delay-us device-tree parsing support
Date: Thu, 16 Jun 2022 16:07:37 +0200	[thread overview]
Message-ID: <20220616140737.2294226-2-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20220616140737.2294226-1-m.felsch@pengutronix.de>

The core already handles the off_on_delay if we set it. So parse the
official device-tree property and set it if present.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/regulator/fixed.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 9c660d5781..ae16df8a0c 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -52,6 +52,7 @@ static int regulator_fixed_probe(struct device_d *dev)
 {
 	struct device_node *np = dev->device_node;
 	struct regulator_fixed *fix;
+	u32 delay;
 	int ret;
 
 	if (!dev->device_node)
@@ -72,6 +73,9 @@ static int regulator_fixed_probe(struct device_d *dev)
 	fix->rdev.desc = &fix->rdesc;
 	fix->rdev.dev = dev;
 
+	if (!of_property_read_u32(np, "off-on-delay-us", &delay))
+		fix->rdesc.off_on_delay = delay;
+
 	if (of_find_property(np, "regulator-always-on", NULL) ||
 	    of_find_property(np, "regulator-boot-on", NULL)) {
 		fix->always_on = 1;
-- 
2.30.2




  reply	other threads:[~2022-06-16 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 14:07 [PATCH 1/2] regulator: fixed: use local device_node reference Marco Felsch
2022-06-16 14:07 ` Marco Felsch [this message]
2022-06-17  7:27 ` 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=20220616140737.2294226-2-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH 2/2] regulator: fixed: add off-on-delay-us device-tree parsing support' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox