Thread (1 message) 1 message, 1 author, 2016-10-27

Re: [PATCH V3 2/2] iio: adc: spmi-vadc: Changes to support different scaling

From: Stanimir Varbanov <hidden>
Date: 2016-10-27 11:18:42
Also in: linux-arm-msm, linux-iio

Possibly related (same subject, not in this thread)

Hi Rama,

On 10/26/2016 05:41 PM, Rama Krishna Phani A wrote:
quoted hunk
Polling can also be used for End of conversion completion. Implement logic
to choose either polling or interrupt for End of conversion completion.
Scaling can be done on the voltage to report adc code in physical units.
Add changes to support different scale functions to convert adc code to
physical units.

Signed-off-by: Rama Krishna Phani A <redacted>
---
 .../devicetree/bindings/iio/adc/qcom,spmi-vadc.txt |  14 ++
 drivers/iio/adc/qcom-spmi-vadc.c                   | 263 +++++++++++++++++----
 2 files changed, 236 insertions(+), 41 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt
index 0fb4613..39e31c0e 100644
--- a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt
@@ -37,6 +37,12 @@ VADC node:
     Value type: <prop-encoded-array>
     Definition: End of conversion interrupt.
 
+- qcom,vadc-poll-eoc:
+    Usage: optional
+    Value type: <bool>
+    Definition: Use polling instead of interrupts for End of Conversion
+		completion.
Why you need to add such a flag in DT?

The DT should describe hardware details not how the driver will choose
pooling vs interrupt.

On which use-case you would prefer pooling?
quoted hunk
+
 Channel node properties:
 
 - reg:
@@ -92,6 +98,14 @@ Channel node properties:
             Valid values are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512
             If property is not found, 1 sample will be used.
 
+- qcom,scale-function:
+    Usage: optional
+    Value type: <u32>
+    Definition: Scaling function used to convert raw ADC code to
+	units specific to a given channel. Scaled units can be
+	microvolts, millidegC.Valid values are: 0, 1, 2, 3, 4.
+	If property is not found, 0 scaling will be used.
This shouldn't be in DT binding. Just select the scale function for each
channel in the driver based on compatible property.


-- 
regards,
Stan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help