diff mbox series

[3/3] dt-bindings: i2c: at91: Add SAMA7G5 compatible strings list

Message ID 20220309120714.51393-4-sergiu.moga@microchip.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: i2c: convert i2c-at91 to json-schema | expand

Commit Message

Sergiu Moga March 9, 2022, 12:07 p.m. UTC
Add compatible strings list for SAMA7G5.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
---
 .../bindings/i2c/atmel,at91sam-i2c.yaml       | 38 ++++++++++++-------
 1 file changed, 24 insertions(+), 14 deletions(-)

Comments

Krzysztof Kozlowski March 10, 2022, 7:22 a.m. UTC | #1
On 09/03/2022 13:07, Sergiu Moga wrote:
> Add compatible strings list for SAMA7G5.
> 
> Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
> ---
>  .../bindings/i2c/atmel,at91sam-i2c.yaml       | 38 ++++++++++++-------
>  1 file changed, 24 insertions(+), 14 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
> index d4aadbbd1a11..661a679b98cf 100644
> --- a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
> @@ -16,10 +16,15 @@ allOf:
>        properties:
>          compatible:
>            contains:
> -            enum:
> -              - atmel,sama5d4-i2c
> -              - atmel,sama5d2-i2c
> -              - microchip,sam9x60-i2c
> +            oneOf:
> +              - items:
> +                  - enum:
> +                      - atmel,sama5d4-i2c
> +                      - atmel,sama5d2-i2c
> +                      - microchip,sam9x60-i2c
> +              - items:
> +                  - const: microchip,sama7g5-i2c
> +                  - const: microchip,sam9x60-i2c

This looks not needed, because it contains microchip,sam9x60-i2c which
is mentioned earlier.


>      then:
>        properties:
>          i2c-sda-hold-time-ns:
> @@ -29,16 +34,21 @@ allOf:
>  

Best regards,
Krzysztof
Sergiu Moga March 10, 2022, 10:42 a.m. UTC | #2
On 10.03.2022 09:22, Krzysztof Kozlowski wrote:
> On 09/03/2022 13:07, Sergiu Moga wrote:
>> Add compatible strings list for SAMA7G5.
>>
>> Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
>> ---
>>   .../bindings/i2c/atmel,at91sam-i2c.yaml       | 38 ++++++++++++-------
>>   1 file changed, 24 insertions(+), 14 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
>> index d4aadbbd1a11..661a679b98cf 100644
>> --- a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
>> +++ b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
>> @@ -16,10 +16,15 @@ allOf:
>>         properties:
>>           compatible:
>>             contains:
>> -            enum:
>> -              - atmel,sama5d4-i2c
>> -              - atmel,sama5d2-i2c
>> -              - microchip,sam9x60-i2c
>> +            oneOf:
>> +              - items:
>> +                  - enum:
>> +                      - atmel,sama5d4-i2c
>> +                      - atmel,sama5d2-i2c
>> +                      - microchip,sam9x60-i2c
>> +              - items:
>> +                  - const: microchip,sama7g5-i2c
>> +                  - const: microchip,sam9x60-i2c
> This looks not needed, because it contains microchip,sam9x60-i2c which
> is mentioned earlier.
>
Hmm, I might have misunderstood the functionality. I thought it would be 
stricter, having to match all the strings of that compatible. I guess 
something like this should be enough then?
            oneOf:
               - enum:
                   - atmel,sama5d4-i2c
                   - atmel,sama5d2-i2c
                   - microchip,sam9x60-i2c
                   - microchip,sama7g5-i2

Just adding the sama7g5 compatible seems to pass the check on my end.
>>       then:
>>         properties:
>>           i2c-sda-hold-time-ns:
>> @@ -29,16 +34,21 @@ allOf:
>>
> Best regards,
> Krzysztof

Thank you for the feedback.

Sergiu.
Krzysztof Kozlowski March 10, 2022, 11:05 a.m. UTC | #3
On 10/03/2022 11:42, Sergiu.Moga@microchip.com wrote:
> On 10.03.2022 09:22, Krzysztof Kozlowski wrote:
>> On 09/03/2022 13:07, Sergiu Moga wrote:
>>> Add compatible strings list for SAMA7G5.
>>>
>>> Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
>>> ---
>>>   .../bindings/i2c/atmel,at91sam-i2c.yaml       | 38 ++++++++++++-------
>>>   1 file changed, 24 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
>>> index d4aadbbd1a11..661a679b98cf 100644
>>> --- a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
>>> +++ b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
>>> @@ -16,10 +16,15 @@ allOf:
>>>         properties:
>>>           compatible:
>>>             contains:
>>> -            enum:
>>> -              - atmel,sama5d4-i2c
>>> -              - atmel,sama5d2-i2c
>>> -              - microchip,sam9x60-i2c
>>> +            oneOf:
>>> +              - items:
>>> +                  - enum:
>>> +                      - atmel,sama5d4-i2c
>>> +                      - atmel,sama5d2-i2c
>>> +                      - microchip,sam9x60-i2c
>>> +              - items:
>>> +                  - const: microchip,sama7g5-i2c
>>> +                  - const: microchip,sam9x60-i2c
>> This looks not needed, because it contains microchip,sam9x60-i2c which
>> is mentioned earlier.
>>
> Hmm, I might have misunderstood the functionality. I thought it would be 
> stricter, having to match all the strings of that compatible. I guess 
> something like this should be enough then?
>             oneOf:
>                - enum:
>                    - atmel,sama5d4-i2c
>                    - atmel,sama5d2-i2c
>                    - microchip,sam9x60-i2c
>                    - microchip,sama7g5-i2
> 
> Just adding the sama7g5 compatible seems to pass the check on my end.

Yes, that is also a good solution.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
index d4aadbbd1a11..661a679b98cf 100644
--- a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
@@ -16,10 +16,15 @@  allOf:
       properties:
         compatible:
           contains:
-            enum:
-              - atmel,sama5d4-i2c
-              - atmel,sama5d2-i2c
-              - microchip,sam9x60-i2c
+            oneOf:
+              - items:
+                  - enum:
+                      - atmel,sama5d4-i2c
+                      - atmel,sama5d2-i2c
+                      - microchip,sam9x60-i2c
+              - items:
+                  - const: microchip,sama7g5-i2c
+                  - const: microchip,sam9x60-i2c
     then:
       properties:
         i2c-sda-hold-time-ns:
@@ -29,16 +34,21 @@  allOf:
 
 properties:
   compatible:
-    enum:
-      - atmel,at91rm9200-i2c
-      - atmel,at91sam9261-i2c
-      - atmel,at91sam9260-i2c
-      - atmel,at91sam9g20-i2c
-      - atmel,at91sam9g10-i2c
-      - atmel,at91sam9x5-i2c
-      - atmel,sama5d4-i2c
-      - atmel,sama5d2-i2c
-      - microchip,sam9x60-i2c
+    oneOf:
+      - items:
+          - enum:
+              - atmel,at91rm9200-i2c
+              - atmel,at91sam9261-i2c
+              - atmel,at91sam9260-i2c
+              - atmel,at91sam9g20-i2c
+              - atmel,at91sam9g10-i2c
+              - atmel,at91sam9x5-i2c
+              - atmel,sama5d4-i2c
+              - atmel,sama5d2-i2c
+              - microchip,sam9x60-i2c
+      - items:
+          - const: microchip,sama7g5-i2c
+          - const: microchip,sam9x60-i2c
 
   reg:
     maxItems: 1