Re: [PATCH] dt-bindings: dma: fsl,imx-dma: Convert to dtschema

From: Daniel Baluta
Date: Tue Jun 04 2024 - 08:53:53 EST


On Thu, May 30, 2024 at 7:06 PM Frank Li <Frank.li@xxxxxxx> wrote:
>
> On Thu, May 30, 2024 at 12:51:07PM +0530, Animesh Agarwal wrote:
> > Convert the fsl i.MX DMA controller bindings to DT schema
>
> nit: need "." after sentence.
>
> >
> > Signed-off-by: Animesh Agarwal <animeshagarwal28@xxxxxxxxx>
> > ---
> > .../devicetree/bindings/dma/fsl,imx-dma.yaml | 58 +++++++++++++++++++
> > .../devicetree/bindings/dma/fsl-imx-dma.txt | 50 ----------------
> > 2 files changed, 58 insertions(+), 50 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/dma/fsl,imx-dma.yaml
> > delete mode 100644 Documentation/devicetree/bindings/dma/fsl-imx-dma.txt
> >
> > diff --git a/Documentation/devicetree/bindings/dma/fsl,imx-dma.yaml b/Documentation/devicetree/bindings/dma/fsl,imx-dma.yaml
> > new file mode 100644
> > index 000000000000..f36ab5425bdb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/dma/fsl,imx-dma.yaml
> > @@ -0,0 +1,58 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/dma/fsl,imx-dma.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Freescale Direct Memory Access (DMA) Controller for i.MX
> > +
> > +maintainers:
> > + - Animesh Agarwal <animeshagarwal28@xxxxxxxxx>
> > +
> > +allOf:
> > + - $ref: dma-controller.yaml#
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - fsl,imx1-dma
> > + - fsl,imx21-dma
> > + - fsl,imx27-dma
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + interrupts:
> > + description: |
> > + First item should be DMA interrupt, second one is optional and
> > + should contain DMA Error interrupt.
>
> items:
> - description: DMA complete interrupt
> - description: DMA Error interrupt
>
> > + minItems: 1
> > + maxItems: 2
> > +
> > + "#dma-cells":
> > + const: 1
> > +
> > + dma-channels:
> > + const: 16
>
> I think it should be maximum: 16

As Krzysztof pointed out and looking at datasheet and driver implementation, we
always use 16 channels. Nothing less or variable.

So const: 16 I think it is correct!

Another, thing. Should we keep both

dma-channels
and
#dma-channels?

I wonder what is the correct way to put #dma-channels

Like this:

#dma-channels:
deprecated

or

'#dma-channels':
deprecated


The rest looks good to me.

Thanks for doing this Animesh!