diff mbox series

[v8,2/7] dt-bindings: adc: axi-adc: update bindings for backend framework

Message ID 20240202-iio-backend-v8-2-f65ee8c8203d@analog.com
State Changes Requested
Headers show
Series iio: add new backend framework | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dt-meta-schema fail build log

Commit Message

Nuno Sa via B4 Relay Feb. 2, 2024, 3:08 p.m. UTC
From: Nuno Sa <nuno.sa@analog.com>

'adi,adc-dev' is now deprecated and must not be used anymore. Hence,
also remove it from being required.

The reason why it's being deprecated is because the axi-adc CORE is now
an IIO service provider hardware (IIO backends) for consumers to make use
of. Before, the logic with 'adi,adc-dev' was the opposite (it was kind
of consumer referencing other nodes/devices) and that proved to be wrong
and to not scale.

Now, IIO consumers of this hardware are expected to reference it using the
io-backends property. Hence, the new '#io-backend-cells' is being added
so the device is easily identified as a provider.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Rob Herring Feb. 2, 2024, 4:35 p.m. UTC | #1
On Fri, 02 Feb 2024 16:08:33 +0100, Nuno Sa wrote:
> 'adi,adc-dev' is now deprecated and must not be used anymore. Hence,
> also remove it from being required.
> 
> The reason why it's being deprecated is because the axi-adc CORE is now
> an IIO service provider hardware (IIO backends) for consumers to make use
> of. Before, the logic with 'adi,adc-dev' was the opposite (it was kind
> of consumer referencing other nodes/devices) and that proved to be wrong
> and to not scale.
> 
> Now, IIO consumers of this hardware are expected to reference it using the
> io-backends property. Hence, the new '#io-backend-cells' is being added
> so the device is easily identified as a provider.
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> ---
>  Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml:45:5: [error] syntax error: could not find expected ':' (syntax)

dtschema/dtc warnings/errors:
make[2]: *** Deleting file 'Documentation/devicetree/bindings/iio/adc/adi,axi-adc.example.dts'
Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml:45:5: could not find expected ':'
make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/iio/adc/adi,axi-adc.example.dts] Error 1
make[2]: *** Waiting for unfinished jobs....
./Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml:45:5: could not find expected ':'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml: ignoring, error parsing file
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1428: dt_binding_check] Error 2
make: *** [Makefile:240: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240202-iio-backend-v8-2-f65ee8c8203d@analog.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
David Lechner Feb. 2, 2024, 9:38 p.m. UTC | #2
On Fri, Feb 2, 2024 at 9:10 AM Nuno Sa via B4 Relay
<devnull+nuno.sa.analog.com@kernel.org> wrote:
>
> From: Nuno Sa <nuno.sa@analog.com>
>
> 'adi,adc-dev' is now deprecated and must not be used anymore. Hence,
> also remove it from being required.
>
> The reason why it's being deprecated is because the axi-adc CORE is now
> an IIO service provider hardware (IIO backends) for consumers to make use
> of. Before, the logic with 'adi,adc-dev' was the opposite (it was kind
> of consumer referencing other nodes/devices) and that proved to be wrong
> and to not scale.
>
> Now, IIO consumers of this hardware are expected to reference it using the
> io-backends property. Hence, the new '#io-backend-cells' is being added
> so the device is easily identified as a provider.
>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> ---
>  Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> index 9996dd93f84b..add10b22dcac 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> @@ -39,12 +39,15 @@ properties:
>      $ref: /schemas/types.yaml#/definitions/phandle
>      description:
>        A reference to a the actual ADC to which this FPGA ADC interfaces to.
> +    deprecated: true
> +
> +  '#io-backends-cells'

Still missing the : here.

> +    const: 0
>
>  required:
>    - compatible
>    - dmas
>    - reg
> -  - adi,adc-dev
>
>  additionalProperties: false
>
> @@ -55,7 +58,6 @@ examples:
>          reg = <0x44a00000 0x10000>;
>          dmas = <&rx_dma 0>;
>          dma-names = "rx";
> -
> -        adi,adc-dev = <&spi_adc>;
> +        #io-backends-cells = <0>;
>      };
>  ...
>
> --
> 2.43.0
>
>
Nuno Sa Feb. 4, 2024, 7:30 a.m. UTC | #3
> -----Original Message-----
> From: David Lechner <dlechner@baylibre.com>
> Sent: Friday, February 2, 2024 10:38 PM
> To: Sa, Nuno <Nuno.Sa@analog.com>
> Cc: linux-iio@vger.kernel.org; devicetree@vger.kernel.org; Lars-Peter Clausen
> <lars@metafoo.de>; Hennerich, Michael <Michael.Hennerich@analog.com>;
> Jonathan Cameron <jic23@kernel.org>; Rob Herring <robh+dt@kernel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Frank Rowand <frowand.list@gmail.com>; Olivier
> Moysan <olivier.moysan@foss.st.com>; Rob Herring <robh@kernel.org>
> Subject: Re: [PATCH v8 2/7] dt-bindings: adc: axi-adc: update bindings for backend
> framework
> 
> 
> On Fri, Feb 2, 2024 at 9:10 AM Nuno Sa via B4 Relay
> <devnull+nuno.sa.analog.com@kernel.org> wrote:
> >
> > From: Nuno Sa <nuno.sa@analog.com>
> >
> > 'adi,adc-dev' is now deprecated and must not be used anymore. Hence,
> > also remove it from being required.
> >
> > The reason why it's being deprecated is because the axi-adc CORE is now
> > an IIO service provider hardware (IIO backends) for consumers to make use
> > of. Before, the logic with 'adi,adc-dev' was the opposite (it was kind
> > of consumer referencing other nodes/devices) and that proved to be wrong
> > and to not scale.
> >
> > Now, IIO consumers of this hardware are expected to reference it using the
> > io-backends property. Hence, the new '#io-backend-cells' is being added
> > so the device is easily identified as a provider.
> >
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > ---
> >  Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> > index 9996dd93f84b..add10b22dcac 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> > +++ b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> > @@ -39,12 +39,15 @@ properties:
> >      $ref: /schemas/types.yaml#/definitions/phandle
> >      description:
> >        A reference to a the actual ADC to which this FPGA ADC interfaces to.
> > +    deprecated: true
> > +
> > +  '#io-backends-cells'
> 
> Still missing the : here.

Ahh crap!! I was so blindly assuming the error report was because the property could
still be missing in the core schemas that I did not even paid attention. Thanks for this!

But worst, the property is not even correct. #io-backends-cells -> #io-backend-cells
Both here and in the example.

Jonathan, sorry about this... Let me know if this is something you can fix or if you
want me to spin another version.

- Nuno Sá
Jonathan Cameron Feb. 4, 2024, 2:51 p.m. UTC | #4
On Sun, 4 Feb 2024 07:30:05 +0000
"Sa, Nuno" <Nuno.Sa@analog.com> wrote:

> > -----Original Message-----
> > From: David Lechner <dlechner@baylibre.com>
> > Sent: Friday, February 2, 2024 10:38 PM
> > To: Sa, Nuno <Nuno.Sa@analog.com>
> > Cc: linux-iio@vger.kernel.org; devicetree@vger.kernel.org; Lars-Peter Clausen
> > <lars@metafoo.de>; Hennerich, Michael <Michael.Hennerich@analog.com>;
> > Jonathan Cameron <jic23@kernel.org>; Rob Herring <robh+dt@kernel.org>;
> > Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> > <conor+dt@kernel.org>; Frank Rowand <frowand.list@gmail.com>; Olivier
> > Moysan <olivier.moysan@foss.st.com>; Rob Herring <robh@kernel.org>
> > Subject: Re: [PATCH v8 2/7] dt-bindings: adc: axi-adc: update bindings for backend
> > framework
> > 
> > 
> > On Fri, Feb 2, 2024 at 9:10 AM Nuno Sa via B4 Relay
> > <devnull+nuno.sa.analog.com@kernel.org> wrote:  
> > >
> > > From: Nuno Sa <nuno.sa@analog.com>
> > >
> > > 'adi,adc-dev' is now deprecated and must not be used anymore. Hence,
> > > also remove it from being required.
> > >
> > > The reason why it's being deprecated is because the axi-adc CORE is now
> > > an IIO service provider hardware (IIO backends) for consumers to make use
> > > of. Before, the logic with 'adi,adc-dev' was the opposite (it was kind
> > > of consumer referencing other nodes/devices) and that proved to be wrong
> > > and to not scale.
> > >
> > > Now, IIO consumers of this hardware are expected to reference it using the
> > > io-backends property. Hence, the new '#io-backend-cells' is being added
> > > so the device is easily identified as a provider.
> > >
> > > Reviewed-by: Rob Herring <robh@kernel.org>
> > > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > > ---
> > >  Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml | 8 +++++---
> > >  1 file changed, 5 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml  
> > b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml  
> > > index 9996dd93f84b..add10b22dcac 100644
> > > --- a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
> > > @@ -39,12 +39,15 @@ properties:
> > >      $ref: /schemas/types.yaml#/definitions/phandle
> > >      description:
> > >        A reference to a the actual ADC to which this FPGA ADC interfaces to.
> > > +    deprecated: true
> > > +
> > > +  '#io-backends-cells'  
> > 
> > Still missing the : here.  
> 
> Ahh crap!! I was so blindly assuming the error report was because the property could
> still be missing in the core schemas that I did not even paid attention. Thanks for this!
> 
> But worst, the property is not even correct. #io-backends-cells -> #io-backend-cells
> Both here and in the example.
> 
> Jonathan, sorry about this... Let me know if this is something you can fix or if you
> want me to spin another version.
I've tried to fix it up.  Please check the testing branch to see if I messed it up.

> 
> - Nuno Sá
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
index 9996dd93f84b..add10b22dcac 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
@@ -39,12 +39,15 @@  properties:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
       A reference to a the actual ADC to which this FPGA ADC interfaces to.
+    deprecated: true
+
+  '#io-backends-cells'
+    const: 0
 
 required:
   - compatible
   - dmas
   - reg
-  - adi,adc-dev
 
 additionalProperties: false
 
@@ -55,7 +58,6 @@  examples:
         reg = <0x44a00000 0x10000>;
         dmas = <&rx_dma 0>;
         dma-names = "rx";
-
-        adi,adc-dev = <&spi_adc>;
+        #io-backends-cells = <0>;
     };
 ...