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] regulator: Allow autosetting fixed regulators
Date: Fri, 31 May 2019 12:44:23 +0200	[thread overview]
Message-ID: <4D62FB19-3335-4FE3-BA44-F993CBD69ADA@svenschwermer.de> (raw)
In-Reply-To: <AM0PR04MB4481ACF76B7383A604AE36FA88190@AM0PR04MB4481.eurprd04.prod.outlook.com>

> How about the following patch? not tested
> 
> 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))

That will probably work as well. It does, however, feel a little like a hack. What if there are other regulator types that require a similar workaround?

Sven

  reply	other threads:[~2019-05-31 10:44 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 [this message]
2019-06-04  2:34     ` Peng Fan
2019-06-12  6:32       ` [U-Boot] [PATCH v2] " Sven Schwermer
2019-06-22 19:10         ` 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=4D62FB19-3335-4FE3-BA44-F993CBD69ADA@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.