【i2s】Milk-V Duo添加speaker——max98357a解码器驱动

Hi LangZhao,

Thanks so much for this patch. Although it doesn’t apply automatically to the latest SDK in github, I was able to manually apply the changes and it built cleanly and appears to have started up the audio drivers!

dmesg output:

[    0.182521] get audio clk=24576000
[    0.186060] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 24576000
[    0.408717] Advanced Linux Sound Architecture Driver Initialized.
[    1.000484] cvitek-i2s 4100000.i2s: cvi_i2s_probe
[    1.005982] cvitek-i2s 4120000.i2s: cvi_i2s_probe
[    1.011500] cvitek-i2s 4130000.i2s: cvi_i2s_probe
[    1.021219] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[    1.028338] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[    1.037038] cvitekaadc 300a100.adc: cvitekaadc_probe
[    1.102873] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[    1.116422] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[    1.167089] ALSA device list:

ALSA devices available:

[root@milkv-duo]~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: max98357a [cv1835 max98357a], device 0: max98357a i2s HiFi-0 [max98357a i2s HiFi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[root@milkv-duo]~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: cv182xaadc [cv182xa_adc], device 0: cviteka-adc 300a100.adc-0 [cviteka-adc 300a100.adc-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I haven’t tried to use these yet but this is very encouraging. I noticed that the patch you provided did not include the changes for the uboot pin mux on the ethernet connector so that may need to be added.

I have prepared a patch against the latest SDK - note this is just for the Duo 64:
Dropbox - new_i2s-mic.patch - Simplify your life

1 Like