Re: [PATCH 2/3] dt-bindings: iio: wrapper: add io-channel-unit-converter

From: Phil Reid
Date: Tue Mar 27 2018 - 22:29:24 EST


On 27/03/2018 16:01, Peter Rosin wrote:
On 2018-03-27 00:23, Rob Herring wrote:
On Mon, Mar 19, 2018 at 06:02:45PM +0100, Peter Rosin wrote:
Allow linear scaling and modification of the type of an io-channel.

When an ADC channel measures the midpoint of a voltage divider, the
interesting voltage is often the voltage over the full resistance
of the divider. Likewise, measuring the voltage over a resistor is
often a way to get to the current through it.

This binding allows description of such hardware which is external
to the ADC.


*snip*

+++ b/Documentation/devicetree/bindings/iio/wrapper/io-channel-unit-converter.txt
@@ -0,0 +1,84 @@
+I/O channel unit converter bindings
+
+Allow linear scaling and modification of the type of an io-channel.
+
+When an ADC channel measures the midpoint of a voltage divider, the
+interesting voltage is often the voltage over the full resistance
+of the divider. Likewise, measuring the voltage over a resistor is
+often a way to get to the current through it.
+
+Required properties:
+- compatible : "io-channel-unit-converter"
Would this apply to something besides ADCs?
Not that I can think of. At the moment.


I like the concept. I can think of use case on my end to set a RADC (digital pot)
to set a threshold voltage. Being able to define the hardware scaling in the dt would be nice.
Which would allow all the hardware definition to be in the dt which would nice.
So this would be voltage -> resistance.

Setting a DAC voltage to set output current is also a distinct possibility.


--
Regards
Phil Reid