alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ARM: dts: stm32: merge spi and i2s nodes
@ 2021-11-25 14:40 Olivier Moysan
  2021-11-25 14:40 ` [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port Olivier Moysan
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Olivier Moysan @ 2021-11-25 14:40 UTC (permalink / raw)
  To: Alexandre Torgue, Liam Girdwood, Mark Brown, Maxime Coquelin,
	Olivier Moysan, Rob Herring, arnaud.pouliquen, amelie.delaunay,
	alain.volmat
  Cc: devicetree, alsa-devel, linux-kernel, fabrice.gasnier,
	Olivier Moysan, linux-stm32, linux-arm-kernel

When a STM32 SPI instance offers I2S feature, two nodes are defined
in STM32 SoC device tree to support both SPI and I2S.
Merge SPI node and I2S nodes into a single node, to avoid
hardware description duplication and compilation warnings.

Changes in v2:
- Squash some patches in the serie to avoid dtbs check warnings
  on intermediate compilation steps.

Olivier Moysan (4):
  ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  ASoC: dt-bindings: stm32: i2s: allow additional properties.
  ASoC: dt-bindings: stm32: i2s: update example
  ARM: dts: stm32: merge spi and i2s nodes

 .../bindings/sound/st,stm32-i2s.yaml          |  9 ++++-
 arch/arm/boot/dts/stm32mp151.dtsi             | 39 ++-----------------
 arch/arm/boot/dts/stm32mp157c-ev1.dts         |  2 +-
 .../arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi |  2 +-
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi |  2 +-
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi        |  7 +++-
 6 files changed, 18 insertions(+), 43 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-11-25 14:40 [PATCH v2 0/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
@ 2021-11-25 14:40 ` Olivier Moysan
  2021-11-25 21:26   ` Rob Herring
  2021-11-25 14:40 ` [PATCH v2 2/4] ASoC: dt-bindings: stm32: i2s: allow additional properties Olivier Moysan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Olivier Moysan @ 2021-11-25 14:40 UTC (permalink / raw)
  To: Alexandre Torgue, Liam Girdwood, Mark Brown, Maxime Coquelin,
	Olivier Moysan, Rob Herring, arnaud.pouliquen, amelie.delaunay,
	alain.volmat
  Cc: devicetree, alsa-devel, linux-kernel, fabrice.gasnier,
	Olivier Moysan, linux-stm32, linux-arm-kernel

The STM2 I2S DAI can be connected via the audio-graph-card.
Add port entry into the bindings.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
index 6feb5a09c184..64b70ac539f8 100644
--- a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
@@ -58,6 +58,11 @@ properties:
     description: Configure the I2S device as MCLK clock provider.
     const: 0
 
+patternProperties:
+  '^port@[0-9]':
+    $ref: audio-graph-port.yaml#
+    unevaluatedProperties: false
+
 required:
   - compatible
   - "#sound-dai-cells"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/4] ASoC: dt-bindings: stm32: i2s: allow additional properties.
  2021-11-25 14:40 [PATCH v2 0/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
  2021-11-25 14:40 ` [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port Olivier Moysan
@ 2021-11-25 14:40 ` Olivier Moysan
  2021-12-01 22:31   ` Rob Herring
  2021-11-25 14:40 ` [PATCH v2 3/4] ASoC: dt-bindings: stm32: i2s: update example Olivier Moysan
  2021-11-25 14:40 ` [PATCH v2 4/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
  3 siblings, 1 reply; 14+ messages in thread
From: Olivier Moysan @ 2021-11-25 14:40 UTC (permalink / raw)
  To: Alexandre Torgue, Liam Girdwood, Mark Brown, Maxime Coquelin,
	Olivier Moysan, Rob Herring, arnaud.pouliquen, amelie.delaunay,
	alain.volmat
  Cc: devicetree, alsa-devel, linux-kernel, fabrice.gasnier,
	Olivier Moysan, linux-stm32, linux-arm-kernel

The STM32 SPI peripheral supports both SPI and I2S protocols.
In the SoC device tree the node describes the peripheral as an
SPI peripheral by default. This default configuration can be
overwritten in board device tree to use the IP as an I2S peripheral.
In this case the address-cells and size-cells properties from
SoC DT SPI node should not be checked against STM32 I2S bindings.
Set additionalProperties to "true" to allow these extra properties.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
index 64b70ac539f8..33ba15363c0f 100644
--- a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
@@ -73,7 +73,7 @@ required:
   - dmas
   - dma-names
 
-additionalProperties: false
+additionalProperties: true
 
 examples:
   - |
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/4] ASoC: dt-bindings: stm32: i2s: update example
  2021-11-25 14:40 [PATCH v2 0/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
  2021-11-25 14:40 ` [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port Olivier Moysan
  2021-11-25 14:40 ` [PATCH v2 2/4] ASoC: dt-bindings: stm32: i2s: allow additional properties Olivier Moysan
@ 2021-11-25 14:40 ` Olivier Moysan
  2021-11-25 14:40 ` [PATCH v2 4/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
  3 siblings, 0 replies; 14+ messages in thread
From: Olivier Moysan @ 2021-11-25 14:40 UTC (permalink / raw)
  To: Alexandre Torgue, Liam Girdwood, Mark Brown, Maxime Coquelin,
	Olivier Moysan, Rob Herring, arnaud.pouliquen, amelie.delaunay,
	alain.volmat
  Cc: devicetree, alsa-devel, linux-kernel, fabrice.gasnier,
	Olivier Moysan, linux-stm32, linux-arm-kernel

Some STM32 SPI peripheral instances support I2S for audio.
SPI and I2S features were initially described through two separated
nodes in the SoC Device Tree. In the next SoC Device Trees
a single node is used to describe SPI peripheral, leading
to a change in node name for I2S.
Change example in STM32 DT binding example to match this change.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
index 33ba15363c0f..591f9c941f54 100644
--- a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
@@ -79,7 +79,7 @@ examples:
   - |
     #include <dt-bindings/interrupt-controller/arm-gic.h>
     #include <dt-bindings/clock/stm32mp1-clks.h>
-    i2s2: audio-controller@4000b000 {
+    spi2s2: spi@4000b000 {
         compatible = "st,stm32h7-i2s";
         #sound-dai-cells = <0>;
         reg = <0x4000b000 0x400>;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 4/4] ARM: dts: stm32: merge spi and i2s nodes
  2021-11-25 14:40 [PATCH v2 0/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
                   ` (2 preceding siblings ...)
  2021-11-25 14:40 ` [PATCH v2 3/4] ASoC: dt-bindings: stm32: i2s: update example Olivier Moysan
@ 2021-11-25 14:40 ` Olivier Moysan
  3 siblings, 0 replies; 14+ messages in thread
From: Olivier Moysan @ 2021-11-25 14:40 UTC (permalink / raw)
  To: Alexandre Torgue, Liam Girdwood, Mark Brown, Maxime Coquelin,
	Olivier Moysan, Rob Herring, arnaud.pouliquen, amelie.delaunay,
	alain.volmat
  Cc: devicetree, alsa-devel, linux-kernel, fabrice.gasnier,
	Olivier Moysan, linux-stm32, linux-arm-kernel

When a SPI instance offers I2S feature, two nodes are defined
in SoC device tree to support both SPI and I2S.
Merge SPI node and I2S nodes into a single node, to avoid
hardware description duplication and compilation warnings.
spi2sx label is used to identify the SPI instances which
are supporting I2S feature.

Rename nodes, to match new labels of SPI/I2S nodes in the
SoC device tree on following boards:
- STMP32MP15xx-DKx
- STMP32MP157C-EV1
- STMP32MP15xx-dhcor-avenger96
- STMP32MP15xx-dhcom-drc02

In DT check utility, the spi2s2 node is identified as an spi node.
The check_spi_bus_reg() function issues a warning "missing or empty
reg property" if reg property is not defined in child nodes.
Add reg property to STM32 I2S port node on STM32MP15XX-DK board
to match this requirement and add related unit-address in node name.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 arch/arm/boot/dts/stm32mp151.dtsi             | 39 ++-----------------
 arch/arm/boot/dts/stm32mp157c-ev1.dts         |  2 +-
 .../arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi |  2 +-
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi |  2 +-
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi        |  7 +++-
 5 files changed, 11 insertions(+), 41 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index f693a7d24247..61226821ff8c 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -386,7 +386,7 @@
 			};
 		};
 
-		spi2: spi@4000b000 {
+		spi2s2: spi@4000b000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "st,stm32h7-spi";
@@ -400,18 +400,7 @@
 			status = "disabled";
 		};
 
-		i2s2: audio-controller@4000b000 {
-			compatible = "st,stm32h7-i2s";
-			#sound-dai-cells = <0>;
-			reg = <0x4000b000 0x400>;
-			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-			dmas = <&dmamux1 39 0x400 0x01>,
-			       <&dmamux1 40 0x400 0x01>;
-			dma-names = "rx", "tx";
-			status = "disabled";
-		};
-
-		spi3: spi@4000c000 {
+		spi2s3: spi@4000c000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "st,stm32h7-spi";
@@ -425,17 +414,6 @@
 			status = "disabled";
 		};
 
-		i2s3: audio-controller@4000c000 {
-			compatible = "st,stm32h7-i2s";
-			#sound-dai-cells = <0>;
-			reg = <0x4000c000 0x400>;
-			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
-			dmas = <&dmamux1 61 0x400 0x01>,
-			       <&dmamux1 62 0x400 0x01>;
-			dma-names = "rx", "tx";
-			status = "disabled";
-		};
-
 		spdifrx: audio-controller@4000d000 {
 			compatible = "st,stm32h7-spdifrx";
 			#sound-dai-cells = <0>;
@@ -681,7 +659,7 @@
 			status = "disabled";
 		};
 
-		spi1: spi@44004000 {
+		spi2s1: spi@44004000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "st,stm32h7-spi";
@@ -695,17 +673,6 @@
 			status = "disabled";
 		};
 
-		i2s1: audio-controller@44004000 {
-			compatible = "st,stm32h7-i2s";
-			#sound-dai-cells = <0>;
-			reg = <0x44004000 0x400>;
-			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
-			dmas = <&dmamux1 37 0x400 0x01>,
-			       <&dmamux1 38 0x400 0x01>;
-			dma-names = "rx", "tx";
-			status = "disabled";
-		};
-
 		spi4: spi@44005000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
index 5c5b1ddf7bfd..c836b4a1dbe2 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -293,7 +293,7 @@
 	status = "disabled";
 };
 
-&spi1 {
+&spi2s1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi1_pins_a>;
 	status = "disabled";
diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi
index 4b10b013ffd5..29f18382d962 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi
@@ -114,7 +114,7 @@
 	disable-wp;
 };
 
-&spi1 {
+&spi2s1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi1_pins_a>;
 	cs-gpios = <&gpioz 3 0>;
diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
index 6885948f3024..0dce9b118318 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
@@ -362,7 +362,7 @@
 	};
 };
 
-&spi2 {
+&spi2s2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi2_pins_a>;
 	cs-gpios = <&gpioi 0 0>;
diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
index 48beed0f1f30..4c362af95736 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
@@ -427,7 +427,9 @@
 	status = "disabled";
 };
 
-&i2s2 {
+&spi2s2 {
+	compatible = "st,stm32h7-i2s";
+	#sound-dai-cells = <0>;
 	clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
 	clock-names = "pclk", "i2sclk", "x8k", "x11k";
 	pinctrl-names = "default", "sleep";
@@ -435,7 +437,8 @@
 	pinctrl-1 = <&i2s2_sleep_pins_a>;
 	status = "okay";
 
-	i2s2_port: port {
+	i2s2_port: port@0 {
+		reg = <0>;
 		i2s2_endpoint: endpoint {
 			remote-endpoint = <&sii9022_tx_endpoint>;
 			format = "i2s";
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-11-25 14:40 ` [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port Olivier Moysan
@ 2021-11-25 21:26   ` Rob Herring
  2021-11-26 10:25     ` Olivier MOYSAN
  0 siblings, 1 reply; 14+ messages in thread
From: Rob Herring @ 2021-11-25 21:26 UTC (permalink / raw)
  To: Olivier Moysan
  Cc: devicetree, alsa-devel, Olivier Moysan, Alexandre Torgue,
	Mark Brown, linux-kernel, Rob Herring, Liam Girdwood,
	amelie.delaunay, fabrice.gasnier, Maxime Coquelin, alain.volmat,
	arnaud.pouliquen, linux-stm32, linux-arm-kernel

On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
> The STM2 I2S DAI can be connected via the audio-graph-card.
> Add port entry into the bindings.
> 
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
>  Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/1559750


audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
	arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
	arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-11-25 21:26   ` Rob Herring
@ 2021-11-26 10:25     ` Olivier MOYSAN
  2021-12-01 22:34       ` Rob Herring
  0 siblings, 1 reply; 14+ messages in thread
From: Olivier MOYSAN @ 2021-11-26 10:25 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, alsa-devel, Olivier Moysan, Alexandre Torgue,
	Mark Brown, linux-kernel, Rob Herring, Liam Girdwood,
	amelie.delaunay, fabrice.gasnier, Maxime Coquelin, alain.volmat,
	arnaud.pouliquen, linux-stm32, linux-arm-kernel

Hi Rob,

On 11/25/21 10:26 PM, Rob Herring wrote:
> On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
>> The STM2 I2S DAI can be connected via the audio-graph-card.
>> Add port entry into the bindings.
>>
>> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
>> ---
>>   Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
> 
> Running 'make dtbs_check' with the schema in this patch gives the
> following warnings. Consider if they are expected or the schema is
> incorrect. These may not be new warnings.
> 
> Note that it is not yet a requirement to have 0 warnings for dtbs_check.
> This will change in the future.
> 
> Full log is available here: https://patchwork.ozlabs.org/patch/1559750
> 
> 
> audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
> 	arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
> 	arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
> 

This warning is not a new one.

The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
port:
	$ref: audio-graph-port.yaml#
	unevaluatedProperties: false

However the spi binding requires to introduce a unit address:
patternProperties:
   '^port@[0-9]':
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false

The warning can be removed by re-ordering the bindings patches in the 
serie, as "additionalProperties: true" makes the check more tolerant on 
extra properties.
The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can 
even be merely dropped.
So, I suggest to resend the serie without audio-graph-card patch.

Does it sound too permissive to you ?

Thanks
Olivier

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 2/4] ASoC: dt-bindings: stm32: i2s: allow additional properties.
  2021-11-25 14:40 ` [PATCH v2 2/4] ASoC: dt-bindings: stm32: i2s: allow additional properties Olivier Moysan
@ 2021-12-01 22:31   ` Rob Herring
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2021-12-01 22:31 UTC (permalink / raw)
  To: Olivier Moysan
  Cc: devicetree, alsa-devel, Olivier Moysan, linux-kernel,
	Alexandre Torgue, Liam Girdwood, amelie.delaunay, Mark Brown,
	fabrice.gasnier, Maxime Coquelin, alain.volmat, arnaud.pouliquen,
	linux-stm32, linux-arm-kernel

On Thu, Nov 25, 2021 at 03:40:51PM +0100, Olivier Moysan wrote:
> The STM32 SPI peripheral supports both SPI and I2S protocols.
> In the SoC device tree the node describes the peripheral as an
> SPI peripheral by default. This default configuration can be
> overwritten in board device tree to use the IP as an I2S peripheral.
> In this case the address-cells and size-cells properties from
> SoC DT SPI node should not be checked against STM32 I2S bindings.
> Set additionalProperties to "true" to allow these extra properties.
> 
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
>  Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
> index 64b70ac539f8..33ba15363c0f 100644
> --- a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
> +++ b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml
> @@ -73,7 +73,7 @@ required:
>    - dmas
>    - dma-names
>  
> -additionalProperties: false
> +additionalProperties: true

This is only allowed for schemas that are incomplete collections of 
properties such as common bindings.

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-11-26 10:25     ` Olivier MOYSAN
@ 2021-12-01 22:34       ` Rob Herring
       [not found]         ` <627777a4-7458-88ed-e7c5-d11e3db847b5@foss.st.com>
  0 siblings, 1 reply; 14+ messages in thread
From: Rob Herring @ 2021-12-01 22:34 UTC (permalink / raw)
  To: Olivier MOYSAN
  Cc: devicetree, alsa-devel, Olivier Moysan, Alexandre Torgue,
	Mark Brown, linux-kernel, Liam Girdwood, amelie.delaunay,
	fabrice.gasnier, Maxime Coquelin, alain.volmat, arnaud.pouliquen,
	linux-stm32, linux-arm-kernel

On Fri, Nov 26, 2021 at 11:25:27AM +0100, Olivier MOYSAN wrote:
> Hi Rob,
> 
> On 11/25/21 10:26 PM, Rob Herring wrote:
> > On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
> > > The STM2 I2S DAI can be connected via the audio-graph-card.
> > > Add port entry into the bindings.
> > > 
> > > Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> > > ---
> > >   Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
> > >   1 file changed, 5 insertions(+)
> > > 
> > 
> > Running 'make dtbs_check' with the schema in this patch gives the
> > following warnings. Consider if they are expected or the schema is
> > incorrect. These may not be new warnings.
> > 
> > Note that it is not yet a requirement to have 0 warnings for dtbs_check.
> > This will change in the future.
> > 
> > Full log is available here: https://patchwork.ozlabs.org/patch/1559750
> > 
> > 
> > audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
> > 	arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
> > 	arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
> > 
> 
> This warning is not a new one.
> 
> The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
> port:
> 	$ref: audio-graph-port.yaml#
> 	unevaluatedProperties: false
> 
> However the spi binding requires to introduce a unit address:
> patternProperties:
>   '^port@[0-9]':
>     $ref: audio-graph-port.yaml#
>     unevaluatedProperties: false
> 
> The warning can be removed by re-ordering the bindings patches in the serie,
> as "additionalProperties: true" makes the check more tolerant on extra
> properties.

That's never right.

> The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can
> even be merely dropped.
> So, I suggest to resend the serie without audio-graph-card patch.

Only if you aren't using audio-graph-card.

> 
> Does it sound too permissive to you ?

I think perhaps you need to combine the schemas into 1. Or you need to 
restructure your dtsi files such that you only add spi specific 
properties when spi mode is enabled and only add i2s specific properties 
when i2s mode is enabled. Or use the /delete-property/ directive.

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-stm32] [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
       [not found]           ` <cf5f994b-aecf-e051-f5c9-4a46e6414207@pengutronix.de>
@ 2021-12-08  9:55             ` Alexandre TORGUE
  2021-12-08 12:08               ` Lee Jones
  0 siblings, 1 reply; 14+ messages in thread
From: Alexandre TORGUE @ 2021-12-08  9:55 UTC (permalink / raw)
  To: Ahmad Fatoum, Rob Herring, Olivier MOYSAN, Lee Jones, Fabrice GASNIER
  Cc: devicetree, alsa-devel, linux-kernel, Liam Girdwood, Mark Brown,
	Maxime Coquelin, alain.volmat, arnaud.pouliquen, linux-stm32,
	linux-arm-kernel

Hi Ahmad

On 12/7/21 2:59 PM, Ahmad Fatoum wrote:
> Hello Alex,
> 
> On 07.12.21 14:52, Alexandre TORGUE wrote:
>> Hi Rob
>>
>> On 12/1/21 11:34 PM, Rob Herring wrote:
>>> On Fri, Nov 26, 2021 at 11:25:27AM +0100, Olivier MOYSAN wrote:
>>>> Hi Rob,
>>>>
>>>> On 11/25/21 10:26 PM, Rob Herring wrote:
>>>>> On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
>>>>>> The STM2 I2S DAI can be connected via the audio-graph-card.
>>>>>> Add port entry into the bindings.
>>>>>>
>>>>>> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
>>>>>> ---
>>>>>>     Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
>>>>>>     1 file changed, 5 insertions(+)
>>>>>>
>>>>>
>>>>> Running 'make dtbs_check' with the schema in this patch gives the
>>>>> following warnings. Consider if they are expected or the schema is
>>>>> incorrect. These may not be new warnings.
>>>>>
>>>>> Note that it is not yet a requirement to have 0 warnings for dtbs_check.
>>>>> This will change in the future.
>>>>>
>>>>> Full log is available here: https://patchwork.ozlabs.org/patch/1559750
>>>>>
>>>>>
>>>>> audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
>>>>>      arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
>>>>>      arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
>>>>>
>>>>
>>>> This warning is not a new one.
>>>>
>>>> The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
>>>> port:
>>>>      $ref: audio-graph-port.yaml#
>>>>      unevaluatedProperties: false
>>>>
>>>> However the spi binding requires to introduce a unit address:
>>>> patternProperties:
>>>>     '^port@[0-9]':
>>>>       $ref: audio-graph-port.yaml#
>>>>       unevaluatedProperties: false
>>>>
>>>> The warning can be removed by re-ordering the bindings patches in the serie,
>>>> as "additionalProperties: true" makes the check more tolerant on extra
>>>> properties.
>>>
>>> That's never right.
>>>
>>>> The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can
>>>> even be merely dropped.
>>>> So, I suggest to resend the serie without audio-graph-card patch.
>>>
>>> Only if you aren't using audio-graph-card.
>>>
>>>>
>>>> Does it sound too permissive to you ?
>>>
>>> I think perhaps you need to combine the schemas into 1. Or you need to
>>> restructure your dtsi files such that you only add spi specific
>>> properties when spi mode is enabled and only add i2s specific properties
>>> when i2s mode is enabled. Or use the /delete-property/ directive.
>>
>> Initially the aim of this series was to fix a "make W=1" warnings seen on spi and i2s nodes (duplicate unit-address). Moving both nodes in a common node + using a different compatible depending on SPI or I2S usage sounded good) but it is not enough. In this series the common node is named as following: "spi2s2: spi@4000b000". It is fine for a spi usage but if we want to use this "common node" with I2S compatible and specific bindings, the node name remains spi@... and then specific spi checks are done. For this with this series applied we got this issue reported by spi-controller.yaml:
>>
>> spi@4000b000: port@0: 'compatible' is a required property
>>
>> So, if we use two separates nodes we got W=1 warning and if we use a common node we got yaml check issue. One possibility would be to use a common node with a new node name (for example i2spi@...) but I think it is not acceptable.
>>
>> How to progress ?
> 
> Atmel Flexcom can be configured to be either UART, SPI or i2c. Functions
> are child nodes of the flexcom node and the MFD driver matching against it,
> just configure the operating mode and then calls of_platform_populate.
> 
> Would something along these lines fit here as well?

Yes it could but in my mind it was not a MFD as both feature cannot be 
used at the same time: it is either SPI or I2S and choice is done 
"statically" in device tree depending board usage.

Lee, what it is your feeling about that ? Will you accept to add a MFD 
driver for this SPI/I2S peripheral whose prurpose is only to populate 
child node (either SPI or I2S) ?

Cheers
Alex

> 
> Cheers,
> Ahmad
> 
>>
>> Thanks
>> Alex
>>
>>
>>> Rob
>>>
>>
>> _______________________________________________
>> Linux-stm32 mailing list
>> Linux-stm32@st-md-mailman.stormreply.com
>> https://st-md-mailman.stormreply.com/mailman/listinfo/linux-stm32
>>
> 
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-stm32] [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-12-08  9:55             ` [Linux-stm32] " Alexandre TORGUE
@ 2021-12-08 12:08               ` Lee Jones
  2021-12-08 13:34                 ` Alexandre TORGUE
  0 siblings, 1 reply; 14+ messages in thread
From: Lee Jones @ 2021-12-08 12:08 UTC (permalink / raw)
  To: Alexandre TORGUE
  Cc: Rob Herring, alsa-devel, Ahmad Fatoum, Maxime Coquelin,
	devicetree, linux-kernel, Liam Girdwood, Mark Brown,
	Olivier MOYSAN, alain.volmat, arnaud.pouliquen, Fabrice GASNIER,
	linux-stm32, linux-arm-kernel

On Wed, 08 Dec 2021, Alexandre TORGUE wrote:

> Hi Ahmad
> 
> On 12/7/21 2:59 PM, Ahmad Fatoum wrote:
> > Hello Alex,
> > 
> > On 07.12.21 14:52, Alexandre TORGUE wrote:
> > > Hi Rob
> > > 
> > > On 12/1/21 11:34 PM, Rob Herring wrote:
> > > > On Fri, Nov 26, 2021 at 11:25:27AM +0100, Olivier MOYSAN wrote:
> > > > > Hi Rob,
> > > > > 
> > > > > On 11/25/21 10:26 PM, Rob Herring wrote:
> > > > > > On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
> > > > > > > The STM2 I2S DAI can be connected via the audio-graph-card.
> > > > > > > Add port entry into the bindings.
> > > > > > > 
> > > > > > > Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> > > > > > > ---
> > > > > > >     Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
> > > > > > >     1 file changed, 5 insertions(+)
> > > > > > > 
> > > > > > 
> > > > > > Running 'make dtbs_check' with the schema in this patch gives the
> > > > > > following warnings. Consider if they are expected or the schema is
> > > > > > incorrect. These may not be new warnings.
> > > > > > 
> > > > > > Note that it is not yet a requirement to have 0 warnings for dtbs_check.
> > > > > > This will change in the future.
> > > > > > 
> > > > > > Full log is available here: https://patchwork.ozlabs.org/patch/1559750
> > > > > > 
> > > > > > 
> > > > > > audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
> > > > > >      arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
> > > > > >      arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
> > > > > > 
> > > > > 
> > > > > This warning is not a new one.
> > > > > 
> > > > > The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
> > > > > port:
> > > > >      $ref: audio-graph-port.yaml#
> > > > >      unevaluatedProperties: false
> > > > > 
> > > > > However the spi binding requires to introduce a unit address:
> > > > > patternProperties:
> > > > >     '^port@[0-9]':
> > > > >       $ref: audio-graph-port.yaml#
> > > > >       unevaluatedProperties: false
> > > > > 
> > > > > The warning can be removed by re-ordering the bindings patches in the serie,
> > > > > as "additionalProperties: true" makes the check more tolerant on extra
> > > > > properties.
> > > > 
> > > > That's never right.
> > > > 
> > > > > The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can
> > > > > even be merely dropped.
> > > > > So, I suggest to resend the serie without audio-graph-card patch.
> > > > 
> > > > Only if you aren't using audio-graph-card.
> > > > 
> > > > > 
> > > > > Does it sound too permissive to you ?
> > > > 
> > > > I think perhaps you need to combine the schemas into 1. Or you need to
> > > > restructure your dtsi files such that you only add spi specific
> > > > properties when spi mode is enabled and only add i2s specific properties
> > > > when i2s mode is enabled. Or use the /delete-property/ directive.
> > > 
> > > Initially the aim of this series was to fix a "make W=1" warnings seen on spi and i2s nodes (duplicate unit-address). Moving both nodes in a common node + using a different compatible depending on SPI or I2S usage sounded good) but it is not enough. In this series the common node is named as following: "spi2s2: spi@4000b000". It is fine for a spi usage but if we want to use this "common node" with I2S compatible and specific bindings, the node name remains spi@... and then specific spi checks are done. For this with this series applied we got this issue reported by spi-controller.yaml:
> > > 
> > > spi@4000b000: port@0: 'compatible' is a required property
> > > 
> > > So, if we use two separates nodes we got W=1 warning and if we use a common node we got yaml check issue. One possibility would be to use a common node with a new node name (for example i2spi@...) but I think it is not acceptable.
> > > 
> > > How to progress ?
> > 
> > Atmel Flexcom can be configured to be either UART, SPI or i2c. Functions
> > are child nodes of the flexcom node and the MFD driver matching against it,
> > just configure the operating mode and then calls of_platform_populate.
> > 
> > Would something along these lines fit here as well?
> 
> Yes it could but in my mind it was not a MFD as both feature cannot be used
> at the same time: it is either SPI or I2S and choice is done "statically" in
> device tree depending board usage.
> 
> Lee, what it is your feeling about that ? Will you accept to add a MFD
> driver for this SPI/I2S peripheral whose prurpose is only to populate child
> node (either SPI or I2S) ?

From your description, this doesn't sound like a good fit for MFD.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-stm32] [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-12-08 12:08               ` Lee Jones
@ 2021-12-08 13:34                 ` Alexandre TORGUE
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre TORGUE @ 2021-12-08 13:34 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Ahmad Fatoum
  Cc: devicetree, alsa-devel, Maxime Coquelin, linux-kernel,
	Liam Girdwood, Mark Brown, Olivier MOYSAN, alain.volmat,
	arnaud.pouliquen, Fabrice GASNIER, linux-stm32, linux-arm-kernel

On 12/8/21 1:08 PM, Lee Jones wrote:
> On Wed, 08 Dec 2021, Alexandre TORGUE wrote:
> 
>> Hi Ahmad
>>
>> On 12/7/21 2:59 PM, Ahmad Fatoum wrote:
>>> Hello Alex,
>>>
>>> On 07.12.21 14:52, Alexandre TORGUE wrote:
>>>> Hi Rob
>>>>
>>>> On 12/1/21 11:34 PM, Rob Herring wrote:
>>>>> On Fri, Nov 26, 2021 at 11:25:27AM +0100, Olivier MOYSAN wrote:
>>>>>> Hi Rob,
>>>>>>
>>>>>> On 11/25/21 10:26 PM, Rob Herring wrote:
>>>>>>> On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
>>>>>>>> The STM2 I2S DAI can be connected via the audio-graph-card.
>>>>>>>> Add port entry into the bindings.
>>>>>>>>
>>>>>>>> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
>>>>>>>> ---
>>>>>>>>      Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
>>>>>>>>      1 file changed, 5 insertions(+)
>>>>>>>>
>>>>>>>
>>>>>>> Running 'make dtbs_check' with the schema in this patch gives the
>>>>>>> following warnings. Consider if they are expected or the schema is
>>>>>>> incorrect. These may not be new warnings.
>>>>>>>
>>>>>>> Note that it is not yet a requirement to have 0 warnings for dtbs_check.
>>>>>>> This will change in the future.
>>>>>>>
>>>>>>> Full log is available here: https://patchwork.ozlabs.org/patch/1559750
>>>>>>>
>>>>>>>
>>>>>>> audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
>>>>>>>       arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
>>>>>>>       arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
>>>>>>>
>>>>>>
>>>>>> This warning is not a new one.
>>>>>>
>>>>>> The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
>>>>>> port:
>>>>>>       $ref: audio-graph-port.yaml#
>>>>>>       unevaluatedProperties: false
>>>>>>
>>>>>> However the spi binding requires to introduce a unit address:
>>>>>> patternProperties:
>>>>>>      '^port@[0-9]':
>>>>>>        $ref: audio-graph-port.yaml#
>>>>>>        unevaluatedProperties: false
>>>>>>
>>>>>> The warning can be removed by re-ordering the bindings patches in the serie,
>>>>>> as "additionalProperties: true" makes the check more tolerant on extra
>>>>>> properties.
>>>>>
>>>>> That's never right.
>>>>>
>>>>>> The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can
>>>>>> even be merely dropped.
>>>>>> So, I suggest to resend the serie without audio-graph-card patch.
>>>>>
>>>>> Only if you aren't using audio-graph-card.
>>>>>
>>>>>>
>>>>>> Does it sound too permissive to you ?
>>>>>
>>>>> I think perhaps you need to combine the schemas into 1. Or you need to
>>>>> restructure your dtsi files such that you only add spi specific
>>>>> properties when spi mode is enabled and only add i2s specific properties
>>>>> when i2s mode is enabled. Or use the /delete-property/ directive.
>>>>
>>>> Initially the aim of this series was to fix a "make W=1" warnings seen on spi and i2s nodes (duplicate unit-address). Moving both nodes in a common node + using a different compatible depending on SPI or I2S usage sounded good) but it is not enough. In this series the common node is named as following: "spi2s2: spi@4000b000". It is fine for a spi usage but if we want to use this "common node" with I2S compatible and specific bindings, the node name remains spi@... and then specific spi checks are done. For this with this series applied we got this issue reported by spi-controller.yaml:
>>>>
>>>> spi@4000b000: port@0: 'compatible' is a required property
>>>>
>>>> So, if we use two separates nodes we got W=1 warning and if we use a common node we got yaml check issue. One possibility would be to use a common node with a new node name (for example i2spi@...) but I think it is not acceptable.
>>>>
>>>> How to progress ?
>>>
>>> Atmel Flexcom can be configured to be either UART, SPI or i2c. Functions
>>> are child nodes of the flexcom node and the MFD driver matching against it,
>>> just configure the operating mode and then calls of_platform_populate.
>>>
>>> Would something along these lines fit here as well?
>>
>> Yes it could but in my mind it was not a MFD as both feature cannot be used
>> at the same time: it is either SPI or I2S and choice is done "statically" in
>> device tree depending board usage.
>>
>> Lee, what it is your feeling about that ? Will you accept to add a MFD
>> driver for this SPI/I2S peripheral whose prurpose is only to populate child
>> node (either SPI or I2S) ?
> 
>  From your description, this doesn't sound like a good fit for MFD.

Thanks Lee for your quick answer. So rename the node frop spi@... to 
i2spi@... (or something else) looks like to be the only solution. 
Depending the compatible used the well schema will be used (if well 
referenced in each stm32 spi and i2s yaml files):

--> spi-controller.yaml in case of "st,stm32h7-spi"

-->audio-controller in case of "st,stm32h7-i2s"

Rob, do you agree?

regards
alex

> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
       [not found]         ` <627777a4-7458-88ed-e7c5-d11e3db847b5@foss.st.com>
       [not found]           ` <cf5f994b-aecf-e051-f5c9-4a46e6414207@pengutronix.de>
@ 2021-12-11 20:05           ` Rob Herring
  2021-12-13 16:26             ` Alexandre TORGUE
  1 sibling, 1 reply; 14+ messages in thread
From: Rob Herring @ 2021-12-11 20:05 UTC (permalink / raw)
  To: Alexandre TORGUE
  Cc: devicetree, Linux-ALSA, Olivier Moysan, Olivier MOYSAN,
	Mark Brown, linux-kernel, Liam Girdwood, Amelie Delaunay,
	Fabrice Gasnier, Maxime Coquelin, Alain Volmat, Arnaud Pouliquen,
	moderated list:ARM/STM32 ARCHITECTURE, linux-arm-kernel

On Tue, Dec 7, 2021 at 7:52 AM Alexandre TORGUE
<alexandre.torgue@foss.st.com> wrote:
>
> Hi Rob
>
> On 12/1/21 11:34 PM, Rob Herring wrote:
> > On Fri, Nov 26, 2021 at 11:25:27AM +0100, Olivier MOYSAN wrote:
> >> Hi Rob,
> >>
> >> On 11/25/21 10:26 PM, Rob Herring wrote:
> >>> On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
> >>>> The STM2 I2S DAI can be connected via the audio-graph-card.
> >>>> Add port entry into the bindings.
> >>>>
> >>>> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> >>>> ---
> >>>>    Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
> >>>>    1 file changed, 5 insertions(+)
> >>>>
> >>>
> >>> Running 'make dtbs_check' with the schema in this patch gives the
> >>> following warnings. Consider if they are expected or the schema is
> >>> incorrect. These may not be new warnings.
> >>>
> >>> Note that it is not yet a requirement to have 0 warnings for dtbs_check.
> >>> This will change in the future.
> >>>
> >>> Full log is available here: https://patchwork.ozlabs.org/patch/1559750
> >>>
> >>>
> >>> audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
> >>>     arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
> >>>     arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
> >>>
> >>
> >> This warning is not a new one.
> >>
> >> The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
> >> port:
> >>      $ref: audio-graph-port.yaml#
> >>      unevaluatedProperties: false
> >>
> >> However the spi binding requires to introduce a unit address:
> >> patternProperties:
> >>    '^port@[0-9]':
> >>      $ref: audio-graph-port.yaml#
> >>      unevaluatedProperties: false
> >>
> >> The warning can be removed by re-ordering the bindings patches in the serie,
> >> as "additionalProperties: true" makes the check more tolerant on extra
> >> properties.
> >
> > That's never right.
> >
> >> The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can
> >> even be merely dropped.
> >> So, I suggest to resend the serie without audio-graph-card patch.
> >
> > Only if you aren't using audio-graph-card.
> >
> >>
> >> Does it sound too permissive to you ?
> >
> > I think perhaps you need to combine the schemas into 1. Or you need to
> > restructure your dtsi files such that you only add spi specific
> > properties when spi mode is enabled and only add i2s specific properties
> > when i2s mode is enabled. Or use the /delete-property/ directive.
>
> Initially the aim of this series was to fix a "make W=1" warnings seen
> on spi and i2s nodes (duplicate unit-address). Moving both nodes in a
> common node + using a different compatible depending on SPI or I2S usage
> sounded good) but it is not enough. In this series the common node is
> named as following: "spi2s2: spi@4000b000". It is fine for a spi usage
> but if we want to use this "common node" with I2S compatible and
> specific bindings, the node name remains spi@... and then specific spi
> checks are done. For this with this series applied we got this issue
> reported by spi-controller.yaml:
>
> spi@4000b000: port@0: 'compatible' is a required property
>
> So, if we use two separates nodes we got W=1 warning and if we use a
> common node we got yaml check issue. One possibility would be to use a
> common node with a new node name (for example i2spi@...) but I think it
> is not acceptable.

It is acceptable, see this thread[1].

Rob

[1] https://lore.kernel.org/all/20211203183517.11390-1-semen.protsenko@linaro.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port
  2021-12-11 20:05           ` Rob Herring
@ 2021-12-13 16:26             ` Alexandre TORGUE
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre TORGUE @ 2021-12-13 16:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Linux-ALSA, Olivier Moysan, Olivier MOYSAN,
	Mark Brown, linux-kernel, Liam Girdwood, Amelie Delaunay,
	Fabrice Gasnier, Maxime Coquelin, Alain Volmat, Arnaud Pouliquen,
	moderated list:ARM/STM32 ARCHITECTURE, linux-arm-kernel

Hi Rob,

On 12/11/21 9:05 PM, Rob Herring wrote:
> On Tue, Dec 7, 2021 at 7:52 AM Alexandre TORGUE
> <alexandre.torgue@foss.st.com> wrote:
>>
>> Hi Rob
>>
>> On 12/1/21 11:34 PM, Rob Herring wrote:
>>> On Fri, Nov 26, 2021 at 11:25:27AM +0100, Olivier MOYSAN wrote:
>>>> Hi Rob,
>>>>
>>>> On 11/25/21 10:26 PM, Rob Herring wrote:
>>>>> On Thu, 25 Nov 2021 15:40:50 +0100, Olivier Moysan wrote:
>>>>>> The STM2 I2S DAI can be connected via the audio-graph-card.
>>>>>> Add port entry into the bindings.
>>>>>>
>>>>>> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
>>>>>> ---
>>>>>>     Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml | 5 +++++
>>>>>>     1 file changed, 5 insertions(+)
>>>>>>
>>>>>
>>>>> Running 'make dtbs_check' with the schema in this patch gives the
>>>>> following warnings. Consider if they are expected or the schema is
>>>>> incorrect. These may not be new warnings.
>>>>>
>>>>> Note that it is not yet a requirement to have 0 warnings for dtbs_check.
>>>>> This will change in the future.
>>>>>
>>>>> Full log is available here: https://patchwork.ozlabs.org/patch/1559750
>>>>>
>>>>>
>>>>> audio-controller@4000b000: 'port' does not match any of the regexes: '^port@[0-9]', 'pinctrl-[0-9]+'
>>>>>      arch/arm/boot/dts/stm32mp157a-dk1.dt.yaml
>>>>>      arch/arm/boot/dts/stm32mp157c-dk2.dt.yaml
>>>>>
>>>>
>>>> This warning is not a new one.
>>>>
>>>> The i2s2 node in stm32mp15xx-dkx.dtsi would require the following binding:
>>>> port:
>>>>       $ref: audio-graph-port.yaml#
>>>>       unevaluatedProperties: false
>>>>
>>>> However the spi binding requires to introduce a unit address:
>>>> patternProperties:
>>>>     '^port@[0-9]':
>>>>       $ref: audio-graph-port.yaml#
>>>>       unevaluatedProperties: false
>>>>
>>>> The warning can be removed by re-ordering the bindings patches in the serie,
>>>> as "additionalProperties: true" makes the check more tolerant on extra
>>>> properties.
>>>
>>> That's never right.
>>>
>>>> The patch "ASoC: dt-bindings: stm32: i2s: add audio-graph-card port" can
>>>> even be merely dropped.
>>>> So, I suggest to resend the serie without audio-graph-card patch.
>>>
>>> Only if you aren't using audio-graph-card.
>>>
>>>>
>>>> Does it sound too permissive to you ?
>>>
>>> I think perhaps you need to combine the schemas into 1. Or you need to
>>> restructure your dtsi files such that you only add spi specific
>>> properties when spi mode is enabled and only add i2s specific properties
>>> when i2s mode is enabled. Or use the /delete-property/ directive.
>>
>> Initially the aim of this series was to fix a "make W=1" warnings seen
>> on spi and i2s nodes (duplicate unit-address). Moving both nodes in a
>> common node + using a different compatible depending on SPI or I2S usage
>> sounded good) but it is not enough. In this series the common node is
>> named as following: "spi2s2: spi@4000b000". It is fine for a spi usage
>> but if we want to use this "common node" with I2S compatible and
>> specific bindings, the node name remains spi@... and then specific spi
>> checks are done. For this with this series applied we got this issue
>> reported by spi-controller.yaml:
>>
>> spi@4000b000: port@0: 'compatible' is a required property
>>
>> So, if we use two separates nodes we got W=1 warning and if we use a
>> common node we got yaml check issue. One possibility would be to use a
>> common node with a new node name (for example i2spi@...) but I think it
>> is not acceptable.
> 
> It is acceptable, see this thread[1].
> 
> Rob
> 
> [1] https://lore.kernel.org/all/20211203183517.11390-1-semen.protsenko@linaro.org/

Perfect! So we can abandon this series. Do you know if a patch has been 
sent to also update scripts/Makefile.lib ?

Regards
Alex


> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-12-13 16:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 14:40 [PATCH v2 0/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan
2021-11-25 14:40 ` [PATCH v2 1/4] ASoC: dt-bindings: stm32: i2s: add audio-graph-card port Olivier Moysan
2021-11-25 21:26   ` Rob Herring
2021-11-26 10:25     ` Olivier MOYSAN
2021-12-01 22:34       ` Rob Herring
     [not found]         ` <627777a4-7458-88ed-e7c5-d11e3db847b5@foss.st.com>
     [not found]           ` <cf5f994b-aecf-e051-f5c9-4a46e6414207@pengutronix.de>
2021-12-08  9:55             ` [Linux-stm32] " Alexandre TORGUE
2021-12-08 12:08               ` Lee Jones
2021-12-08 13:34                 ` Alexandre TORGUE
2021-12-11 20:05           ` Rob Herring
2021-12-13 16:26             ` Alexandre TORGUE
2021-11-25 14:40 ` [PATCH v2 2/4] ASoC: dt-bindings: stm32: i2s: allow additional properties Olivier Moysan
2021-12-01 22:31   ` Rob Herring
2021-11-25 14:40 ` [PATCH v2 3/4] ASoC: dt-bindings: stm32: i2s: update example Olivier Moysan
2021-11-25 14:40 ` [PATCH v2 4/4] ARM: dts: stm32: merge spi and i2s nodes Olivier Moysan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).