All of lore.kernel.org
 help / color / mirror / Atom feed
* Why drivers don't depend on CONFIG_REGULATOR?
@ 2014-07-30  9:51 Angelo Compagnucci
  2014-07-30 13:01 ` Lars-Peter Clausen
  0 siblings, 1 reply; 4+ messages in thread
From: Angelo Compagnucci @ 2014-07-30  9:51 UTC (permalink / raw)
  To: linux-iio

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!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why drivers don't depend on CONFIG_REGULATOR?
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2014-07-30 13:01 UTC (permalink / raw)
  To: Angelo Compagnucci, linux-iio

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why drivers don't depend on CONFIG_REGULATOR?
  2014-07-30 13:01 ` Lars-Peter Clausen
@ 2014-07-30 13:23   ` Angelo Compagnucci
  2014-07-30 14:00     ` Lars-Peter Clausen
  0 siblings, 1 reply; 4+ messages in thread
From: Angelo Compagnucci @ 2014-07-30 13:23 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

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?

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
>



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why drivers don't depend on CONFIG_REGULATOR?
  2014-07-30 13:23   ` Angelo Compagnucci
@ 2014-07-30 14:00     ` Lars-Peter Clausen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2014-07-30 14:00 UTC (permalink / raw)
  To: Angelo Compagnucci; +Cc: linux-iio

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
>>
>
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-30 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.