diff mbox series

[4/7] dt-bindings: spi: stm32: add bindings regarding stm32h7 spi slave

Message ID 20230428121524.2125832-5-valentin.caron@foss.st.com (mailing list archive)
State New, archived
Headers show
Series spi: stm32: add spi slave mode | expand

Commit Message

Valentin Caron April 28, 2023, 12:15 p.m. UTC
From: Alain Volmat <alain.volmat@foss.st.com>

Update the spi-stm32 binding yaml regarding to the SPI slave support.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
---
 Documentation/devicetree/bindings/spi/st,stm32-spi.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Rob Herring (Arm) April 28, 2023, 9:46 p.m. UTC | #1
On Fri, Apr 28, 2023 at 02:15:21PM +0200, Valentin Caron wrote:
> From: Alain Volmat <alain.volmat@foss.st.com>
> 
> Update the spi-stm32 binding yaml regarding to the SPI slave support.

Why? What problem are you trying to solve.

> 
> Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
> ---
>  Documentation/devicetree/bindings/spi/st,stm32-spi.yaml | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
> index c599eb359d56..1d26fa2658c5 100644
> --- a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
> +++ b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
> @@ -27,6 +27,7 @@ allOf:
>      then:
>        properties:
>          st,spi-midi-ns: false
> +        spi-slave: false
>  
>  properties:
>    "#address-cells": true
> @@ -62,6 +63,13 @@ properties:
>        - const: rx
>        - const: tx
>  
> +  cs-gpios:
> +    description:
> +      In case of spi-slave not defined, cs-gpios behave as defined in
> +      spi-controller.yaml.
> +      In case of spi-slave defined, if <0>, indicate that SS should be
> +      detected via the dedicated HW pin

I don't understand. I though cs-gpios was for master mode. You want to 
define 'cs-gpios = <0>;'? How would that be different than just omitting 
cs-gpios?

Rob
Valentin Caron May 4, 2023, 5:11 p.m. UTC | #2
On 4/28/23 23:46, Rob Herring wrote:
> On Fri, Apr 28, 2023 at 02:15:21PM +0200, Valentin Caron wrote:
>> From: Alain Volmat <alain.volmat@foss.st.com>
>>
>> Update the spi-stm32 binding yaml regarding to the SPI slave support.
> Why? What problem are you trying to solve.
To add some documentation about cs-gpios and don't allow to use
spi-slave property with st,stm32f4-spi compatible.

I will specify this in next patchset.

>
>> Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
>> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
>> ---
>>   Documentation/devicetree/bindings/spi/st,stm32-spi.yaml | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
>> index c599eb359d56..1d26fa2658c5 100644
>> --- a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
>> +++ b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
>> @@ -27,6 +27,7 @@ allOf:
>>       then:
>>         properties:
>>           st,spi-midi-ns: false
>> +        spi-slave: false
>>   
>>   properties:
>>     "#address-cells": true
>> @@ -62,6 +63,13 @@ properties:
>>         - const: rx
>>         - const: tx
>>   
>> +  cs-gpios:
>> +    description:
>> +      In case of spi-slave not defined, cs-gpios behave as defined in
>> +      spi-controller.yaml.
>> +      In case of spi-slave defined, if <0>, indicate that SS should be
>> +      detected via the dedicated HW pin
> I don't understand. I though cs-gpios was for master mode. You want to
> define 'cs-gpios = <0>;'? How would that be different than just omitting
> cs-gpios?
>
> Rob
We try to keep consistency with spi master, but, as you said, it is useless.
I will remove it in next patchset.

Thanks,
Valentin
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
index c599eb359d56..1d26fa2658c5 100644
--- a/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
+++ b/Documentation/devicetree/bindings/spi/st,stm32-spi.yaml
@@ -27,6 +27,7 @@  allOf:
     then:
       properties:
         st,spi-midi-ns: false
+        spi-slave: false
 
 properties:
   "#address-cells": true
@@ -62,6 +63,13 @@  properties:
       - const: rx
       - const: tx
 
+  cs-gpios:
+    description:
+      In case of spi-slave not defined, cs-gpios behave as defined in
+      spi-controller.yaml.
+      In case of spi-slave defined, if <0>, indicate that SS should be
+      detected via the dedicated HW pin
+
 patternProperties:
   "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-f]+$":
     type: object