Message ID | 20241106152528.939232-2-olivier.moysan@foss.st.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ASoC: stm32: i2s: add stm32mp25 support | expand |
On Wed, Nov 06, 2024 at 04:25:27PM +0100, Olivier Moysan wrote: > Add STM32MP25 support for STM32 I2S peripheral, > through "st,stm32mp25-i2s" compatible. > > Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> > --- > .../bindings/sound/st,stm32-i2s.yaml | 60 +++++++++++++++---- > 1 file changed, 47 insertions(+), 13 deletions(-) > > diff --git a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml > index 8978f6bd63e5..8f08f1f28a1b 100644 > --- a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml > +++ b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml > @@ -13,13 +13,11 @@ description: > The SPI/I2S block supports I2S/PCM protocols when configured on I2S mode. > Only some SPI instances support I2S. > > -allOf: > - - $ref: dai-common.yaml# > - > properties: > compatible: > enum: > - st,stm32h7-i2s > + - st,stm32mp25-i2s > > "#sound-dai-cells": > const: 0 > @@ -28,18 +26,12 @@ properties: > maxItems: 1 > > clocks: > - items: > - - description: clock feeding the peripheral bus interface. > - - description: clock feeding the internal clock generator. > - - description: I2S parent clock for sampling rates multiple of 8kHz. > - - description: I2S parent clock for sampling rates multiple of 11.025kHz. > + minItems: 2 Keep old list and just add minItms here > + maxItems: 4 > > clock-names: > - items: > - - const: pclk > - - const: i2sclk > - - const: x8k > - - const: x11k > + minItems: 2 Ditto > + maxItems: 4 > > interrupts: > maxItems: 1 > @@ -79,6 +71,48 @@ required: > - dmas > - dma-names > > +allOf: > + - $ref: dai-common.yaml# > + - if: > + properties: > + compatible: > + contains: > + const: st,stm32h7-i2s > + > + then: > + properties: > + clocks: > + items: > + - description: clock feeding the peripheral bus interface. > + - description: clock feeding the internal clock generator. > + - description: I2S parent clock for sampling rates multiple of 8kHz. > + - description: I2S parent clock for sampling rates multiple of 11.025kHz. Instead: minItems: 4 > + > + clock-names: > + items: > + - const: pclk > + - const: i2sclk > + - const: x8k > + - const: x11k ditto > + > + - if: > + properties: > + compatible: > + contains: > + const: st,stm32mp25-i2s > + > + then: > + properties: > + clocks: > + items: > + - description: clock feeding the peripheral bus interface. > + - description: clock feeding the internal clock generator. instead: maxItems: 2 > + > + clock-names: > + items: > + - const: pclk > + - const: i2sclk ditto Thanks to this you keep the lists synchronized between variants - they share the items. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml index 8978f6bd63e5..8f08f1f28a1b 100644 --- a/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/st,stm32-i2s.yaml @@ -13,13 +13,11 @@ description: The SPI/I2S block supports I2S/PCM protocols when configured on I2S mode. Only some SPI instances support I2S. -allOf: - - $ref: dai-common.yaml# - properties: compatible: enum: - st,stm32h7-i2s + - st,stm32mp25-i2s "#sound-dai-cells": const: 0 @@ -28,18 +26,12 @@ properties: maxItems: 1 clocks: - items: - - description: clock feeding the peripheral bus interface. - - description: clock feeding the internal clock generator. - - description: I2S parent clock for sampling rates multiple of 8kHz. - - description: I2S parent clock for sampling rates multiple of 11.025kHz. + minItems: 2 + maxItems: 4 clock-names: - items: - - const: pclk - - const: i2sclk - - const: x8k - - const: x11k + minItems: 2 + maxItems: 4 interrupts: maxItems: 1 @@ -79,6 +71,48 @@ required: - dmas - dma-names +allOf: + - $ref: dai-common.yaml# + - if: + properties: + compatible: + contains: + const: st,stm32h7-i2s + + then: + properties: + clocks: + items: + - description: clock feeding the peripheral bus interface. + - description: clock feeding the internal clock generator. + - description: I2S parent clock for sampling rates multiple of 8kHz. + - description: I2S parent clock for sampling rates multiple of 11.025kHz. + + clock-names: + items: + - const: pclk + - const: i2sclk + - const: x8k + - const: x11k + + - if: + properties: + compatible: + contains: + const: st,stm32mp25-i2s + + then: + properties: + clocks: + items: + - description: clock feeding the peripheral bus interface. + - description: clock feeding the internal clock generator. + + clock-names: + items: + - const: pclk + - const: i2sclk + unevaluatedProperties: false examples:
Add STM32MP25 support for STM32 I2S peripheral, through "st,stm32mp25-i2s" compatible. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> --- .../bindings/sound/st,stm32-i2s.yaml | 60 +++++++++++++++---- 1 file changed, 47 insertions(+), 13 deletions(-)