Purpose: introduce DT schema for the CPU driver
The driver uses dma to transfer data. The dma it self has 8 channels.
Each channel can be connected only to a specific i2s node. But each
of dma channel can have multiple purposes so in order to save dma
channels the configurations allows to use tx and rx, only rx, only tx
or none channels. I2S controller without channels can be useful in
configuration where I2S is used as clock source only and doesn't
produce any data.
Signed-off-by: Anton D. Stavinskii <stavinsky@gmail.com>
---
.../bindings/sound/sophgo,cv1800b-i2s.yaml | 75 ++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml b/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml
new file mode 100644
index 000000000000..cf30880a62da
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/sophgo,cv1800b-i2s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sophgo CV1800B I2S/TDM controller
+
+maintainers:
+ - Anton D. Stavinskii <stavinsky@gmail.com>
+
+description: |
+ I2S/TDM controller found in CV1800B / Sophgo SG2002/SG2000 SoCs.
+
+properties:
+ compatible:
+ const: sophgo,cv1800b-i2s
+
+ reg:
+ maxItems: 1
+
+ "#sound-dai-cells":
+ const: 0
+
+ clocks:
+ minItems: 1
+ maxItems: 2
+
+ clock-names:
+ items:
+ - const: i2s
+ - const: mclk
+
+ dmas:
+ maxItems: 2
+
+ dma-names:
+ description: |
+ Names of DMA channels. May be omitted. If present, one entry
+ selects a single direction, while two entries select RX and TX.
+ minItems: 1
+ maxItems: 2
+ items:
+ enum: [rx, tx]
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - "#sound-dai-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/sophgo,cv1800.h>
+
+ i2s1: i2s@4110000 {
+ compatible = "sophgo,cv1800b-i2s";
+ reg = <0x04110000 0x10000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk CLK_APB_I2S1>, <&clk CLK_SDMA_AUD1>;
+ clock-names = "i2s", "mclk";
+ dmas = <&dmamux 2 1>, <&dmamux 3 1>;
+ dma-names = "rx", "tx";
+ };
+...
--
2.43.0
On Sun, Jan 18, 2026 at 12:18:53AM +0400, Anton D. Stavinskii wrote:
> Purpose: introduce DT schema for the CPU driver
Bindings are for hardware, not drivers. Drop the purpose.
> The driver uses dma to transfer data. The dma it self has 8 channels.
Describe the hardware.
> Each channel can be connected only to a specific i2s node. But each
> of dma channel can have multiple purposes so in order to save dma
> channels the configurations allows to use tx and rx, only rx, only tx
> or none channels. I2S controller without channels can be useful in
> configuration where I2S is used as clock source only and doesn't
> produce any data.
Please use subject prefixes matching the subsystem. You can get them for
example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
A nit, subject: drop second/last, redundant "binding". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>
> Signed-off-by: Anton D. Stavinskii <stavinsky@gmail.com>
> ---
> .../bindings/sound/sophgo,cv1800b-i2s.yaml | 75 ++++++++++++++++++++++
> 1 file changed, 75 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml b/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml
> new file mode 100644
> index 000000000000..cf30880a62da
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml
> @@ -0,0 +1,75 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/sophgo,cv1800b-i2s.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sophgo CV1800B I2S/TDM controller
> +
> +maintainers:
> + - Anton D. Stavinskii <stavinsky@gmail.com>
> +
> +description: |
Do not need '|' unless you need to preserve formatting.
> + I2S/TDM controller found in CV1800B / Sophgo SG2002/SG2000 SoCs.
> +
Miss allOf with ref to dai-common.
> +properties:
> + compatible:
> + const: sophgo,cv1800b-i2s
> +
> + reg:
> + maxItems: 1
> +
> + "#sound-dai-cells":
> + const: 0
> +
> + clocks:
> + minItems: 1
> + maxItems: 2
1. Why is it flexible?
2. And then why names are not flexible. These should be synced in
constraints.
> +
> + clock-names:
> + items:
> + - const: i2s
> + - const: mclk
> +
> + dmas:
> + maxItems: 2
> +
> + dma-names:
> + description: |
> + Names of DMA channels. May be omitted. If present, one entry
> + selects a single direction, while two entries select RX and TX.
Drop desription. Don't repeat constraints in free form text.
> + minItems: 1
> + maxItems: 2
Again, messed constraints.
> + items:
> + enum: [rx, tx]
No, it has to be a specific/fixed list.
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
Why? Drop these.
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - clock-names
> + - "#sound-dai-cells"
> +
> +additionalProperties: false
unevaluatedProperties instead
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/sophgo,cv1800.h>
> +
> + i2s1: i2s@4110000 {
Drop unused label.
> + compatible = "sophgo,cv1800b-i2s";
> + reg = <0x04110000 0x10000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
Drop useless properties.
Best regards,
Krzysztof
On Sun, Jan 18, 2026 at 11:14:34AM +0400, Krzysztof Kozlowski wrote: > > Please use subject prefixes matching the subsystem. You can get them for > example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory > your patch is touching. For bindings, the preferred subjects are > explained here: > https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters dt-bindings: sound: sophgo,cv1800b: add I2S/TDM controller Is this anyhow better? Also in the documentation directory should go first but I didn't find such examples in git follow. Thanks.
On 18/01/2026 18:07, Anton D. Stavinskii wrote: > On Sun, Jan 18, 2026 at 11:14:34AM +0400, Krzysztof Kozlowski wrote: >> >> Please use subject prefixes matching the subsystem. You can get them for >> example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory >> your patch is touching. For bindings, the preferred subjects are >> explained here: >> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters > > dt-bindings: sound: sophgo,cv1800b: add I2S/TDM controller No. Read again, I even gave you DIRECT doc link! > > Is this anyhow better? Also in the documentation directory should go > first but I didn't find such examples in git follow. Huh? How so? Where are you looking? 99% of commits have correct prefix. Where do you see sound: b7d53fe53cb5 ASoC: dt-bindings: rtq9128: Add rtq9154 backward compatible 35bffbe49dfd ASoC: dt-bindings: Convert realtek,rt5651 to DT schema 70d95c5d2081 ASoC: dt-bindings: rockchip-spdif: Allow "port" node f66e7da2a6b1 ASoC: dt-bindings: realtek,rt5640: Allow 7 for 101b982654ac ASoC: dt-bindings: realtek,rt5640: Add missing properties/ b540b4e157c4 ASoC: dt-bindings: realtek,rt5640: Document port node 25b858474497 ASoC: dt-bindings: realtek,rt5640: Update jack-detect 66b47b9c069f ASoC: dt-bindings: realtek,rt5640: Document mclk 9ebc914acd32 ASoC: ES8389: Add some members and update fd9a14d233fb ASoC: dt-bindings: everest,es8316: Add interrupt support af4c0b951b18 ASoC: dt-bindings: realtek,rt5575: add support for ALC5575 85a6544777e0 ALSA: hda: dt-bindings: add CIX IPBLOQ HDA controller 270d32cd0efc ASoC: dt-bindings: cirrus,cs42xx8: Reference common DAI bb52dc1d0342 ASoC: dt-bindings: ti,tas2781: Add 4980df101676 ASoC: dt-bindings: mediatek,mt8189-nau8825: add mt8189- 22e9bd51e518 ASoC: dt-bindings: mediatek,mt8189-afe-pcm: add audio afe 0b2333183ade dt-bindings: Remove extra blank lines bcc357c8e061 dt-bindings: Update Krzysztof Kozlowski's email c2561572031a ASoC: codecs: lpass-macro: complete sm6115 support 675f41b8d167 ASoC: dt-bindings: qcom,lpass-va-macro: Add sm6115 LPASS VA 5a0438622b49 ASoC: dt-bindings: qcom,lpass-va-macro: re-arrange clock- 65d03e84d8b8 ASoC: dt-bindings: qcom,lpass-rx-macro: Add sm6115 LPASS RX 4acbfcf11cbe ASoC: dt-bindings: consolidate simple audio codec to 7a381e373a42 ASoC: qcom: q6dsp: fixes and updates aa897ffc396b ASoC: dt-bindings: ti,pcm1862: convert to dtschema c4e68959af66 ASoC: dt-bindings: ti,tas2781: Add TAS5822 support 3cd523ba2706 ASoC: dt-bindings: cirrus,cs4271: Document mclk clock 5e5c8aa73d99 ASoC: dt-bindings: pm4125-sdw: correct number of soundwire 6ddcd78aa7f8 ASoC: dt-bindings: allwinner,sun4i-a10-spdif: Add 67e4b0dfcc67 ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible bb65cb96f64e ASoC: dt-bindings: sound: cirrus: cs530x: Add SPI bus 9957614d2b79 ASoC: dt-bindings: sound: cirrus: cs530x: Add cs530x ee4407e1288a ASoC: dt-bindings: qcom,sm8250: add QRB2210 soundcard 8c465b1669bf ASoC: spacemit: add i2s support to K1 SoC 2880c42a0de6 ASoC: amd: ps: Propagate the PCI subsystem Vendor and 6a4f29bc6629 ASoC: dt-bindings: don't check node names 73978d274eba ASoC: dt-bindings: Add bindings for SpacemiT K1 15afe57a874e ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs 367ca0688e42 ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card 62ef9b2a01a0 ASoC: Add QCS615 sound card support fcd298fdc2a3 ASoC: dt-bindings: Add compatible string fsl,imx-audio- Best regards, Krzysztof
On Sun, Jan 18, 2026 at 06:32:24PM +0400, Krzysztof Kozlowski wrote: > On 18/01/2026 18:07, Anton D. Stavinskii wrote: > > On Sun, Jan 18, 2026 at 11:14:34AM +0400, Krzysztof Kozlowski wrote: > >> > >> Please use subject prefixes matching the subsystem. You can get them for > >> example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory > >> your patch is touching. For bindings, the preferred subjects are > >> explained here: > >> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters > > > > dt-bindings: sound: sophgo,cv1800b: add I2S/TDM controller > > No. Read again, I even gave you DIRECT doc link! > > > > > Is this anyhow better? Also in the documentation directory should go > > first but I didn't find such examples in git follow. > > Huh? How so? Where are you looking? 99% of commits have correct prefix. > Where do you see sound: > > b7d53fe53cb5 ASoC: dt-bindings: rtq9128: Add rtq9154 backward compatible > 35bffbe49dfd ASoC: dt-bindings: Convert realtek,rt5651 to DT schema > 70d95c5d2081 ASoC: dt-bindings: rockchip-spdif: Allow "port" node > f66e7da2a6b1 ASoC: dt-bindings: realtek,rt5640: Allow 7 for > 101b982654ac ASoC: dt-bindings: realtek,rt5640: Add missing properties/ > b540b4e157c4 ASoC: dt-bindings: realtek,rt5640: Document port node > 25b858474497 ASoC: dt-bindings: realtek,rt5640: Update jack-detect > 66b47b9c069f ASoC: dt-bindings: realtek,rt5640: Document mclk Sorry I'm new to this and learning. For some reason I thought that "binding dir" in "<binding dir>: dt-bindings: ..." is actual directory of introduced file. That is why I said couldn't find any example because I didn't find anything with "sound:". Thank you for clarification. Got it now(I hope so). Removing sound, adding ASoC. Also the word binding removed as you told me ASoC: dt-bindings: sophgo,cv1800b: add I2S/TDM controller
On Sun, Jan 18, 2026 at 11:14:34AM +0400, Krzysztof Kozlowski wrote:
> On Sun, Jan 18, 2026 at 12:18:53AM +0400, Anton D. Stavinskii wrote:
> > Purpose: introduce DT schema for the CPU driver
>
> Bindings are for hardware, not drivers. Drop the purpose.
Noted. Will do in v3
>
> > The driver uses dma to transfer data. The dma it self has 8 channels.
>
> Describe the hardware.
Will try to rephrase. Thanks.
>
>
> > Each channel can be connected only to a specific i2s node. But each
> > of dma channel can have multiple purposes so in order to save dma
> > channels the configurations allows to use tx and rx, only rx, only tx
> > or none channels. I2S controller without channels can be useful in
> > configuration where I2S is used as clock source only and doesn't
> > produce any data.
>
> Please use subject prefixes matching the subsystem. You can get them for
> example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory
> your patch is touching. For bindings, the preferred subjects are
> explained here:
> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
I will do my best in V3. And will read provided links again.
>
> A nit, subject: drop second/last, redundant "binding". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>
> >
> > Signed-off-by: Anton D. Stavinskii <stavinsky@gmail.com>
> > ---
> > .../bindings/sound/sophgo,cv1800b-i2s.yaml | 75 ++++++++++++++++++++++
> > 1 file changed, 75 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml b/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml
> > new file mode 100644
> > index 000000000000..cf30880a62da
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/sophgo,cv1800b-i2s.yaml
> > @@ -0,0 +1,75 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/sophgo,cv1800b-i2s.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Sophgo CV1800B I2S/TDM controller
> > +
> > +maintainers:
> > + - Anton D. Stavinskii <stavinsky@gmail.com>
> > +
> > +description: |
>
> Do not need '|' unless you need to preserve formatting.
noted. will be fixed.
>
> > + I2S/TDM controller found in CV1800B / Sophgo SG2002/SG2000 SoCs.
> > +
>
> Miss allOf with ref to dai-common.
>
> > +properties:
> > + compatible:
> > + const: sophgo,cv1800b-i2s
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + "#sound-dai-cells":
> > + const: 0
> > +
> > + clocks:
> > + minItems: 1
> > + maxItems: 2
>
> 1. Why is it flexible?
It's my mistake.
>
> 2. And then why names are not flexible. These should be synced in
> constraints.
>
> > +
> > + clock-names:
> > + items:
> > + - const: i2s
> > + - const: mclk
> > +
> > + dmas:
> > + maxItems: 2
> > +
> > + dma-names:
> > + description: |
> > + Names of DMA channels. May be omitted. If present, one entry
> > + selects a single direction, while two entries select RX and TX.
Will drop.
>
> Drop desription. Don't repeat constraints in free form text.
>
> > + minItems: 1
> > + maxItems: 2
>
> Again, messed constraints.
>
> > + items:
> > + enum: [rx, tx]
>
> No, it has to be a specific/fixed list.
Here is the question. Can you please help to understand how to describe
this properly. The idea is that TDM module is usable even without
specified dmas. Each TDM can work as clock source, only rx only tx or
both. I can force to use both channels but the user probably will want
to not consume all the channels for if it is not needed. DMA can provide
channels for something else like SPI/I2C/UART etc. I'm asking because
I'm afraid I will do some mess again here.
>
> > +
> > + "#address-cells":
> > + const: 1
> > +
> > + "#size-cells":
> > + const: 0
>
> Why? Drop these.
noted. Will remove.
>
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - clocks
> > + - clock-names
> > + - "#sound-dai-cells"
> > +
> > +additionalProperties: false
>
> unevaluatedProperties instead
Thanks.
>
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/sophgo,cv1800.h>
> > +
> > + i2s1: i2s@4110000 {
>
> Drop unused label.
will be fixed. Thanks
>
> > + compatible = "sophgo,cv1800b-i2s";
> > + reg = <0x04110000 0x10000>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
>
> Drop useless properties.
>
> Best regards,
> Krzysztof
>
Sorry for the mess. It is my first ever patch. Thank you for your
review and your time. Will do my best to improve the patch series.
On 18/01/2026 13:18, Anton D. Stavinskii wrote: >> >> Again, messed constraints. >> >>> + items: >>> + enum: [rx, tx] >> >> No, it has to be a specific/fixed list. > > Here is the question. Can you please help to understand how to describe > this properly. The idea is that TDM module is usable even without > specified dmas. Each TDM can work as clock source, only rx only tx or > both. I can force to use both channels but the user probably will want > to not consume all the channels for if it is not needed. DMA can provide > channels for something else like SPI/I2C/UART etc. I'm asking because > I'm afraid I will do some mess again here. If any combination is valid in hardware, then: minItems: 1 items: - enum: [rx, tx] - const: tx Best regards, Krzysztof
© 2016 - 2026 Red Hat, Inc.