Re: [PATCH] staging:iio:lpc32xx_adc: Add scale/offset support

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

 



On Thu, 08 Nov 2012 15:38:01 +0000
Jonathan Cameron <jic23@xxxxxxxxxxxxxxxxxxxxx> wrote:

> Why not do this with regulators?  That would give a more flexible
> system and all that stuff is already well supported (if fixed voltages
> are supplied then used fixed regulators).

I agree that would probably be better. But for me that raise the
question of having this stuff in the ADC driver at all. Most ADC just
return a value from 0 to MAX and have no way to find out their supply
voltage. If we start with binding to regulators in the drivers we'll
soon get a lots of non-flexible and duplicated code.

It would be a lot nicer if the ADC channels could be bound to a
regulator and a transform function that compute a real world voltage out
of:
 - The ADC value
 - The ADC range
 - The regulator representing the ADC reference voltage

The simplest transform would be a linear curve with an optional offset,
but any kind of transform would also be possible allowing to represent
about any circuit that might be between the supply regulator and the ADC
input.

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