Can someone can look over my setup for using a sgtl5000 with i2c on
my carrier board and give some suggestins about what I have missed?
I am running the TX2i on a carrier with a SGTL5000 connected to
i2c-3 (pins C12 and C13 (GP3) also known in the HW manual as Gen9
and in the linux output from i2cdetect as i2c-8)
The i2s hookup is to i2s-2
Following the forum post How can I use Freescale‘s sgtl5000 on TX2? - Jetson TX2 - NVIDIA Developer Forums
I made the following changes to kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
diff --git a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
index 12a92ac..31504af 100644
--- a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
@@ -63,6 +63,31 @@
status = "okay";
};
+ clocks {
+ sgtl5000_mclk: sgtl5000_mclk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <12288000>;
+ clock-output-names = "sgtl5000-mclk";
+ status = "okay";
+ };
+ };
+
+ i2c@31e0000 {
+ status = "okay";
+
+ sgtl5000: sgtl5000@0a {
+ compatible = "fsl,sgtl5000";
+ reg = <0x0a>;
+ clocks = <&sgtl5000_mclk>;
+ micbias-resistor-k-ohms = <2>;
+ micbias-voltage-m-volts = <3000>;
+ VDDA-supply = <&vdd_3v3>;
+ VDDIO-supply = <&vdd_1v8>;
+ status = "okay";
+ };
+ };
+
i2c@3160000 {
status = "okay";
lp8557_backlight: lp8557-backlight-s-wuxga-8-0@2c {
@@ -900,8 +925,8 @@
status = "okay";
lp8557_backlight: lp8557-backlight-s-wuxga-8-0@2c {
@@ -900,8 +925,8 @@
status = "okay";
nvidia,audio-routing =
- "x Headphone", "x OUT",
- "x IN", "x Mic",
+ "x Headphone", "x HP_OUT",
+ "x MIC_IN", "x Mic",
"y Headphone", "y OUT",
"y IN", "y Mic",
"z Headphone", "z OUT",
@@ -922,12 +947,16 @@
nvidia,xbar = <&tegra_axbar>;
rt565x_dai_link: nvidia,dai-link-1 {
- link-name = "rt565x-playback";
+ link-name = "fe-pi-audio-z-v2";
cpu-dai = <&tegra_i2s1>;
- codec-dai = <&spdif_dit0>;
+ codec-dai = <&sgtl5000>;
cpu-dai-name = "I2S1";
- codec-dai-name = "dit-hifi";
+ codec-dai-name = "sgtl5000";
format = "i2s";
+ bitclock-master; # in example 20190506
+ frame-master; # ditto
+ bitclock-noninversion; # also was in example - not a change
+ frame-noninversion; #also was in example - but not a change
bit-format = "s16_le";
bclk_ratio = <0>;
srate = <48000>;
@@ -940,7 +969,7 @@
link-name = "spdif-dit-1";
cpu-dai = <&tegra_i2s2>;
codec-dai = <&spdif_dit1>;
- cpu-dai-name = "I2S2";
+ cpu-dai-name = "I2S2"; # I2S_2 should be the correct one.
codec-dai-name = "dit-hifi";
format = "i2s";
bit-format = "s16_le";
--
2.17.1
I also did the kernel Kconfig and other changes as needed as well as configuring
the modules that were recommended.
However. I think that there must be some low level issue that I missed because
i2cdetect cannot see the sgtl5000 (I have tried both the 0x0a and 0x2a bus
addresses that this chip can be addressed at.) Here is some output showing the
no devices found on i2c-8 (That is the bus that corresponds to the i2c-GP3
name associated with C12 and C13.)
root@aud:~# i2cdetect -l
i2c-3 i2c 3190000.i2c I2C adapter
i2c-1 i2c c240000.i2c I2C adapter
i2c-8 i2c 31e0000.i2c I2C adapter
i2c-6 i2c 31c0000.i2c I2C adapter
i2c-4 i2c Tegra BPMP I2C adapter I2C adapter
i2c-2 i2c 3180000.i2c I2C adapter
i2c-0 i2c 3160000.i2c I2C adapter
i2c-7 i2c c250000.i2c I2C adapter
i2c-5 i2c 31b0000.i2c I2C adapter
root@aud:~# i2cdetect -y -r 8
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@aud:~#
for comparison the devices on the i2c-PM (bus i2c-7) are found just fine
root@aud:~# i2cdetect -y -r 7
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
50: 50 -- -- -- -- -- -- 57 58 -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Obviously the driver isn’t going to work if the device is not even seen.
What did I miss?
Thanks and best regards,
Curtis