The DAPM concept is not a basic concept. To understand the routing you need to understand the DAPM concept.
The DAPM widgets are kind of node of a audio routing graph, powered up when you start a playback or a record and power down 5 second after the audio stream is closed.
DAPM widgets can be defined in :
- ASoC card
- CPU DAI driver ( e.g. SAI, I2S)
- audio codec driver( e.g cs42l51 driver)
you can list the DAPM widgets in board console:
root@stm32mp1:~# ls /sys/kernel/debug/asoc/STM32MP15-DK/*/dapm
/sys/kernel/debug/asoc/STM32MP15-DK/4000b000.audio-controller/dapm:
bias_level capture playback
/sys/kernel/debug/asoc/STM32MP15-DK/4400b004.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/4400b024.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/cs42l51.0-004a/dapm:
AIN1L AIN2L Capture HPL Left ADC Left PGA MICL Mic Bias Mic Preamp Right PGA-ADC Mux Right Right ADC Right PGA
AIN1R AIN2R DAC Mux HPR Left DAC MCLK MICR Mic Preamp Left PGA-ADC Mux Left Playback Right DAC bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4000b000.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4400b004.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4400b024.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/hdmi-audio-codec.1.auto/dapm:
I2S Playback TX bias_level
The routing consists in interconecting the widget to create a route to enable everything needed for the playback or record
- a part of the route is done in the codec driver
- a part of the route is done in the card ( e.g to connect the codec with the CPU DAI)
- a part of the route is described in device tree
routing =
"Playback" , "MCLK", /* connect the cs42l51 "MCLK" widget to the 4400b004.audio-controller "playback" widget to enable MCLK on playback */
"Capture" , "MCLK", /* connect the cs42l51 "MCLK" widget to the 4400b004.audio-controller "playback" widget to enable MCLK on record */
"MICL" , "Mic Bias"; /* connect the cs42l51 "Mic Bias" widget to the cs42l51 "MICL" widget to enable micbias when microphone input is active */
Extra documentation on DAPM: https://events.static.linuxfound.org/sites/events/files/slides/dapm.pdf ( there is video associated, but seems no more available)