mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <groeck7@gmail.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Subject: Using an optional regulator in a driver running on a PC
Date: Sun, 26 Jan 2014 02:53:07 -0800	[thread overview]
Message-ID: <52E4E913.6030300@roeck-us.net> (raw)

Hi all,

I am currently writing a driver which uses an optional regulator
to determine a reference voltage. The regulator is truly optional;
if it is not there, the chip uses an internal reference voltage.

I am testing the driver on a PC which does not really have any
regulators installed or enabled. Kernel version is 3.13.

I noticed that the call to regulator_get() returns -EPROBE_DEFER.
Looking into the regulator core, this appears intentional; there is
obviously no devicetree entry, and there is no regulator device.
The regulator code always returns -EPROBE_DEFER in this case.
I also tried regulator_get_optional(), with the same results.

This leads to an interesting question: How are drivers which require
regulators (optional or not) supposed to run on a system
which does not support devicetree, and does not have any
regulators installed (such as a PC) ? REGULATOR_DUMMY
isn't there anymore, and the dummy code it replaces only
executes on devicetree based systems.

Also, how are non-dt systems supposed to determine if an optional
regulator exists or not ? AFAICS the regulator code always returns
-EPROBE_DEFER, which isn't very helpful. If I just assume that
-EPROBE_DEFER means that the regulator is not there, I end up with
a conflict with a system which _does_ support devicetree, where
-EPROBE_DEFER really means that the probe needs to be deferred.

Thanks,
Guenter


             reply	other threads:[~2014-01-26 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-26 10:53 Guenter Roeck [this message]
2014-01-26 12:39 ` 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=52E4E913.6030300@roeck-us.net \
    --to=groeck7@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®