Hello,
I am trying to get Freescale SGTL5000 working with TX1. I am using L4T 28.2 . At the moment i am just trying to get the sgtl5000 codec driver to successfully complete I2C probe. I added the following device tree entry in order to do this.
i2c@7000c000 {
sgtl5000_codec: sgtl5000@0a {
status = "okay";
compatible = "fsl,sgtl5000";
reg = <0x0a>;
clocks=<&tegra_car TEGRA210_CLK_EXTERN1>;
VDDA-supply = <&vdd_1v8_ap>;
VDDIO-supply = <&vdd_1v8_ap>;
VDDD-supply = <&vdd_1v8_ap>;
};
};
The driver gives the following error
sgtl5000: probe of 0-000a failed with error -121
I scoped the I2C lines and found driver is communicating on the correct bus but there is no ACK. When i scoped AUD_MCLK signal i see no clock output.
Then i found this post here https://devtalk.nvidia.com/default/topic/949616/jetson-tx1/setting-audio_mclk-to-output/post/4940627/#4940627 and tried exporting and unexporting the GPIO as suggested and the clock signal started working.
If i build the SGTL5000 driver as LKM and load it after exporting and unexporting GPIO then the probe completes successfully.
How do i get the AUD_MCLK to output correctly without exporting and unexporting the GPIO ?
So far i have tried adding the following DT entries with no luck
pinmux: pinmux@700008d4 {
pinmux_default: common {
/* SFIO Pin Configuration */
aud_mclk_pbb0 {
nvidia,pins = "aud_mclk_pbb0";
nvidia,function = "aud";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
};
};
};
gpio@6000d000 {
gpio_default: default {
gpio-init-names = "default";
gpio-init-0 = <&gpio_default>;
gpio-to-sfio = < /* GPIO# TX1-PIN TX1-FUNC/ERA-FUNC CODEC-PIN */
TEGRA_GPIO(B, 0) /* 8 H1 I2S0_LRCLK/SFSYNC R335/3 */
TEGRA_GPIO(B, 1) /* 9 G1 I2S0_SDIN R339/5 */
TEGRA_GPIO(B, 2) /* 10 H2 I2S0_SDOUT R337/4 */
TEGRA_GPIO(B, 3) /* 11 G2 I2S0_CLK/SRCLK R334/2 */
TEGRA_GPIO(BB, 0) /* 216 F1 AUDIO_MCLK R1/R332/1 */
/* This is commented out; we leave the CODEC enabled. */
/*TEGRA_GPIO(BB, 3) /* 219 F2 CODEC_RST R331/31 */
>;
};
};