All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Schwermer <sven@svenschwermer.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] regulator: Allow autosetting fixed regulators
Date: Wed, 12 Jun 2019 08:32:38 +0200	[thread overview]
Message-ID: <20190612063238.10192-1-sven@svenschwermer.de> (raw)
In-Reply-To: <AM0PR04MB44817D8B174F42A6BE39B6C088150@AM0PR04MB4481.eurprd04.prod.outlook.com>

Fixed regulators don't have a set_value method. Therefore, trying to
set their value will always return -ENOSYS.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
---
 drivers/power/regulator/regulator-uclass.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 9118b8eb39..76be95bcd1 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -238,6 +238,9 @@ int regulator_autoset(struct udevice *dev)
 	if (!uc_pdata->always_on && !uc_pdata->boot_on)
 		return -EMEDIUMTYPE;
 
+	if (uc_pdata->type == REGULATOR_TYPE_FIXED)
+		return regulator_set_enable(dev, true);
+
 	if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV)
 		ret = regulator_set_value(dev, uc_pdata->min_uV);
 	if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UA))
-- 
2.17.1

  reply	other threads:[~2019-06-12  6:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  7:27 [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators Sven Schwermer
2019-05-31  7:49 ` Peng Fan
2019-05-31  8:17   ` Sven Schwermer
2019-05-31  8:23     ` Peng Fan
2019-05-31  8:29       ` Sven Schwermer
2019-05-31  9:34 ` Peng Fan
2019-05-31 10:44   ` Sven Schwermer
2019-06-04  2:34     ` Peng Fan
2019-06-12  6:32       ` Sven Schwermer [this message]
2019-06-22 19:10         ` [U-Boot] [PATCH v2] " Simon Glass
2019-07-14 13:08         ` Tom Rini

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=20190612063238.10192-1-sven@svenschwermer.de \
    --to=sven@svenschwermer.de \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.