cancel
Showing results for 
Search instead for 
Did you mean: 

Define an ASoC soundcard in a separate Device Tree file?

AJank.2
Associate III

Hi,

I'm looking into creating sound cards with STM32MP135F-DK discovery board, and it seems that all the tutorials point to editing the /core/arch/arm/dts/stm32mp135f-dk.dts so that it takes the new sound card into account. Previously I had a chance to work with Raspberry Pi and there it's not uncommon to have multiple .dts files handling different things.

Is it possible to define a sound card in a separate file from the main board.dts also on the stm32 MPUs, or is it really a necessity to append to the the main file? If so, how?

5 REPLIES 5
PatrickF
ST Employee

HI @Antoni Jankowski​ ,

as far as I know, you could add as many 'include' as you want in dts files.

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree

For instance: https://github.com/STMicroelectronics/u-boot/blob/v2021.10-stm32mp/arch/arm/dts/stm32mp135f-dk.dts

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
AJank.2
Associate III

Shall I then include the stm32mp135f-dk.dts in my soundcard.dts file or the other way? The soundcard.dts has to use the i2s nodes, so my intuition tells me that the latter is correct.

PatrickF
ST Employee

If you are using an STM32MP135F-DK board, I think easier way is to #include your own dts 'adds' in existing stm32mp135f-dk.dts file.

In other way, you could define a new myboard.dts with all your wished additional settings and #include the stm32mp135f-dk.dts in it, but I guess this will require to modify some compilation script and configuration files to use a new myboard.dtb file name.

I'm not expert and if you did not reach a working solution, feel free to continue this thread or better open a new one with details of encountered issues.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
AJank.2
Associate III

Can you maybe provide an example of I2S-only based soundcard device tree configuration? The codec I want to use is rather simple, similar to PCM5102a, however the set up still isn't clear. The examples seem to mostly rely on sai bus.

PatrickF
ST Employee

We use I2S on STM32MP157F-DK2 for audio output on HDMI chipset (SiI9022).

https://github.com/STMicroelectronics/u-boot/blob/v2021.10-stm32mp/arch/arm/dts/stm32mp15xx-dkx.dtsi

If possible on your board, we recommend using SAI as it is likely more flexible than SPI/I2S as fully tailored for audio purposes.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.