dtbuild
Posts: 1
Joined: Sun Aug 12, 2018 11:28 am

"Merge" device tree overlays

Sun Aug 12, 2018 11:42 am

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 (https://www.osaelectronics.com/product/ ... 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 (https://github.com/raspberrypi/linux/bl ... verlay.dts)
- justboom-digi for the WM8804 (https://github.com/raspberrypi/linux/bl ... 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

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1814
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: "Merge" device tree overlays

Fri Aug 17, 2018 7:53 pm

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 = ...
                ...
        };
with

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.

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 3 guests