Hi,
I managed to find it after following the instructions in the documentation. I feel like the solution is almost there and you’ve been super helpful.
This is my device tree which was copied from a sample file which I used as a template:
/dts-v1/;
/ {
overlay-name = "SGTL5000 Codec";
compatible = "nvidia,p3509-0000+p3668-0000", "nvidia,p3509-0000+p3668-0001";
fragment@0 {
target-path = "/";
__overlay__ {
clocks {
sgtl5000_mclk: sgtl5000_mclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12000000>;
clock-output-names = "sgtl5000-mclk";
status = "okay";
linux,phandle = <0x1>;
phandle = <0x1>;
};
};
};
};
fragment@1 {
target = <0xffffffff>;
__overlay__ {
#address-cells = <0x1>;
#size-cells = <0x0>;
sgtl5000: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
clocks = <&sgtl5000_mclk>;
micbias-resistor-k-ohms = <2>;
micbias-voltage-m-volts = <3000>;
status = "okay";
VDDA-supply = <&hdr40_vdd_3v3>;
VDDIO-supply = <&hdr40_vdd_3v3>;
status = "okay"
linux,phandle = <0x2>;
phandle = <0x2>;
};
};
};
fragment@2 {
target = <0xffffffff>;
__overlay__ {
nvidia,audio-routing = "x Headphone", "x HP_OUT", "x MIC_IN", "x Mic", "x ADC", "x Mic Bias", "x LINE_IN", "x Line In", "x Line Out", "x LINE_OUT";
};
};
fragment@3 {
target = <0xffffffff>;
__overlay__ {
hdr40_snd_link_i2s: i2s_dai_link1: nvidia,dai-link-1 {
link-name = "fe-pi-audio-z-v2";
cpu-dai = <&tegra_i2s4>;
codec-dai = <&sgtl5000>;
cpu-dai-name = "I2S4";
codec-dai-name = "sgtl5000";
format = "i2s";
bitclock-master;
frame-master;
bitclock-noninversion;
frame-noninversion;
bit-format = "s16_le";
srate = <48000>;
num-channel = <2>;
name-prefix = "x";
status = "okay";
};
};
};
fragment@4 {
target = <0xffffffff>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <0x3>;
header-40pin-pinmux {
linux,phandle = <0x3>;
phandle = <0x3>;
pin12 {
nvidia,pins = "dap5_sclk_pt5";
nvidia,function = "i2s5";
nvidia,pull = <0x1>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <0x1>;
};
pin35 {
nvidia,pins = "dap5_fs_pu0";
nvidia,function = "i2s5";
nvidia,pull = <0x1>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <0x1>;
};
pin38 {
nvidia,pins = "dap5_din_pt7";
nvidia,function = "i2s5";
nvidia,pull = <0x1>;
nvidia,tristate = <0x1>;
nvidia,enable-input = <0x1>;
};
pin40 {
nvidia,pins = "dap5_dout_pt6";
nvidia,function = "i2s5";
nvidia,pull = <0x1>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <0x0>;
};
};
};
};
fragment@5 {
i2s@2901400 {
status = "okay";
};
};
__symbols__ {
sgtl5000_mclk = "/fragment@0/__overlay__/clocks/sgtl5000_mclk";
sgtl5000 = "/fragment@1/__overlay__/sgtl5000@0a";
hdr40_pinmux = "/fragment@4/__overlay__/header-40pin-pinmux";
};
__fixups__ {
hdr40_i2c1 = "/fragment@1:target:0";
hdr40_vdd_3v3 = "/fragment@1/__overlay__/sgtl5000@0a:VDDA-supply:0", "/fragment@1/__overlay__/sgtl5000@0a:VDDIO-supply:0";
tegra_sound = "/fragment@2:target:0";
hdr40_snd_link_i2s = "/fragment@3:target:0";
pinmux = "/fragment@4:target:0";
};
__local_fixups__ {
fragment@1 {
__overlay__ {
sgtl5000@0a {
clocks = <0x0>;
};
};
};
fragment@3 {
__overlay__ {
codec-dai = <0x0>;
};
};
fragment@4 {
__overlay__ {
pinctrl-0 = <0x0>;
};
};
};
};
I’m thinking that I am missing a whole lot more from this file since the errors I receive is that the reference node/label is non-existant.