diff mbox series

[1/3] dt-bindings: i2c: mv64xxx: Document DMA properties

Message ID 20220830020824.62288-2-samuel@sholland.org
State Accepted
Commit d2601193056ad9bc0dad1770b9cc492769d02777
Headers show
Series [1/3] dt-bindings: i2c: mv64xxx: Document DMA properties | expand

Commit Message

Samuel Holland Aug. 30, 2022, 2:08 a.m. UTC
Allwinner's I2C offload engine includes bidirectional DMA support. Add
the properties for describing this in the devicetree. "dmas" is optional
because not all instances of the controller have their DRQs hooked up.
For example, R_I2C0 and R_I2C1 on V536 have no DRQ number assigned.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../bindings/i2c/marvell,mv64xxx-i2c.yaml           | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Krzysztof Kozlowski Aug. 30, 2022, 9:36 a.m. UTC | #1
On 30/08/2022 05:08, Samuel Holland wrote:
> Allwinner's I2C offload engine includes bidirectional DMA support. Add
> the properties for describing this in the devicetree. "dmas" is optional
> because not all instances of the controller have their DRQs hooked up.
> For example, R_I2C0 and R_I2C1 on V536 have no DRQ number assigned.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Thank you for your patch. There is something to discuss/improve.

> ---
> 
>  .../bindings/i2c/marvell,mv64xxx-i2c.yaml           | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
> index 0ec033e48830..63d665a4f9bb 100644
> --- a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
> @@ -66,6 +66,19 @@ properties:
>    resets:
>      maxItems: 1
>  
> +  dmas:
> +    items:
> +      - description: RX DMA Channel
> +      - description: TX DMA Channel
> +
> +  dma-names:
> +    items:
> +      - const: rx
> +      - const: tx
> +
> +dependencies:
> +  dmas: [ dma-names ]

Dependency is not needed. meta-schema has it.

Best regards,
Krzysztof
Samuel Holland Aug. 30, 2022, 1:10 p.m. UTC | #2
On 8/30/22 4:36 AM, Krzysztof Kozlowski wrote:
> On 30/08/2022 05:08, Samuel Holland wrote:
>> Allwinner's I2C offload engine includes bidirectional DMA support. Add
>> the properties for describing this in the devicetree. "dmas" is optional
>> because not all instances of the controller have their DRQs hooked up.
>> For example, R_I2C0 and R_I2C1 on V536 have no DRQ number assigned.
>>
>> Signed-off-by: Samuel Holland <samuel@sholland.org>
> 
> Thank you for your patch. There is something to discuss/improve.
> 
>> ---
>>
>>  .../bindings/i2c/marvell,mv64xxx-i2c.yaml           | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
>> index 0ec033e48830..63d665a4f9bb 100644
>> --- a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
>> +++ b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
>> @@ -66,6 +66,19 @@ properties:
>>    resets:
>>      maxItems: 1
>>  
>> +  dmas:
>> +    items:
>> +      - description: RX DMA Channel
>> +      - description: TX DMA Channel
>> +
>> +  dma-names:
>> +    items:
>> +      - const: rx
>> +      - const: tx
>> +
>> +dependencies:
>> +  dmas: [ dma-names ]
> 
> Dependency is not needed. meta-schema has it.

The only dma-names dependencies I see in dtschema (meta-schemas/dma.yaml and
schemas/dma/dma.yaml) are in the other direction. Those are saying that
dma-names only makes sense if dmas is provided.

Here I am saying that the two DMA requests are optional, but only optional
"together". The node must either have no DMA properties or both DMA properties.

Regards,
Samuel
Krzysztof Kozlowski Aug. 30, 2022, 1:23 p.m. UTC | #3
On 30/08/2022 16:10, Samuel Holland wrote:
> On 8/30/22 4:36 AM, Krzysztof Kozlowski wrote:
>> On 30/08/2022 05:08, Samuel Holland wrote:
>>> Allwinner's I2C offload engine includes bidirectional DMA support. Add
>>> the properties for describing this in the devicetree. "dmas" is optional
>>> because not all instances of the controller have their DRQs hooked up.
>>> For example, R_I2C0 and R_I2C1 on V536 have no DRQ number assigned.
>>>
>>> Signed-off-by: Samuel Holland <samuel@sholland.org>
>>
>> Thank you for your patch. There is something to discuss/improve.
>>
>>> ---
>>>
>>>  .../bindings/i2c/marvell,mv64xxx-i2c.yaml           | 13 +++++++++++++
>>>  1 file changed, 13 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
>>> index 0ec033e48830..63d665a4f9bb 100644
>>> --- a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
>>> +++ b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
>>> @@ -66,6 +66,19 @@ properties:
>>>    resets:
>>>      maxItems: 1
>>>  
>>> +  dmas:
>>> +    items:
>>> +      - description: RX DMA Channel
>>> +      - description: TX DMA Channel
>>> +
>>> +  dma-names:
>>> +    items:
>>> +      - const: rx
>>> +      - const: tx
>>> +
>>> +dependencies:
>>> +  dmas: [ dma-names ]
>>
>> Dependency is not needed. meta-schema has it.
> 
> The only dma-names dependencies I see in dtschema (meta-schemas/dma.yaml and
> schemas/dma/dma.yaml) are in the other direction. Those are saying that
> dma-names only makes sense if dmas is provided.
> 
> Here I am saying that the two DMA requests are optional, but only optional
> "together". The node must either have no DMA properties or both DMA properties.

Right, that's correct.

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

Best regards,
Krzysztof
Wolfram Sang Sept. 7, 2022, 8:02 p.m. UTC | #4
On Mon, Aug 29, 2022 at 09:08:22PM -0500, Samuel Holland wrote:
> Allwinner's I2C offload engine includes bidirectional DMA support. Add
> the properties for describing this in the devicetree. "dmas" is optional
> because not all instances of the controller have their DRQs hooked up.
> For example, R_I2C0 and R_I2C1 on V536 have no DRQ number assigned.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
index 0ec033e48830..63d665a4f9bb 100644
--- a/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
@@ -66,6 +66,19 @@  properties:
   resets:
     maxItems: 1
 
+  dmas:
+    items:
+      - description: RX DMA Channel
+      - description: TX DMA Channel
+
+  dma-names:
+    items:
+      - const: rx
+      - const: tx
+
+dependencies:
+  dmas: [ dma-names ]
+
 required:
   - compatible
   - reg