Re: Why drivers don't depend on CONFIG_REGULATOR?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>:
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





--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux