From ff8af86c1eddfb64205076db5b5417693d858db9 Mon Sep 17 00:00:00 2001 From: Jishnu Prakash Date: Tue, 15 Sep 2020 18:26:20 +0530 Subject: [PATCH 1/2] dt-bindings: iio: qcom,spmi-vadc: Add compatible string for ADC lite driver Add the compatible string for ADC-lite driver for reading parallel charger current channel. Change-Id: Ie0d3f90d06be4bf28661736058c5d1fb2af1ac8f Signed-off-by: Jishnu Prakash [quic_amelende@quicinc.com: converted binding change from .txt to .yaml] Signed-off-by: Anjelique Melendez --- bindings/iio/adc/qcom,spmi-vadc.yaml | 31 ++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/bindings/iio/adc/qcom,spmi-vadc.yaml b/bindings/iio/adc/qcom,spmi-vadc.yaml index ad7d6fc4..79b3b87c 100644 --- a/bindings/iio/adc/qcom,spmi-vadc.yaml +++ b/bindings/iio/adc/qcom,spmi-vadc.yaml @@ -25,6 +25,7 @@ properties: - enum: - qcom,spmi-vadc - qcom,spmi-adc5 + - qcom,spmi-adc5-lite - qcom,spmi-adc-rev2 - qcom,spmi-adc7 @@ -114,10 +115,9 @@ patternProperties: channel calibration. If property is not found, channel will be calibrated with 0.625V and 1.25V reference channels, also known as absolute calibration. - - For compatible property "qcom,spmi-adc5", "qcom,spmi-adc7" and - "qcom,spmi-adc-rev2", if this property is specified VADC will use - the VDD reference (1.875V) and GND for channel calibration. If - property is not found, channel will be calibrated with 0V and 1.25V + - For all other compatible properties, if this property is specified + VADC will use the VDD reference (1.875V) and GND for channel calibration. + If property is not found, channel will be calibrated with 0V and 1.25V reference channels, also known as absolute calibration. type: boolean @@ -209,6 +209,29 @@ allOf: enum: [ 1, 2, 4, 8, 16 ] default: 1 + - if: + properties: + compatible: + contains: + const: qcom,spmi-adc5-lite + + then: + patternProperties: + "^channel@[0-9a-f]+$": + properties: + qcom,decimation: + enum: [ 250, 420, 840 ] + default: 840 + + qcom,hw-settle-time: + enum: [ 15, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1, 2, + 4, 6, 8, 10] + default: 15 + + qcom,avg-samples: + enum: [ 1, 2, 4, 8, 16 ] + default: 1 + - if: properties: compatible: From 17533b38e26a8d3c03fd9652a970a3ccafd8c3dc Mon Sep 17 00:00:00 2001 From: Jishnu Prakash Date: Thu, 3 Sep 2020 16:29:33 -0700 Subject: [PATCH 2/2] dt-bindings: iio: qcom,spmi-vadc: update prescale ratios Update prescale ratios to support the new channels. Change-Id: I4d37e9653962954e856f464df32297d9aa90757a Signed-off-by: Jishnu Prakash [quic_amelende@quicinc.com: Converted binding change from .txt to .yaml] Signed-off-by: Anjelique Melendez --- bindings/iio/adc/qcom,spmi-vadc.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/iio/adc/qcom,spmi-vadc.yaml b/bindings/iio/adc/qcom,spmi-vadc.yaml index 79b3b87c..55af1348 100644 --- a/bindings/iio/adc/qcom,spmi-vadc.yaml +++ b/bindings/iio/adc/qcom,spmi-vadc.yaml @@ -106,6 +106,12 @@ patternProperties: - items: - const: 10 - const: 81 + - items: + - enum: [ 32, 14, 28 ] + - const: 100 + - items: + - const: 1000 + - enum: [ 305185, 610370 ] qcom,ratiometric: description: |