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 10:17:49 +0200	[thread overview]
Message-ID: <EF34CBF3-67DE-4FC4-8B75-56786A106F52@svenschwermer.de> (raw)
In-Reply-To: <AM0PR04MB4481C4E381A93EAA8A7579A088190@AM0PR04MB4481.eurprd04.prod.outlook.com>

Hi Peng,

> According to code:
>        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))
>                ret = regulator_set_current(dev, uc_pdata->min_uA);
> 
> So you get -ENOSYS from the upper code?

Yes, for fixed regulators, the following if clause evaluates to true in regulator_pre_probe:

	/* Those values are optional (-ENODATA if unset) */
	if ((uc_pdata->min_uV != -ENODATA) &&
	    (uc_pdata->max_uV != -ENODATA) &&
	    (uc_pdata->min_uV == uc_pdata->max_uV))
		uc_pdata->flags |= REGULATOR_FLAG_AUTOSET_UV;

However, in regulator_set_value, there is this section:

	if (!ops || !ops->set_value)
		return -ENOSYS;

So for fixed regulators, which don’t have a set_value, we’ll always get a -ENOSYS.

Sven

  reply	other threads:[~2019-05-31  8:17 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 [this message]
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       ` [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=EF34CBF3-67DE-4FC4-8B75-56786A106F52@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.