diff mbox series

[v3,1/5] dt-bindings: spi: sun6i: add DT bindings for Allwinner R329/D1/R528/T113s SPI

Message ID 20230506232616.1792109-2-bigunclemax@gmail.com
State New
Headers show
Series Allwinner R329/D1/R528/T113s SPI support | expand

Commit Message

Maksim Kiselev May 6, 2023, 11:26 p.m. UTC
Listed above Allwinner SoCs has two SPI controllers. First is the regular
SPI controller and the second one has additional functionality for
MIPI-DBI Type C.

Add compatible strings for these controllers

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
---
 .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml   | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Krzysztof Kozlowski May 7, 2023, 7:43 a.m. UTC | #1
On 07/05/2023 06:06, Icenowy Zheng wrote:
> 在 2023-05-07星期日的 02:26 +0300,Maksim Kiselev写道:
>> Listed above Allwinner SoCs has two SPI controllers. First is the
>> regular
>> SPI controller and the second one has additional functionality for
>> MIPI-DBI Type C.
>>
>> Add compatible strings for these controllers
>>
>> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
>> ---
>>  .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml   | 7
>> +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-
>> a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-
>> a31-spi.yaml
>> index de36c6a34a0f..807dde457e3b 100644
>> --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-
>> spi.yaml
>> +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-
>> spi.yaml
>> @@ -21,6 +21,7 @@ properties:
>>      oneOf:
>>        - const: allwinner,sun6i-a31-spi
>>        - const: allwinner,sun8i-h3-spi
>> +      - const: allwinner,sun50i-r329-spi
>>        - items:
>>            - enum:
>>                - allwinner,sun8i-r40-spi
>> @@ -28,6 +29,12 @@ properties:
>>                - allwinner,sun50i-h616-spi
>>                - allwinner,suniv-f1c100s-spi
>>            - const: allwinner,sun8i-h3-spi
>> +      - items:
>> +          - enum:
>> +              - allwinner,sun20i-d1-spi
>> +              - allwinner,sun20i-d1-spi-dbi
> 
> In this case I will prefer to list all 4 compatibles if backward
> compatibility is used:
> "allwinner,sun20i-d1-spi-dbi", "allwinner-sun20i-d1-spi",
> "allwinner,sun50i-r329-spi-dbi", "allwinner, sun50i-r329-spi", in case
> if we were gaining support for either quirks of D1 controller or
> SPI_DBI controllers.
> 

I don't understand. If I see correctly, all four of them are specified.

Best regards,
Krzysztof
Krzysztof Kozlowski May 7, 2023, 7:43 a.m. UTC | #2
On 07/05/2023 01:26, Maksim Kiselev wrote:
> Listed above Allwinner SoCs has two SPI controllers. First is the regular
> SPI controller and the second one has additional functionality for
> MIPI-DBI Type C.
> 
> Add compatible strings for these controllers
> 
> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
> ---
>  .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml   | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
> index de36c6a34a0f..807dde457e3b 100644
> --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
> +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
> @@ -21,6 +21,7 @@ properties:
>      oneOf:
>        - const: allwinner,sun6i-a31-spi
>        - const: allwinner,sun8i-h3-spi
> +      - const: allwinner,sun50i-r329-spi

Keep the list ordered.

>        - items:
>            - enum:
>                - allwinner,sun8i-r40-spi
> @@ -28,6 +29,12 @@ properties:
>                - allwinner,sun50i-h616-spi
>                - allwinner,suniv-f1c100s-spi
>            - const: allwinner,sun8i-h3-spi
> +      - items:
> +          - enum:
> +              - allwinner,sun20i-d1-spi
> +              - allwinner,sun20i-d1-spi-dbi
> +              - allwinner,sun50i-r329-spi-dbi
> +          - const: allwinner,sun50i-r329-spi


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

Best regards,
Krzysztof
Andre Przywara May 7, 2023, 9:50 a.m. UTC | #3
On Sun, 07 May 2023 12:06:58 +0800
Icenowy Zheng <icenowy@aosc.io> wrote:

Hi,

> 在 2023-05-07星期日的 02:26 +0300,Maksim Kiselev写道:
> > Listed above Allwinner SoCs has two SPI controllers. First is the
> > regular
> > SPI controller and the second one has additional functionality for
> > MIPI-DBI Type C.
> > 
> > Add compatible strings for these controllers
> > 
> > Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
> > ---
> >  .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml   | 7
> > +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-
> > a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-
> > a31-spi.yaml
> > index de36c6a34a0f..807dde457e3b 100644
> > --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-
> > spi.yaml
> > +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-
> > spi.yaml
> > @@ -21,6 +21,7 @@ properties:
> >      oneOf:
> >        - const: allwinner,sun6i-a31-spi
> >        - const: allwinner,sun8i-h3-spi
> > +      - const: allwinner,sun50i-r329-spi
> >        - items:
> >            - enum:
> >                - allwinner,sun8i-r40-spi
> > @@ -28,6 +29,12 @@ properties:
> >                - allwinner,sun50i-h616-spi
> >                - allwinner,suniv-f1c100s-spi
> >            - const: allwinner,sun8i-h3-spi
> > +      - items:
> > +          - enum:
> > +              - allwinner,sun20i-d1-spi
> > +              - allwinner,sun20i-d1-spi-dbi  

This construct doesn't cover the three compatible string case, since we
only get to choose from one of the enums, and always have two strings -
hence my challenge to find the shortest sequence ;-)

> In this case I will prefer to list all 4 compatibles if backward
> compatibility is used:
> "allwinner,sun20i-d1-spi-dbi", "allwinner-sun20i-d1-spi",
> "allwinner,sun50i-r329-spi-dbi", "allwinner, sun50i-r329-spi", in case
> if we were gaining support for either quirks of D1 controller or
> SPI_DBI controllers.

I see where you are coming from, but that order doesn't look right,
since we go back from DBI to normal and then back again. And
"allwinner-sun20i-d1-spi" is not a super set of
"allwinner,sun50i-r329-spi-dbi".
In case we will need a D1 quirk, we could key this to the D1 DBI
compatible as well, I think, so this three string version should work.

Cheers,
Andre

> 
> > +              - allwinner,sun50i-r329-spi-dbi
> > +          - const: allwinner,sun50i-r329-spi
> >  
> >    reg:
> >      maxItems: 1  
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
index de36c6a34a0f..807dde457e3b 100644
--- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
+++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
@@ -21,6 +21,7 @@  properties:
     oneOf:
       - const: allwinner,sun6i-a31-spi
       - const: allwinner,sun8i-h3-spi
+      - const: allwinner,sun50i-r329-spi
       - items:
           - enum:
               - allwinner,sun8i-r40-spi
@@ -28,6 +29,12 @@  properties:
               - allwinner,sun50i-h616-spi
               - allwinner,suniv-f1c100s-spi
           - const: allwinner,sun8i-h3-spi
+      - items:
+          - enum:
+              - allwinner,sun20i-d1-spi
+              - allwinner,sun20i-d1-spi-dbi
+              - allwinner,sun50i-r329-spi-dbi
+          - const: allwinner,sun50i-r329-spi
 
   reg:
     maxItems: 1