i allready tried to merge 2 DTS to have 1 DTB after compiling to get my both cards connected via GPIO to work via I2S.
Hifiberry DAC uses this DTS
Code: Select all
// Definitions for HiFiBerry DAC
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "hifiberry,hifiberry-dac";
i2s-controller = <&i2s>;
status = "okay";
};
};
fragment@1 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};
fragment@2 {
target-path = "/";
__overlay__ {
pcm5102a-codec {
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
status = "okay";
};
};
};
};
Code: Select all
/dts-v1/;
/ {
compatible = "brcm,bcm2837", "brcm,bcm2836", "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target-path = "/";
__overlay__ {
codec-reg-1v8 {
compatible = "regulator-fixed";
regulator-name = "tlv320aic3204_1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
};
};
fragment@2 {
target = <&gpio>;
__overlay__ {
codec-rst {
brcm,pins = <0x1a>;
brcm,function = <0x1>;
};
};
};
fragment@3 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
codec_osc {
compatible = "fixed-clock";
#clock-cells = <0x0>;
clock-frequency = <0xb71b00>;
};
tlv320aic32x4@18 {
#sound-dai-cells = <0x0>;
compatible = "ti,tlv320aic32x4";
reg = <0x18>;
clocks = <0x1>;
clock-names = "mclk";
iov-supply = <&vdd_3v3_reg>;
ldoin-supply = <&vdd_3v3_reg>;
gpio-controller;
#gpio-cells = <0x2>;
reset-gpios = <&gpio 0x1a 0x0>;
status = "okay";
};
};
};
fragment@4 {
target = <&sound>;
__overlay__ {
compatible = "as,audiosense-pi";
i2s-controller = <&i2s>;
status = "okay";
};
};
__symbols__ {
codec_reg_1v8 = "/fragment@1/__overlay__/codec-reg-1v8";
codec_rst = "/fragment@2/__overlay__/codec-rst";
codec_osc = "/fragment@3/__overlay__/codec_osc";
codec = "/fragment@3/__overlay__/tlv320aic32x4@18";
};
__fixups__ {
i2s = "/fragment@0:target:0", "/fragment@4/__overlay__:i2s-controller:0";
gpio = "/fragment@2:target:0", "/fragment@3/__overlay__/tlv320aic32x4@18:reset-gpios:0";
i2c1 = "/fragment@3:target:0";
vdd_3v3_reg = "/fragment@3/__overlay__/tlv320aic32x4@18:iov-supply:0", "/fragment@3/__overlay__/tlv320aic32x4@18:ldoin-supply:0";
sound = "/fragment@4:target:0";
};
__local_fixups__ {
fragment@3 {
__overlay__ {
tlv320aic32x4@18 {
clocks = <0x0>;
};
};
};
};
};
Code: Select all
// Definitions for audiosense add on soundcard
/dts-v1/;
/plugin/;
#include <dt-bindings/pinctrl/bcm2835.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "brcm,bcm2837", "brcm,bcm2836", "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target-path = "/";
__overlay__ {
codec_reg_1v8: codec-reg-1v8 {
compatible = "regulator-fixed";
regulator-name = "tlv320aic3204_1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
};
};
fragment@2 {
target = <&gpio>;
__overlay__ {
codec_rst: codec-rst {
brcm,pins = <26>;
brcm,function = <BCM2835_FSEL_GPIO_OUT>;
};
};
};
fragment@3 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
/* audio external oscillator */
codec_osc: codec_osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12000000>; /* 12 MHz */
};
codec: tlv320aic32x4@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic32x4";
reg = <0x18>;
clocks = <&codec_osc>;
clock-names = "mclk";
iov-supply = <&vdd_3v3_reg>;
ldoin-supply = <&vdd_3v3_reg>;
gpio-controller;
#gpio-cells = <2>;
reset-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
status = "okay";
};
};
};
fragment@4 {
target = <&sound>;
__overlay__ {
compatible = "as,audiosense-pi";
i2s-controller = <&i2s>;
status = "okay";
};
};
};
Code: Select all
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2837", "brcm,bcm2836", "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "simple-audio-card";
simple-audio-card,name = "Dual";
status="okay";
capture_link: simple-audio-card,dai-link@0 {
format = "i2s";
r_cpu_dai: cpu {
sound-dai = <&i2s>;
/* example TDM slot configuration
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
*/
};
r_codec_dai: codec {
sound-dai = <&codec_in>;
};
};
playback_link: simple-audio-card,dai-link@1 {
format = "i2s";
p_cpu_dai: cpu {
sound-dai = <&i2s>;
/* example TDM slot configuration
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
*/
};
p_codec_dai: codec {
sound-dai = <&codec_out>;
};
};
};
};
fragment@1 {
target-path = "/";
__overlay__ {
codec_out: spdif-transmitter {
#address-cells = <0>;
#size-cells = <0>;
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
status = "okay";
};
codec_in: spdif-receiver {
#address-cells = <0>;
#size-cells = <0>;
#sound-dai-cells = <0>;
compatible = "linux,spdif-dir";
status = "okay";
};
};
};
fragment@2 {
target = <&i2s>;
__overlay__ {
#sound-dai-cells = <0>;
status = "okay";
};
};
};
Code: Select all
compatible = "ti,tlv320aic32x4"
With the merged DTS i have shown, the Hifiberry worked. Sound was clear.