[PATCH 0/8] ASoC: sophgo: add CV1800 AIAO mux and I2S support

Anton D. Stavinskii posted 8 patches 3 weeks, 1 day ago
.../bindings/sound/sophgo,cv1800b-i2s.yaml         |  75 +++
.../bindings/sound/sophgo,cv1800b-sound-adc.yaml   |  43 ++
.../bindings/sound/sophgo,cv1800b-sound-dac.yaml   |  43 ++
arch/riscv/boot/dts/sophgo/Makefile                |   1 +
arch/riscv/boot/dts/sophgo/cv180x-dmamux.h         |  57 ++
arch/riscv/boot/dts/sophgo/cv180x.dtsi             |  49 ++
.../boot/dts/sophgo/sg2002-milkv-duo-256m.dts      | 231 +++++++
sound/soc/Kconfig                                  |   1 +
sound/soc/Makefile                                 |   1 +
sound/soc/sophgo/Kconfig                           |  41 ++
sound/soc/sophgo/Makefile                          |   5 +
sound/soc/sophgo/cv1800b-sound-adc.c               | 322 ++++++++++
sound/soc/sophgo/cv1800b-sound-dac.c               | 204 ++++++
sound/soc/sophgo/cv1800b-tdm.c                     | 714 +++++++++++++++++++++
14 files changed, 1787 insertions(+)
[PATCH 0/8] ASoC: sophgo: add CV1800 AIAO mux and I2S support
Posted by Anton D. Stavinskii 3 weeks, 1 day ago
This patch series adds basic audio support for Sophgo CV1800B, 
as used on boards such as the Milk-V Duo. 
The series introduces an AIAO audio mux driver, 
an I2S controller driver, corresponding DT bindings, 
and DTS updates to wire the components together.

The implementation is based on vendor documentation 
and testing on real hardware.  This series relies on 
recent fixes in the DesignWare AXI DMA support; 
in particular, correct operation depends on 
the DMA changes discussed at:
https://lore.kernel.org/all/20251214224601.598358-1-inochiama@gmail.com/ 
The current driver implementation supports a fixed audio configuration 
of 48 kHz sample rate.  The series has been tested on the 
Milk-V Duo 256M board using the Sophgo SG2002 SoC. 
The implementation is expected to also work on Milk-V Duo and Milk-V Module 
boards based on the SG2000 SoC, as the audio 
and DMA blocks are closely related.

Known hardware limitation:
On CV1800B / SG2002, the I2S2 output pins cannot be enabled via pinctrl alone.
Due to SoC design constraints, the output path becomes functional only after 
additional vendor-specific register programming. 
This series makes the limitation explicit and does not attempt to work around 
it implicitly via pinctrl or undocumented behavior.

Signed-off-by: Anton D. Stavinskii <stavinsky@gmail.com>
---
Anton D. Stavinskii (8):
      dt-bindings: sound: sophgo: add CV1800B I2S/TDM controller binding
      ASoC: sophgo: add CV1800B I2S/TDM controller driver
      dt-bindings: sound: sophgo: add CV1800B internal ADC codec
      ASoC: sophgo: add CV1800B internal ADC codec driver
      dt-bindings: sound: sophgo: add CV1800B internal DAC codec
      ASoC: sophgo: add CV1800B internal DAC codec driver
      riscv: dts: sophgo: dts nodes for i2s tdm modules
      riscv: dts: sophgo: add Milk-V Duo 256M board dts

 .../bindings/sound/sophgo,cv1800b-i2s.yaml         |  75 +++
 .../bindings/sound/sophgo,cv1800b-sound-adc.yaml   |  43 ++
 .../bindings/sound/sophgo,cv1800b-sound-dac.yaml   |  43 ++
 arch/riscv/boot/dts/sophgo/Makefile                |   1 +
 arch/riscv/boot/dts/sophgo/cv180x-dmamux.h         |  57 ++
 arch/riscv/boot/dts/sophgo/cv180x.dtsi             |  49 ++
 .../boot/dts/sophgo/sg2002-milkv-duo-256m.dts      | 231 +++++++
 sound/soc/Kconfig                                  |   1 +
 sound/soc/Makefile                                 |   1 +
 sound/soc/sophgo/Kconfig                           |  41 ++
 sound/soc/sophgo/Makefile                          |   5 +
 sound/soc/sophgo/cv1800b-sound-adc.c               | 322 ++++++++++
 sound/soc/sophgo/cv1800b-sound-dac.c               | 204 ++++++
 sound/soc/sophgo/cv1800b-tdm.c                     | 714 +++++++++++++++++++++
 14 files changed, 1787 insertions(+)
---
base-commit: 7a52965b6976c936f413eebeee3f78c6faf09012
change-id: 20260115-cv1800b-i2s-driver-4f17836dec56

Best regards,
-- 
Anton D. Stavinskii <stavinsky@gmail.com>
Re: [PATCH 0/8] ASoC: sophgo: add CV1800 AIAO mux and I2S support
Posted by Inochi Amaoto 3 weeks, 1 day ago
On Thu, Jan 15, 2026 at 11:17:37PM +0400, Anton D. Stavinskii wrote:
> This patch series adds basic audio support for Sophgo CV1800B, 
> as used on boards such as the Milk-V Duo. 
> The series introduces an AIAO audio mux driver, 
> an I2S controller driver, corresponding DT bindings, 
> and DTS updates to wire the components together.
> 

I haven't see your mux driver, is it missed?

> The implementation is based on vendor documentation 
> and testing on real hardware.  This series relies on 
> recent fixes in the DesignWare AXI DMA support; 
> in particular, correct operation depends on 
> the DMA changes discussed at:
> https://lore.kernel.org/all/20251214224601.598358-1-inochiama@gmail.com/ 
> The current driver implementation supports a fixed audio configuration 
> of 48 kHz sample rate.  The series has been tested on the 
> Milk-V Duo 256M board using the Sophgo SG2002 SoC. 
> The implementation is expected to also work on Milk-V Duo and Milk-V Module 
> boards based on the SG2000 SoC, as the audio 
> and DMA blocks are closely related.
> 
> Known hardware limitation:
> On CV1800B / SG2002, the I2S2 output pins cannot be enabled via pinctrl alone.
> Due to SoC design constraints, the output path becomes functional only after 
> additional vendor-specific register programming. 
> This series makes the limitation explicit and does not attempt to work around 
> it implicitly via pinctrl or undocumented behavior.
> 
> Signed-off-by: Anton D. Stavinskii <stavinsky@gmail.com>
> ---
> Anton D. Stavinskii (8):
>       dt-bindings: sound: sophgo: add CV1800B I2S/TDM controller binding
>       ASoC: sophgo: add CV1800B I2S/TDM controller driver
>       dt-bindings: sound: sophgo: add CV1800B internal ADC codec
>       ASoC: sophgo: add CV1800B internal ADC codec driver
>       dt-bindings: sound: sophgo: add CV1800B internal DAC codec
>       ASoC: sophgo: add CV1800B internal DAC codec driver
>       riscv: dts: sophgo: dts nodes for i2s tdm modules
>       riscv: dts: sophgo: add Milk-V Duo 256M board dts
> 
>  .../bindings/sound/sophgo,cv1800b-i2s.yaml         |  75 +++
>  .../bindings/sound/sophgo,cv1800b-sound-adc.yaml   |  43 ++
>  .../bindings/sound/sophgo,cv1800b-sound-dac.yaml   |  43 ++
>  arch/riscv/boot/dts/sophgo/Makefile                |   1 +
>  arch/riscv/boot/dts/sophgo/cv180x-dmamux.h         |  57 ++
>  arch/riscv/boot/dts/sophgo/cv180x.dtsi             |  49 ++
>  .../boot/dts/sophgo/sg2002-milkv-duo-256m.dts      | 231 +++++++
>  sound/soc/Kconfig                                  |   1 +
>  sound/soc/Makefile                                 |   1 +
>  sound/soc/sophgo/Kconfig                           |  41 ++
>  sound/soc/sophgo/Makefile                          |   5 +
>  sound/soc/sophgo/cv1800b-sound-adc.c               | 322 ++++++++++
>  sound/soc/sophgo/cv1800b-sound-dac.c               | 204 ++++++
>  sound/soc/sophgo/cv1800b-tdm.c                     | 714 +++++++++++++++++++++
>  14 files changed, 1787 insertions(+)
> ---
> base-commit: 7a52965b6976c936f413eebeee3f78c6faf09012
> change-id: 20260115-cv1800b-i2s-driver-4f17836dec56
> 
> Best regards,
> -- 
> Anton D. Stavinskii <stavinsky@gmail.com>
> 

Thanks for your patch, for all the patchs, I hope you write a
meaningful comment for the patch, at least for now I found it
is nothing in your comment.

Also, the patch 8 should not in this patch and should be a
separate patch.

Regards,
Inochi
Re: [PATCH 0/8] ASoC: sophgo: add CV1800 AIAO mux and I2S support
Posted by Anton D. Stavinskii 3 weeks, 1 day ago
> On Thu, Jan 15, 2026 at 11:17:37PM +0400, Anton D. Stavinskii wrote:
> > This patch series adds basic audio support for Sophgo CV1800B, 
> > as used on boards such as the Milk-V Duo. 
> > The series introduces an AIAO audio mux driver, 
> > an I2S controller driver, corresponding DT bindings, 
> > and DTS updates to wire the components together.
> > 
> 
> I haven't see your mux driver, is it missed?

That was bad copy paste from original version. 
Thanks for noticing this. Will update the cover letter.
I want to not overcomplicate already big patch series.
So multiplexing will be done later. 
> 

> Thanks for your patch, for all the patchs, I hope you write a
> meaningful comment for the patch, at least for now I found it
> is nothing in your comment.

Thank you for a great help with that series. Do you mean
I need to add more meaningful comments for each commit or the 
cover letter is not describing everything clear enough? 
Anyway will do my best in the second version. 
> 
> Also, the patch 8 should not in this patch and should be a
> separate patch.

Yes I've missed this thing. I will remove the last commit 
and move codecs nodes to the base dtsi file.
Re: [PATCH 0/8] ASoC: sophgo: add CV1800 AIAO mux and I2S support
Posted by Inochi Amaoto 3 weeks ago
On Fri, Jan 16, 2026 at 09:25:51PM +0400, Anton D. Stavinskii wrote:
> > On Thu, Jan 15, 2026 at 11:17:37PM +0400, Anton D. Stavinskii wrote:
> > > This patch series adds basic audio support for Sophgo CV1800B, 
> > > as used on boards such as the Milk-V Duo. 
> > > The series introduces an AIAO audio mux driver, 
> > > an I2S controller driver, corresponding DT bindings, 
> > > and DTS updates to wire the components together.
> > > 
> > 
> > I haven't see your mux driver, is it missed?
> 
> That was bad copy paste from original version. 
> Thanks for noticing this. Will update the cover letter.
> I want to not overcomplicate already big patch series.
> So multiplexing will be done later. 
> > 
> 
> > Thanks for your patch, for all the patchs, I hope you write a
> > meaningful comment for the patch, at least for now I found it
> > is nothing in your comment.
> 
> Thank you for a great help with that series. Do you mean
> I need to add more meaningful comments for each commit or the 
> cover letter is not describing everything clear enough? 
> Anyway will do my best in the second version. 

For each commit, the cover letter is OK.

Regards,
Inochi

> > 
> > Also, the patch 8 should not in this patch and should be a
> > separate patch.
> 
> Yes I've missed this thing. I will remove the last commit 
> and move codecs nodes to the base dtsi file. 
>