Problems with SGTL5000 Codec on Custom Board

I am implementing a SGTL5000 codec on a custom board. I previously had used the Fe-Pi breakout board for testing and it worked great. Unfortunately I had to change a few data buses and am now receiving several errors during startup:

[   16.568015] sgtl5000 2-000a: sgtl5000_pcm_hw_params: set sysclk first!
[   16.574626] sgtl5000 2-000a: ASoC: can't set sgtl5000 hw params: -14
[   16.582483] tegra-asoc: sound: ASoC: PRE_PMU: x Capture-I2S4 DAP Receive event failed: -14
[   16.678957] tegra210-i2s tegra210-i2s.3: Failed at I2S4 DAP RX sw reset
[   16.685602] tegra210-i2s tegra210-i2s.3: ASoC: PRE_PMU: I2S4 DAP RX event failed: -22

The driver is able to register the codec at 0x0A as verified through i2cdetect. I have tried to look up what these errors mean but haven’t had much success. The codec receives MCLK through a 12.288MHz oscillator which I have verified. I have also verified that the codec is successfully outputting 48kHz on the LRCLK line and 3.072MHz on the SCLK line.

The I2S bus is connected to i2s4 and the I2C is connected to i2c3.

The relevant portions of my device tree are:

clocks {
	sgtl5000_mclk: sgtl5000_mclk {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <12288000>;
		clock-output-names = "sgtl5000-mclk";
		status = "okay";
	};
};

...

sound {
	...
	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";
	...
	nvidia,dai-link-1 {
		link-name = "sgtl5000-codec";
		cpu-dai = <0x53>;
		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 = <0xbb80>;
		num-channel = <0x2>;
		ignore_suspend;
		name-prefix = [78 00];
		status = "okay";
	};
};

...

i2c@7000c500 {
	...
	sgtl5000: sgtl5000@0a {
		compatible = "fsl,sgtl5000";
		reg = <0x0a>;
		clocks = <&sgtl5000_mclk>;
		micbias-resistor-k-ohms = <2>;
		micbias-voltage-m-volts = <3000>;
		VDDA-supply = <0x4c>;
		VDDIO-supply = <0xa8>;
		status = "okay";
	};
};

pinmux@700008d4 {
	...
	common {
		...
		dap4_din_pj5 {			//I2S0_DIN pin 195
			nvidia,pins = "dap4_din_pj5";
			nvidia,function = "i2s4b";
			nvidia,pull = <0x0>;
			nvidia,tristate = <0x0>;
			nvidia,enable-input = <0x1>;
		};

		dap4_dout_pj6 {			//I2S0_DOUT pin 193
			nvidia,pins = "dap4_dout_pj6";
			nvidia,function = "i2s4b";
			nvidia,pull = <0x0>;
			nvidia,tristate = <0x0>;
			nvidia,enable-input = <0x1>;
		};

		dap4_fs_pj4 {			//I2S0_LRCK pin 197
			nvidia,pins = "dap4_fs_pj4";
			nvidia,function = "i2s4b";
			nvidia,pull = <0x0>;
			nvidia,tristate = <0x0>;
			nvidia,enable-input = <0x1>;
		};

		dap4_sclk_pj7 {			//I2S0_SCLK pin 199
			nvidia,pins = "dap4_sclk_pj7";
			nvidia,function = "i2s4b";
			nvidia,pull = <0x0>;
			nvidia,tristate = <0x0>;
			nvidia,enable-input = <0x1>;
		};

I haven’t modified the drivers at all, I was hoping to avoid that if possible.

Hello!

This indicates that snd_soc_dai_set_sysclk() has not been called for the codec to set the default MCLK rate. This needs to be called from the Tegra audio machine driver in the same way it is done for the FE-PI module. If you don’t wish to modify the driver, then in device you could change the ‘link-name’ for the codec to be ‘fe-pi-audio-z-v2’ and it should then call the tegra_machine_fepi_init() function to set the sysclk.

Regards,
Jon

Thank you for the quick response! Changing the link-name to "fe-pi-audio-z-v2" fixed the issue.