[PATCH v2 2/3] dt-bindings: iio: adc: add IIO backend support

Ioana Risteiu posted 3 patches 1 month, 4 weeks ago
There is a newer version of this series
[PATCH v2 2/3] dt-bindings: iio: adc: add IIO backend support
Posted by Ioana Risteiu 1 month, 4 weeks ago
Add the generic io-backends property to the AD7779 binding to enable
support for the IIO backend framework.

Also add the adi,num-lanes property to set the number of lanes used by
AD7779.

Signed-off-by: Ioana Risteiu <Ioana.Risteiu@analog.com>
---
 .../bindings/iio/adc/adi,ad7779.yaml          | 34 ++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml
index 044f92f39cfa..4205ac29c824 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml
@@ -80,11 +80,27 @@ properties:
   reset-gpios:
     maxItems: 1
 
+  io-backends:
+    maxItems: 1
+
+  adi,num-lanes:
+    description: |
+      Number of lanes on which the data is sent on the output when the data
+      output interface is used.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [1, 2, 4]
+    default: 4
+
 required:
   - compatible
   - reg
   - clocks
-  - interrupts
+
+oneOf:
+  - required:
+      - interrupts
+  - required:
+      - io-backends
 
 unevaluatedProperties: false
 
@@ -107,4 +123,20 @@ examples:
           clocks = <&adc_clk>;
         };
     };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+          compatible = "adi,ad7779";
+          reg = <0>;
+          start-gpios = <&gpio0 87 GPIO_ACTIVE_LOW>;
+          reset-gpios = <&gpio0 93 GPIO_ACTIVE_LOW>;
+          clocks = <&adc_clk>;
+          io-backends = <&iio_backend>;
+        };
+    };
 ...
-- 
2.47.2
Re: [PATCH v2 2/3] dt-bindings: iio: adc: add IIO backend support
Posted by Krzysztof Kozlowski 1 month, 4 weeks ago
On Wed, Aug 06, 2025 at 10:24:59PM +0300, Ioana Risteiu wrote:
> Add the generic io-backends property to the AD7779 binding to enable
> support for the IIO backend framework.
> 
> Also add the adi,num-lanes property to set the number of lanes used by
> AD7779.
> 
> Signed-off-by: Ioana Risteiu <Ioana.Risteiu@analog.com>
> ---
>  .../bindings/iio/adc/adi,ad7779.yaml          | 34 ++++++++++++++++++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml
> index 044f92f39cfa..4205ac29c824 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7779.yaml
> @@ -80,11 +80,27 @@ properties:
>    reset-gpios:
>      maxItems: 1
>  
> +  io-backends:
> +    maxItems: 1
> +
> +  adi,num-lanes:

I see @Rob already reviewed one other binding with adi,num-lanes instead
of asking to re-use PCI num-lanes property, so I guess this is fine.


> +    description: |

Drop |

> +      Number of lanes on which the data is sent on the output when the data
> +      output interface is used.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [1, 2, 4]
> +    default: 4
> +
>  required:
>    - compatible
>    - reg
>    - clocks
> -  - interrupts
> +
> +oneOf:
> +  - required:
> +      - interrupts
> +  - required:
> +      - io-backends
>  
>  unevaluatedProperties: false
>  
> @@ -107,4 +123,20 @@ examples:
>            clocks = <&adc_clk>;
>          };
>      };
> +
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        adc@0 {
> +          compatible = "adi,ad7779";
> +          reg = <0>;
> +          start-gpios = <&gpio0 87 GPIO_ACTIVE_LOW>;
> +          reset-gpios = <&gpio0 93 GPIO_ACTIVE_LOW>;
> +          clocks = <&adc_clk>;
> +          io-backends = <&iio_backend>;

Make it complete if you add completely new example - num-lanes.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof