From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
vkoul@kernel.org
Cc: robh+dt@kernel.org, sean.wang@mediatek.com,
matthias.bgg@gmail.com, long.cheng@mediatek.com,
dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] dt-bindings: dma: Convert mtk-uart-apdma to DT schema
Date: Wed, 16 Feb 2022 14:30:22 +0100 [thread overview]
Message-ID: <dc523c4f-e625-7651-2621-fe1aab574a5f@collabora.com> (raw)
In-Reply-To: <79a47f67-bb66-bad4-b6bc-c6a8c0ef25dc@canonical.com>
Il 16/02/22 14:26, Krzysztof Kozlowski ha scritto:
> On 16/02/2022 12:40, AngeloGioacchino Del Regno wrote:
>> Convert the MediaTek UART APDMA Controller binding to DT schema.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>> .../bindings/dma/mediatek,uart-dma.yaml | 112 ++++++++++++++++++
>> .../bindings/dma/mtk-uart-apdma.txt | 56 ---------
>> 2 files changed, 112 insertions(+), 56 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
>> delete mode 100644 Documentation/devicetree/bindings/dma/mtk-uart-apdma.txt
>>
>> diff --git a/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
>> new file mode 100644
>> index 000000000000..4583c8f535b2
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml
>> @@ -0,0 +1,112 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/dma/mediatek,uart-dma.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: MediaTek UART APDMA controller
>> +
>> +maintainers:
>> + - Long Cheng <long.cheng@mediatek.com>
>> +
>> +description: |
>> + The MediaTek UART APDMA controller provides DMA capabilities
>> + for the UART peripheral bus.
>> +
>> +allOf:
>> + - $ref: "dma-controller.yaml#"
>> +
>> +properties:
>> + compatible:
>> + oneOf:
>> + - items:
>> + - enum:
>> + - mediatek,mt2712-uart-dma
>> + - mediatek,mt8516-uart-dma
>> + - const: mediatek,mt6577-uart-dma
>> + - enum:
>> + - mediatek,mt6577-uart-dma
>> +
>> + reg:
>> + minItems: 1
>> + maxItems: 16
>> +
>> + interrupts:
>> + description: |
>> + TX, RX interrupt lines for each UART APDMA channel
>> + minItems: 1
>
> It would be useful to have an "if:" block constraining the interrupts
> (and reg array?), if the dma-requests is missing. If you need an
> example, see length of "max8997,pmic-buck1-dvs-voltage" array in
> relation to presence of max8997,pmic-buck1-uses-gpio-dvs.
> https://elixir.bootlin.com/linux/v5.17-rc2/source/Documentation/devicetree/bindings/regulator/maxim,max8997.yaml#L259
>
> The best would be to restrict number of interrupts to number of
> requests, but I think dtschema cannot express this.
>
Thank you for the very much appreciated example!
I don't think that dtschema can express that without an if block... so, I'll
use that.
>> + maxItems: 32
>> +
>> + clocks:
>> + description: Must contain one entry for the APDMA main clock
>> + maxItems: 1
>> +
>> + clock-names:
>> + const: apdma
>> +
>> + "#dma-cells":
>> + const: 1
>> + description: |
>> + The first cell specifies the UART APDMA channel number
>> +
>> + dma-requests:
>> + description: |
>> + Number of virtual channels of the UART APDMA controller
>> + maximum: 16
>> +
>> + mediatek,dma-33bits:
>> + type: boolean
>> + description: Enable 33-bits UART APDMA support
>> +
>> +required:
>> + - compatible
>> + - reg
>> + - interrupts
>> + - "#dma-cells"
>
> No need for requiring dma-cells. It is coming from dma-common.yaml.
Right. Forgot about that, will fix!
>
>> +
>
> Best regards,
> Krzysztof
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2022-02-16 13:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 11:40 [PATCH] dt-bindings: dma: Convert mtk-uart-apdma to DT schema AngeloGioacchino Del Regno
2022-02-16 13:26 ` Krzysztof Kozlowski
2022-02-16 13:28 ` Krzysztof Kozlowski
2022-02-16 13:30 ` AngeloGioacchino Del Regno [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc523c4f-e625-7651-2621-fe1aab574a5f@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=krzysztof.kozlowski@canonical.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=long.cheng@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox