Page 1 of 1

"Merge" device tree overlays

Posted: Sun Aug 12, 2018 11:42 am
by dtbuild
Hello everyone!

I am currently stuck in implementing a new device tree overlay to initialize two sound controller: PCM5142 and WM8804.
The used board is the DACBerry ONE ( ... 1ab-2b-3b/).

I can see both chips in the I2C at the adresses 0x4c (PCM5142) and 0x3b (WM8804).
I am also able to initialize them as ALSA cards with a few device tree overlays, for example:
- iqaudio-dacplus for the PCM5142 ( ... verlay.dts)
- justboom-digi for the WM8804 ( ... verlay.dts)

With those overlays specified in the /boot/config.txt I can either use the PCM5142 or the WM8804, not both chips simultaneously.
It should be possible (also confirmed from the manufacturer of the board), but it is not implemented yet.

My idea was to create a new overlay which uses both initialization routines from the both overlays mentioned above, but I am unsure how to do that.

Does anyone have an idea?

Thanks in advance

Re: "Merge" device tree overlays

Posted: Fri Aug 17, 2018 7:53 pm
by PhilE
The BCM2835 family of devices only has one I2S interface, so I'm puzzled as to how you would go about having both audio codecs active at the same time. I'm not even sure how the I2S driver will react to two codecs being initialised simultaneously, but at least it should be easy to try,

From what I can see the (first?) reason that loading both overlays doesn't work is that they are both contending for a single DT node - "/soc/sound". If you edit one of the overlays and replace

Code: Select all

        target = <&sound>;
        __overlay__ {
                compatible = ...

Code: Select all

        target-path = "/soc";
        __overlay__ {
                sound2 {
                        compatible = ...
then the two overlays ought to be able to coexist, but I wouldn't like to predict what happens beyond that.