diff mbox series

[v5,6/9] dt-bindings: iio: add vref support to sd modulator

Message ID 20240724153639.803263-7-olivier.moysan@foss.st.com (mailing list archive)
State Changes Requested
Headers show
Series iio: adc: dfsdm: add scaling support | expand

Commit Message

Olivier MOYSAN July 24, 2024, 3:36 p.m. UTC
Allow to specify the reference voltage used by the SD modulator.
When the SD modulator is defined as an IIO backend, the reference
voltage can be used to evaluate scaling information of the IIO device.
The reference voltage is not used otherwise.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 .../bindings/iio/adc/sigma-delta-modulator.yaml           | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Rob Herring (Arm) July 25, 2024, 1:44 p.m. UTC | #1
On Wed, Jul 24, 2024 at 05:36:34PM +0200, Olivier Moysan wrote:
> Allow to specify the reference voltage used by the SD modulator.
> When the SD modulator is defined as an IIO backend, the reference
> voltage can be used to evaluate scaling information of the IIO device.
> The reference voltage is not used otherwise.

You haven't tested that this works. Add 'vref-supply' to the example.

> 
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
>  .../bindings/iio/adc/sigma-delta-modulator.yaml           | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> index b245971fecb0..ff04ae08f264 100644
> --- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> @@ -31,6 +31,14 @@ anyOf:
>    - required: ['#io-backend-cells']
>    - required: ['#io-channel-cells']
>  
> +if:
> +  required:
> +    - '#io-backend-cells'
> +then:
> +  properties:
> +    vref-supply:
> +      description: Phandle to the vref input analog reference voltage.
> +

Do this instead:

properties:
  vref-supply:
    ...

dependencies:
  vref-supply: [ '#io-backend-cells' ]

>  additionalProperties: false
>  
>  examples:
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
index b245971fecb0..ff04ae08f264 100644
--- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
@@ -31,6 +31,14 @@  anyOf:
   - required: ['#io-backend-cells']
   - required: ['#io-channel-cells']
 
+if:
+  required:
+    - '#io-backend-cells'
+then:
+  properties:
+    vref-supply:
+      description: Phandle to the vref input analog reference voltage.
+
 additionalProperties: false
 
 examples: