All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>
Subject: Re: Why drivers don't depend on CONFIG_REGULATOR?
Date: Wed, 30 Jul 2014 16:00:18 +0200	[thread overview]
Message-ID: <53D8FA72.3050204@metafoo.de> (raw)
In-Reply-To: <CA+TH9VkMzi1U1C1GagBTEcQ_3E4vGiKoa+2mz-MNiA8x4O5udQ@mail.gmail.com>

On 07/30/2014 03:23 PM, Angelo Compagnucci wrote:
> Hi Lars,
>
> I have this fixed regulator in my device tree:
>
> adc_supply: fixedregulator {
>    compatible = "regulator-fixed";
>    regulator-name = "fixed-supply";
>    regulator-min-microvolt = <3300000>;
>    regulator-max-microvolt = <3300000>;
>    regulator-boot-on;
> };
>
> With CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y:
>
> # cat in_voltage0_raw in_voltage_scale
> 4095
> 0.805664062
>
> 4095 * 0.805664062 = 3299.19433389, OK wonderful!
>
> With CONFIG_REGULATOR not set:
>
> # cat in_voltage0_raw in_voltage_scale
> 4095
> cat: read error: Invalid argument
>
> How do you cope with something like this? Is this expected?

We don't really handle this a t the moment. I guess ideally we wouldn't show 
the scale attribute in this case.

>
> Thank you for your time!
>
> 2014-07-30 15:01 GMT+02:00 Lars-Peter Clausen <lars@metafoo.de>:
>> On 07/30/2014 11:51 AM, Angelo Compagnucci wrote:
>>>
>>> Hello List,
>>>
>>> I wasted a little bit of my time this morning understanding why the
>>> regulator I used in my device tree wasn't working, only to discover
>>> later that the regulator support was not enabled in my config.
>>>
>>> I think that all the drivers that use a regulator should depend on the
>>> CONFIG_REGULATOR.
>>>
>>> Is there a reason why any driver has "depends on REGULATOR" in their
>>> Kconfig entry?
>>>
>>> Thank you for your time!
>>
>>
>> Hi,
>>
>> A lot of drivers work just fine without regulator support enabled. When
>> disabled the regulator API stubs itself out with dummy function that always
>> succeed.
>>
>> - Lars
>>
>
>
>


      reply	other threads:[~2014-07-30 14:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  9:51 Why drivers don't depend on CONFIG_REGULATOR? Angelo Compagnucci
2014-07-30 13:01 ` Lars-Peter Clausen
2014-07-30 13:23   ` Angelo Compagnucci
2014-07-30 14:00     ` Lars-Peter Clausen [this message]

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=53D8FA72.3050204@metafoo.de \
    --to=lars@metafoo.de \
    --cc=angelo.compagnucci@gmail.com \
    --cc=linux-iio@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 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.