mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] regulator: core: always use enable_delay when enabling regulators
Date: Thu, 20 May 2021 01:12:24 +0300	[thread overview]
Message-ID: <20210519221224.2868496-2-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20210519221224.2868496-1-dmitry.baryshkov@linaro.org>

Some regulators (e.g. fixed) do not have .enable callback per se, but
use supply regulator and enable_delay. Do not return early from
_regulator_do_enable in such cases, so that enable_delay is properly
handled.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/regulator/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e20e77e4c159..66c465bd00ca 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2516,7 +2516,8 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
 		ret = rdev->desc->ops->enable(rdev);
 		if (ret < 0)
 			return ret;
-	} else {
+	} else if (!rdev->supply) {
+		/* Still handle delay if the regulator was just turned on using the supply */
 		return -EINVAL;
 	}
 
-- 
2.30.2


  reply	other threads:[~2021-05-19 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 22:12 [PATCH 1/2] regulator: core: resolve supply for boot-on/always-on regulators Dmitry Baryshkov
2021-05-19 22:12 ` Dmitry Baryshkov [this message]
2021-05-20 11:57   ` [PATCH 2/2] regulator: core: always use enable_delay when enabling regulators Mark Brown
2021-06-02 13:14     ` Dmitry Baryshkov
2021-06-03 10:27       ` Mark Brown
2021-05-20 21:08 ` (subset) [PATCH 1/2] regulator: core: resolve supply for boot-on/always-on regulators Mark Brown

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=20210519221224.2868496-2-dmitry.baryshkov@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    /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

all inboxes | Powered by JetHome®