Add I2S audio in the source code of JetPack4.2

Hi,

My TX2 installed the JetPack 4.2 version of the system, I want to add the TLV320AIC32X4 audio driver, but found that the L4T_source32.2 version of the source code and L4T_source28.2.1 version of the source code has a lot of different places.

  1. Which files need to be modified in the new version of the source file to add the TLV320AIC32X4 audio driver?
  2. Which file needs to be modified to set the baud rate of I2S?

Thanks

Hi,

Glad that you moved to latest JP release. I agree, the code has changed a lot.

Did you install JetPack 4.2 or Jetpack 4.2.1? Please confirm, we shall help you further.

Thanks,
Sharad

Hi,Sharad

I installed the JetPack 4.2.1 version of the system.

Thanks

For TX2, Sound node is present in:
hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi

Machine driver:
kernel/nvidia/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c

Please modify above files as per your requirements. [Also add TLV320AIC32X4 nodes in DT, include driver in the build].

With 32.2, Pinmux settings for I2S1 and AUD_MCLK interfaces are required during flash. As per your earlier queries, I understand that you are using I2S1 and I2S2 interfaces. Please modify bct/t186/pinmux/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg as

@@ -13,16 +13,6 @@
 pinmux.0x02434050 = 0x00000000; # GPIO gpio_wan2_pb5
 pinmux.0x02213200 = 0x00000001; # CONFIG C0
 pinmux.0x02434040 = 0x00000000; # GPIO gpio_wan4_pc0
-pinmux.0x02215000 = 0x00000001; # CONFIG J0
-pinmux.0x02431040 = 0x00000000; # GPIO dap1_sclk_pj0
-pinmux.0x02215020 = 0x00000001; # CONFIG J1
-pinmux.0x02431038 = 0x00000000; # GPIO dap1_dout_pj1
-pinmux.0x02215040 = 0x00000001; # CONFIG J2
-pinmux.0x02431030 = 0x00000000; # GPIO dap1_din_pj2
-pinmux.0x02215060 = 0x00000001; # CONFIG J3
-pinmux.0x02431028 = 0x00000000; # GPIO dap1_fs_pj3
-pinmux.0x02215080 = 0x00000001; # CONFIG J4
-pinmux.0x02431020 = 0x00000000; # GPIO aud_mclk_pj4
 pinmux.0x022150a0 = 0x00000001; # CONFIG J5
 pinmux.0x02431018 = 0x00000000; # GPIO gpio_aud0_pj5
 pinmux.0x022150c0 = 0x00000001; # CONFIG J6
@@ -73,8 +63,6 @@
 pinmux.0x02435000 = 0x00000000; # GPIO uart1_cts_pt3
 pinmux.0x0c2f1800 = 0x00000001; # CONFIG V0
 pinmux.0x0c302048 = 0x00000000; # GPIO gpio_sen0_pv0
-pinmux.0x0c2f1c00 = 0x00000001; # CONFIG AA0
-pinmux.0x0c303028 = 0x00000000; # GPIO can_gpio0_paa0
 pinmux.0x0c2f1c40 = 0x00000001; # CONFIG AA2
 pinmux.0x0c303038 = 0x00000000; # GPIO can_gpio2_paa2
 pinmux.0x0c2f1c60 = 0x00000001; # CONFIG AA3
@@ -152,8 +140,6 @@
 pinmux.0x0c302070 = 0x00000000; # GPIO gpio_sen5_pv5
 pinmux.0x0c2f1c20 = 0x00000003; # CONFIG AA1
 pinmux.0x0c2f1c2c = 0x00000000; # CONTROL AA1
-pinmux.0x0c2f1c30 = 0x00000000; # OUTPUT AA1
-pinmux.0x0c303030 = 0x00000000; # GPIO can_gpio1_paa1
 pinmux.0x0c2f1cc0 = 0x00000003; # CONFIG AA6
 pinmux.0x0c2f1ccc = 0x00000000; # CONTROL AA6
 pinmux.0x0c2f1cd0 = 0x00000000; # OUTPUT AA6
@@ -329,11 +315,11 @@
 pinmux.0x02434050 = 0x00000058; # gpio_wan2_pb5: rsvd0, pull-up, tristate-enable, input-enable, lpdr-disable
 pinmux.0x02434048 = 0x00000000; # gpio_wan3_pb6: rsvd0, tristate-disable, input-disable, lpdr-disable
 pinmux.0x02434040 = 0x00000058; # gpio_wan4_pc0: rsvd0, pull-up, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431040 = 0x00000055; # dap1_sclk_pj0: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431038 = 0x00000055; # dap1_dout_pj1: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431030 = 0x00000055; # dap1_din_pj2: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431028 = 0x00000055; # dap1_fs_pj3: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431020 = 0x00000059; # aud_mclk_pj4: rsvd1, pull-up, tristate-enable, input-enable, lpdr-disable
+pinmux.0x02431040 = 0x00000440; # dap1_sclk_pj0: i2s1, tristate-disable, input-enable
+pinmux.0x02431038 = 0x00000400; # dap1_dout_pj1: i2s1, tristate-disable, input-disable
+pinmux.0x02431030 = 0x00000448; # dap1_din_pj2: i2s1, pull-up, tristate-disable, input-enable
+pinmux.0x02431028 = 0x00000440; # dap1_fs_pj3: i2s1, tristate-disable, input-enable
+pinmux.0x02431020 = 0x00000400; # aud_mclk_pj4: aud, tristate-disable, input-disable
 pinmux.0x02431018 = 0x00000054; # gpio_aud0_pj5: rsvd0, pull-down, tristate-enable, input-enable, lpdr-disable
 pinmux.0x02431010 = 0x00000058; # gpio_aud1_pj6: rsvd0, pull-up, tristate-enable, input-enable, lpdr-disable
 pinmux.0x02432028 = 0x0000405a; # dmic4_clk_pm5: rsvd2, pull-up, tristate-enable, input-enable
@@ -372,8 +358,8 @@
 pinmux.0x02435000 = 0x00000055; # uart1_cts_pt3: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
 pinmux.0x0c302048 = 0x00000058; # gpio_sen0_pv0: rsvd0, pull-up, tristate-enable, input-enable, lpdr-disable
 pinmux.0x0c302070 = 0x00000000; # gpio_sen5_pv5: rsvd0, tristate-disable, input-disable, lpdr-disable
-pinmux.0x0c303028 = 0x00000054; # can_gpio0_paa0: rsvd0, pull-down, tristate-enable, input-enable
-pinmux.0x0c303030 = 0x00000000; # can_gpio1_paa1: rsvd0, tristate-disable, input-disable
+pinmux.0x0c303028 = 0x00000455; # can_gpio0_paa0: dmic3, pull-down, tristate-enable, input-enable
+pinmux.0x0c303030 = 0x00000405; # can_gpio1_paa1: dmic3, pull-down, tristate-disable, input-disable
 pinmux.0x0c303038 = 0x00000051; # can_gpio2_paa2: rsvd1, tristate-enable, input-enable
 pinmux.0x0c303040 = 0x00000040; # can_gpio3_paa3: rsvd0, tristate-disable, input-enable
 pinmux.0x0c303048 = 0x00000058; # can_gpio4_paa4: rsvd0, pull-up, tristate-enable, input-enable

Let us know if you need further help on this.

Thanks,
Sharad

Hi,Sharad.

I modified the code on the L4T_R32.2 source code, the log prompts “sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered”

dmesg.log

[    1.777768] OPE platform probe
[    1.777855] OPE platform probe successful
[    1.782569] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    1.782642] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    1.783185] u32 classifier
[    1.783187]     Actions configured
[    1.783280] Initializing XFRM netlink socket
[    1.784945] NET: Registered protocol family 10
[    1.790275] NET: Registered protocol family 17
[    1.790286] NET: Registered protocol family 15
[    1.790495] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.790592] Bluetooth: RFCOMM socket layer initialized
[    1.790607] Bluetooth: RFCOMM ver 1.11
[    1.790612] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    1.790620] Bluetooth: HIDP socket layer initialized
[    1.790658] 9pnet: Installing 9P2000 support
[    1.790699] Key type dns_resolver registered
[    1.790955] Registered cp15_barrier emulation handler
[    1.790973] Registered setend emulation handler
[    1.792603] registered taskstats version 1
[    1.796825] isp 15600000.isp: initialized
[    1.801875] nvcsi 150c0000.nvcsi: initialized
[    1.810779] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    1.810830] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    1.811409] tegra-vi4 15700000.vi: initialized
[    1.811956] gpio tegra-gpio-aon wake29 for gpio=56(FF:0)
[    1.812073] gpio tegra-gpio-aon wake67 for gpio=57(FF:1)
[    1.812148] gpio tegra-gpio-aon wake68 for gpio=58(FF:2)
[    1.812285] input: gpio-keys as /devices/gpio-keys/input/input2
[    1.812703] tegra-vi4 15700000.vi: ep of_device is not enabled /host1x/vi@15700000/ports/port@0/endpoint.
[    1.812707] tegra-vi4 15700000.vi: ep of_device is not enabled /host1x/vi@15700000/ports/port@1/endpoint.
[    1.815239] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    1.815277] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    1.819955] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    1.819999] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    1.845612] tegra_rtc c2a0000.rtc: setting system clock to 2019-08-21 06:42:30 UTC (1566369750)
[    1.846972] mmcblk mmc0:0001: Card claimed for testing.
[    1.882864] bpmp: mounted debugfs mirror
[    1.884689] bwmgr: missing cdev-type property
[    1.888081] usb 1-2.1: new low-speed USB device number 3 using tegra-xusb
[    1.891140] spmic-ldo0: disabling
[    1.891336] spmic-ldo1: disabling
[    1.891503] en-vdd-sd: disabling
[    1.891506] vdd-usb0-5v: disabling
[    1.891509] vdd-usb1-5v: disabling
[    1.891512] en-vdd-disp-3v3: disabling
[    1.891514] en-mdm-pwr-3v7: disabling
[    1.891516] en-vdd-disp-1v8: disabling
[    1.891518] en-vdd-cam-hv-2v8: disabling
[    1.891520] vdd-fan: disabling
[    1.891522] vdd-3v3: disabling
[    1.891545] en-vdd-vcm-2v8: disabling
[    1.891548] vdd-sys-bl: disabling
[    1.891550] ALSA device list:
[    1.891556]   #0: tegra-hda at 0x3518000 irq 383
[    1.910386] usb 1-2.1: device descriptor read/8, error -32
[    1.912142] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    1.954532] mmc1: Applying tuning correction
[    1.954547] mmc1: Tap value after applying correction 71
[    1.954552] mmc1: hw tuning done ...
[    1.958491] mmc1: new ultra high speed SDR104 SDIO card at address 0001
[    2.038270] usb 1-2.1: device descriptor read/8, error -32
[    2.224058] usb 1-2.1: new low-speed USB device number 4 using tegra-xusb
[    2.250285] usb 1-2.1: New USB device found, idVendor=1c4f, idProduct=0002
[    2.250289] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.250293] usb 1-2.1: Product: USB Keyboard
[    2.250295] usb 1-2.1: Manufacturer: SIGMACHIP
[    2.254127] input: SIGMACHIP USB Keyboard as /devices/3530000.xhci/usb1/1-2/1-2.1/1-2.1:1.0/0003:1C4F:0002.0001/input/input3
[    2.312407] hid-generic 0003:1C4F:0002.0001: input,hidraw0: USB HID v1.10 Keyboard [SIGMACHIP USB Keyboard] on usb-3530000.xhci-2.1/input0
[    2.314658] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    2.315482] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    2.315526] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    2.316073] tegra-pcie 10003000.pcie-controller: link 2 down, ignoring
[    2.316856] input: SIGMACHIP USB Keyboard as /devices/3530000.xhci/usb1/1-2/1-2.1/1-2.1:1.1/0003:1C4F:0002.0002/input/input4
[    2.376308] hid-generic 0003:1C4F:0002.0002: input,hidraw1: USB HID v1.10 Device [SIGMACHIP USB Keyboard] on usb-3530000.xhci-2.1/input1
[    2.379410] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    2.379445] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    2.422360] tegra-pcie 10003000.pcie-controller: PCI host bridge to bus 0000:00
[    2.422366] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    2.422370] pci_bus 0000:00: root bus resource [mem 0x40100000-0x47ffffff]
[    2.422373] pci_bus 0000:00: root bus resource [mem 0x48000000-0x7fffffff pref]
[    2.422379] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.422411] pci 0000:00:01.0: [10de:10e5] type 01 class 0x060400
[    2.422526] pci 0000:00:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.422674] iommu: Adding device 0000:00:01.0 to group 55
[    2.422683] arm-smmu: forcing sodev map for 0000:00:01.0
[    2.422764] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    2.422928] pci 0000:01:00.0: [8086:1533] type 00 class 0x020000
[    2.422997] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x0007ffff]
[    2.423046] pci 0000:01:00.0: reg 0x18: [io  0x0000-0x001f]
[    2.423072] pci 0000:01:00.0: reg 0x1c: [mem 0x00000000-0x00003fff]
[    2.423395] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    2.423589] iommu: Adding device 0000:01:00.0 to group 56
[    2.423592] arm-smmu: forcing sodev map for 0000:01:00.0
[    2.432139] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    2.432182] pci 0000:00:01.0: BAR 14: assigned [mem 0x40100000-0x401fffff]
[    2.432186] pci 0000:00:01.0: BAR 13: assigned [io  0x1000-0x1fff]
[    2.432191] pci 0000:01:00.0: BAR 0: assigned [mem 0x40100000-0x4017ffff]
[    2.432204] pci 0000:01:00.0: BAR 3: assigned [mem 0x40180000-0x40183fff]
[    2.432218] pci 0000:01:00.0: BAR 2: assigned [io  0x1000-0x101f]
[    2.432230] pci 0000:00:01.0: PCI bridge to [bus 01]
[    2.432235] pci 0000:00:01.0:   bridge window [io  0x1000-0x1fff]
[    2.432243] pci 0000:00:01.0:   bridge window [mem 0x40100000-0x401fffff]
[    2.432493] pcieport 0000:00:01.0: Signaling PME through PCIe PME interrupt
[    2.432496] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
[    2.432504] pcie_pme 0000:00:01.0:pcie001: service driver pcie_pme loaded
[    2.432577] aer 0000:00:01.0:pcie002: service driver aer loaded
[    2.432870] igb 0000:01:00.0: enabling device (0000 -> 0002)
[    2.436783] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    2.436816] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    2.461656] usb 1-2.2: new low-speed USB device number 5 using tegra-xusb
[    2.465244] pps pps0: new PPS source ptp1
[    2.465249] igb 0000:01:00.0: added PHC on eth1
[    2.465253] igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
[    2.465256] igb 0000:01:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 00:1b:21:39:c5:40
[    2.465360] igb 0000:01:00.0: eth1: PBA No: 000300-000
[    2.465363] igb 0000:01:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    2.468299] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    2.468335] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    2.485454] usb 1-2.2: New USB device found, idVendor=1c4f, idProduct=0034
[    2.485460] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.485464] usb 1-2.2: Product: Usb Mouse
[    2.485468] usb 1-2.2: Manufacturer: SIGMACHIP
[    2.489039] input: SIGMACHIP Usb Mouse as /devices/3530000.xhci/usb1/1-2/1-2.2/1-2.2:1.0/0003:1C4F:0034.0003/input/input5
[    2.489360] hid-generic 0003:1C4F:0034.0003: input,hidraw2: USB HID v1.10 Mouse [SIGMACHIP Usb Mouse] on usb-3530000.xhci-2.2/input0
[    2.492267] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    2.492305] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    3.845320] extcon-disp-state external-connection:disp-state: cable 40 state 1
[    3.845322] Extcon HDMI: HPD enabled
[    3.845336] tegradc 15210000.nvdisplay: hdmi: plugged
[    3.847113] Freeing unused kernel memory: 8576K
[    3.882451] L4T-INITRD Build DATE: Wed Aug 21 06:42:32 UTC 2019
[    3.891372] Root device found: mmcblk0p1
[    3.893311] Found dev node: /dev/mmcblk0p1
[    3.965951] EXT4-fs (mmcblk0p1): 9 orphan inodes deleted
[    3.965955] EXT4-fs (mmcblk0p1): recovery complete
[    3.971214] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    3.972473] Rootfs mounted over mmcblk0p1
[    4.003991] Switching from initrd to actual rootfs
[    4.141343] ip_tables: (C) 2000-2006 Netfilter Core Team
[    4.185957] cgroup: cgroup2: unknown option "nsdelegate"
[    4.208337] random: crng init done
[    4.214273] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    4.217410] systemd[1]: Detected architecture arm64.
[    4.308518] systemd[1]: Set hostname to <tegra>.
[    4.362081] Wake76 for irq=199
[    4.362087] Wake77 for irq=199
[    4.362090] Wake78 for irq=199
[    4.362092] Wake79 for irq=199
[    4.362095] Wake80 for irq=199
[    4.362097] Wake81 for irq=199
[    4.362099] Wake82 for irq=199
[    4.362158] tegra-xusb 3530000.xhci: Upgrade port 0 to USB3.0
[    4.362164] tegra-xusb 3530000.xhci: Upgrade port 1 to USB3.0
[    4.364141] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.371933] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.395787] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    4.395812] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    4.464268] usb usb2: usb_suspend_both: status 0
[    4.573594] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    4.573854] systemd[1]: Reached target User and Group Name Lookups.
[    4.577255] systemd[1]: Created slice System Slice.
[    4.579089] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    4.579413] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    4.614398] gpio tegra-gpio-aon wake30 for gpio=60(FF:4)
[    4.617646] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.617687] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.631550] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
[    4.698008] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.705539] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.774626] usb 1-2-port2: disabled by hub (EMI?), re-enabling...
[    4.781667] usb 1-2.2: USB disconnect, device number 5
[    4.822050] systemd-journald[2259]: Received request to flush runtime journal from PID 1
[    5.060067] usb 1-2.2: new low-speed USB device number 6 using tegra-xusb
[    5.089447] usb 1-2.2: New USB device found, idVendor=1c4f, idProduct=0034
[    5.089453] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.089456] usb 1-2.2: Product: Usb Mouse
[    5.089458] usb 1-2.2: Manufacturer: SIGMACHIP
[    5.092885] input: SIGMACHIP Usb Mouse as /devices/3530000.xhci/usb1/1-2/1-2.2/1-2.2:1.0/0003:1C4F:0034.0004/input/input6
[    5.093162] hid-generic 0003:1C4F:0034.0004: input,hidraw2: USB HID v1.10 Mouse [SIGMACHIP Usb Mouse] on usb-3530000.xhci-2.2/input0
[    5.096398] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    5.104545] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    5.517638] using random self ethernet address
[    5.522465] using random host ethernet address
[    5.564654] Mass Storage Function, version: 2009/09/11
[    5.564660] LUN: removable file: (no medium)
[    5.571042] using random self ethernet address
[    5.576672] using random host ethernet address
[    5.640944] rndis0: HOST MAC 02:7d:46:a3:bc:78
[    5.641104] rndis0: MAC 02:7d:46:a3:bc:79
[    5.642451] usb0: HOST MAC 02:7d:46:a3:bc:7a
[    5.642482] usb0: MAC 02:7d:46:a3:bc:7b
[    5.642509] tegra-xudc-new 3550000.xudc: ep 0 (type: 0, dir: out) enabled
[    5.649727] l4tbr0: port 1(rndis0) entered blocking state
[    5.649735] l4tbr0: port 1(rndis0) entered disabled state
[    5.653772] device rndis0 entered promiscuous mode
[    5.691188] IPv6: ADDRCONF(NETDEV_UP): rndis0: link is not ready
[    5.699955] l4tbr0: port 2(usb0) entered blocking state
[    5.699959] l4tbr0: port 2(usb0) entered disabled state
[    5.701780] device usb0 entered promiscuous mode
[    5.714514] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[    5.886027] dhd_module_init in
[    5.886106] found wifi platform device bcmdhd_wlan
[    5.887470] wifi_platform_get_country_code_map: could not get country_code_map
[    5.887474] wifi_plat_dev_drv_probe:platform country code map is not available
[    5.887489] Power-up adapter 'DHD generic adapter'
[    5.887496] wifi_platform_set_power = 1
[    6.016253] android_work: did not send uevent (0 0           (null))
[    6.077797] android_work: sent uevent USB_STATE=CONNECTED
[    6.092075] wifi_platform_bus_enumerate device present 1
[    6.094214] android_work: sent uevent USB_STATE=DISCONNECTED
[    6.096819] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    6.096848] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    6.100778] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    6.100813] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    6.116257] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    6.116294] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    6.116441] wifi_platform_bus_enumerate device present 0
[    6.125644] F1 signature read @0x18000000=0x17214354
[    6.137488] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[    6.138819] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[    6.138902] wifi_platform_get_mac_addr
[    6.146235] ids dhd_log_netlink_init
[    6.156097] wl_create_event_handler(): thread:wl_event_handler:1347 started
[    6.156133]  wl_event_handler : 
[    6.156134] tsk Enter, tsk = 0xffffffc1d5c41a90
[    6.158018] dhd_attach(): thread:dhd_watchdog_thread:134b started
[    6.160082] dhd_attach(): thread:dhd_dpc:134d started
[    6.162647] dhd_attach(): thread:dhd_rxf:134e started
[    6.162654] dhd_deferred_work_init: work queue initialized 
[    6.170065] 
               Dongle Host Driver, version 1.201.82 (r)
               Compiled from 
[    6.173964] Register interface [wlan0]  MAC: 00:04:4b:c7:81:8e

[    6.173969] dhd_prot_ioctl : bus is down. we have nothing to do
[    6.175606] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 71
[    6.176649] wifi_platform_set_power = 0
[    6.185801] android_work: sent uevent USB_STATE=CONNECTED
[    6.187509] configfs-gadget gadget: high-speed config #1: c
[    6.187535] tegra-xudc-new 3550000.xudc: ep 5 (type: 3, dir: in) enabled
[    6.187551] tegra-xudc-new 3550000.xudc: ep 3 (type: 2, dir: in) enabled
[    6.187565] tegra-xudc-new 3550000.xudc: ep 2 (type: 2, dir: out) enabled
[    6.187646] tegra-xudc-new 3550000.xudc: ep 9 (type: 3, dir: in) enabled
[    6.187662] tegra-xudc-new 3550000.xudc: ep 7 (type: 2, dir: in) enabled
[    6.187676] tegra-xudc-new 3550000.xudc: ep 4 (type: 2, dir: out) enabled
[    6.187709] tegra-xudc-new 3550000.xudc: ep 15 (type: 3, dir: in) enabled
[    6.187728] tegra-xudc-new 3550000.xudc: ep 11 (type: 2, dir: in) enabled
[    6.187748] tegra-xudc-new 3550000.xudc: ep 6 (type: 2, dir: out) enabled
[    6.187857] android_work: sent uevent USB_STATE=CONFIGURED
[    6.188080] IPv6: ADDRCONF(NETDEV_CHANGE): rndis0: link becomes ready
[    6.193081] tegra-xudc-new 3550000.xudc: ep 13 (type: 2, dir: in) enabled
[    6.193097] tegra-xudc-new 3550000.xudc: ep 8 (type: 2, dir: out) enabled
[    6.193231] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[    6.340764] nvgpu: 17000000.gp10b             railgate_enable_store:283  [INFO]  railgate is disabled.
[    6.391831] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    6.391867] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    6.394857] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    6.394893] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    6.661692] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    6.737011] gpio tegra-gpio wake18 for gpio=101(M:5)
[    6.739106] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    6.753989] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[    6.804238] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[    7.084698] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    7.084826] 
               
               Dongle Host Driver, version 1.201.82 (r)
               Compiled from 
[    7.084835] wl_android_wifi_on in
[    7.084839] wifi_platform_set_power = 1
[    7.229934] CPU1: shutdown
[    7.248141] psci: Retrying again to check for CPU kill
[    7.248146] psci: CPU1 killed.
[    7.248649] zram: Added device: zram0
[    7.249747] zram: Added device: zram1
[    7.251862] zram: Added device: zram2
[    7.252307] zram: Added device: zram3
[    7.255635] zram: Added device: zram4
[    7.256454] zram: Added device: zram5
[    7.296361] vdd-1v8: voltage operation not allowed
[    7.296373] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.298891] CPU2: shutdown
[    7.298895] psci: CPU2 killed.
[    7.306548] zram0: detected capacity change from 0 to 686120960
[    7.316296] vdd-1v8: voltage operation not allowed
[    7.316308] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.330632] Adding 670036k swap on /dev/zram0.  Priority:5 extents:1 across:670036k SS
[    7.333621] zram1: detected capacity change from 0 to 686120960
[    7.338253] vdd-1v8: voltage operation not allowed
[    7.338265] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.340683] vdd-1v8: voltage operation not allowed
[    7.340693] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.348419] Adding 670036k swap on /dev/zram1.  Priority:5 extents:1 across:670036k SS
[    7.353640] zram2: detected capacity change from 0 to 686120960
[    7.368665] Adding 670036k swap on /dev/zram2.  Priority:5 extents:1 across:670036k SS
[    7.373693] zram3: detected capacity change from 0 to 686120960
[    7.393976] Adding 670036k swap on /dev/zram3.  Priority:5 extents:1 across:670036k SS
[    7.407154] zram4: detected capacity change from 0 to 686120960
[    7.429152] Adding 670036k swap on /dev/zram4.  Priority:5 extents:1 across:670036k SS
[    7.435036] zram5: detected capacity change from 0 to 686120960
[    7.455805] Adding 670036k swap on /dev/zram5.  Priority:5 extents:1 across:670036k SS
[    7.503228] vdd-1v8: voltage operation not allowed
[    7.503238] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.506999] vdd-1v8: voltage operation not allowed
[    7.507009] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.508513] vdd-1v8: voltage operation not allowed
[    7.508521] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[    7.508542] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 71
[    7.509062] F1 signature read @0x18000000=0x17214354
[    7.519654] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[    7.521636] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[    7.654843] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[    7.716722] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[    7.716984] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[    7.717042] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[    7.717044] Enabling wake69
[    7.717795] wifi_platform_get_mac_addr
[    7.719793] Firmware up: op_mode=0x0005, MAC=00:04:4b:c7:81:8e
[    7.728076] clm path from default:/lib/firmware/brcm/bcmdhd.clm_blob
[    7.728107] Skipping the clm download. len:0 memblk:          (null)
[    7.730338] dhd_preinit_ioctls pspretend_threshold for HostAPD failed  -23
[    7.736550] Firmware version = wl0: May 17 2019 16:59:40 version 7.35.349.79 (r714996 CY) FWID 01-e527e2ad
[    7.738810] dhd_interworking_enable: failed to set WNM info, ret=-23
[    7.830443] CFGP2P-ERROR) wl_cfgp2p_add_p2p_disc_if : 
[    7.830443] P2P interface registered
[    7.838196] WLC_E_IF: NO_IF set, event Ignored
[    7.845507] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    9.126877] usb 1-2.2: USB disconnect, device number 6
[    9.392068] usb 1-2.2: new low-speed USB device number 7 using tegra-xusb
[    9.417452] usb 1-2.2: New USB device found, idVendor=1c4f, idProduct=0034
[    9.417457] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    9.417460] usb 1-2.2: Product: Usb Mouse
[    9.417463] usb 1-2.2: Manufacturer: SIGMACHIP
[    9.420913] input: SIGMACHIP Usb Mouse as /devices/3530000.xhci/usb1/1-2/1-2.2/1-2.2:1.0/0003:1C4F:0034.0005/input/input7
[    9.421201] hid-generic 0003:1C4F:0034.0005: input,hidraw2: USB HID v1.10 Mouse [SIGMACHIP Usb Mouse] on usb-3530000.xhci-2.2/input0
[    9.424435] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    9.424476] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    9.632998] igb 0000:01:00.0 eth1: igb: eth1 NIC Link is Up 10 Mbps Full Duplex, Flow Control: RX
[    9.633472] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

Thanks

Can you check if codec probe was successful? Looks like Codec DAI “tlv320aic32x4-hifi” is not registered in ALSA.

Did you enable support for TLV320AIC32X4 codec while building the kernel?

You could modify the config SND_SOC_TEGRA_T186REF_MOBILE_ALT in kernel/nvidia/sound/soc/tegra-alt/Kconfig to select SND_SOC_TLV320AIC32X4:

config SND_SOC_TEGRA_T186REF_MOBILE_ALT
 	tristate "SoC Audio support for T186Ref Mobile"
 	depends on SND_SOC_TEGRA_T186REF_ALT
 	select SND_SOC_RT5659
 	select SND_SOC_SGTL5000
++ 	select SND_SOC_TLV320AIC32X4
 	help
 	  Say Y or M here.

Thanks,
Sharad

Hi,Sharad.

Codec did not probe successfully. I added “printk()” to the “aic32x4_codec_probe()” function; but it was not executed.

tlv320aic32x4.c

static int aic32x4_codec_probe(struct snd_soc_codec *codec)
{
	struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
	u32 tmp_reg;

    printk(KERN_ERR "aic32x4:===========probe===============");
	if (gpio_is_valid(aic32x4->rstn_gpio)) {
		ndelay(10);
		gpio_set_value(aic32x4->rstn_gpio, 1);
	}

	snd_soc_write(codec, AIC32X4_RESET, 0x01);

	/* Power platform configuration */ //modify 2019.8.21
	//if (aic32x4->power_cfg & AIC32X4_PWR_MICBIAS_2075_LDOIN) {
		snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN |
						      AIC32X4_MICBIAS_2075V);
	//}
	if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE)
		snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE);

	tmp_reg = (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) ?
			AIC32X4_LDOCTLEN : 0;
	snd_soc_write(codec, AIC32X4_LDOCTL, tmp_reg);

	tmp_reg = snd_soc_read(codec, AIC32X4_CMMODE);
	if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36)
		tmp_reg |= AIC32X4_LDOIN_18_36;
	if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED)
		tmp_reg |= AIC32X4_LDOIN2HP;
	snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg);

	/* Mic PGA routing */
	if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K)
		snd_soc_write(codec, AIC32X4_LMICPGANIN,
				AIC32X4_LMICPGANIN_IN2R_10K);
	else
		snd_soc_write(codec, AIC32X4_LMICPGANIN,
				AIC32X4_LMICPGANIN_CM1L_10K);
	if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K)
		snd_soc_write(codec, AIC32X4_RMICPGANIN,
				AIC32X4_RMICPGANIN_IN1L_10K);
	else
		snd_soc_write(codec, AIC32X4_RMICPGANIN,
				AIC32X4_RMICPGANIN_CM1R_10K);

	/*
	 * Workaround: for an unknown reason, the ADC needs to be powered up
	 * and down for the first capture to work properly. It seems related to
	 * a HW BUG or some kind of behavior not documented in the datasheet.
	 */
	tmp_reg = snd_soc_read(codec, AIC32X4_ADCSETUP);
	snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg |
				AIC32X4_LADC_EN | AIC32X4_RADC_EN);
	snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg);
#if 1 //add  2019.8.21
	snd_soc_write(codec, AIC32X4_CLKMUX, 0x07);
	snd_soc_write(codec, AIC32X4_PLLPR, 0x92);
	snd_soc_write(codec, AIC32X4_PLLJ, 0x20);
	snd_soc_write(codec, AIC32X4_PLLDMSB, 0x00);
	snd_soc_write(codec, AIC32X4_PLLDLSB, 0x00);
	snd_soc_write(codec, AIC32X4_NADC, 0x84);
	snd_soc_write(codec, AIC32X4_MADC, 0x84);
	snd_soc_write(codec, AIC32X4_AOSR, 0x80);
	snd_soc_write(codec, AIC32X4_DOSRLSB, 0x80);
	snd_soc_write(codec, AIC32X4_DOSRMSB, 0x00);
	snd_soc_write(codec, AIC32X4_DACSETUP, 0xD4);
	snd_soc_write(codec, AIC32X4_LOLROUTE, 0x08);
	snd_soc_write(codec, AIC32X4_LORROUTE, 0x08);
	snd_soc_write(codec, AIC32X4_LOLGAIN, 0x1D);
	snd_soc_write(codec, AIC32X4_LORGAIN, 0x1D);
	snd_soc_write(codec, AIC32X4_LDACVOL, 0xB3);
	snd_soc_write(codec, AIC32X4_RDACVOL, 0xB3);

	snd_soc_write(codec, AIC32X4_LMICPGAPIN, 0x00);
	snd_soc_write(codec, AIC32X4_LMICPGANIN, 0x10);

	snd_soc_write(codec, AIC32X4_RMICPGAPIN, 0x10);
	snd_soc_write(codec, AIC32X4_RMICPGANIN, 0x40);

	snd_soc_write(codec, AIC32X4_LMICPGAVOL, 0x5A);
	snd_soc_write(codec, AIC32X4_RMICPGAVOL, 0x5A);

	snd_soc_write(codec, AIC32X4_ADCSETUP, 0xC0);
	snd_soc_write(codec, AIC32X4_ADCFGA, 0x00);

	snd_soc_write(codec, AIC32X4_PWRCFG, 0x08);
	snd_soc_write(codec, AIC32X4_LDOCTL, 0x01);

	snd_soc_write(codec, 0xFB, 0x01);

	snd_soc_write(codec, AIC32X4_CMMODE, 0x00);

	snd_soc_write(codec, 0x98, 0x28);

	snd_soc_write(codec, AIC32X4_OUTPWRCTL, 0x0C);
#endif

	return 0;
}
static int aic32x4_hw_params(struct snd_pcm_substream *substream,
			     struct snd_pcm_hw_params *params,
			     struct snd_soc_dai *dai)
{
	struct snd_soc_codec *codec = dai->codec;
	struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
	u8 data;
	int i;

	i = aic32x4_get_divs(aic32x4->sysclk, params_rate(params));
	if (i < 0) {
		printk(KERN_ERR "aic32x4: sampling rate not supported\n");
		return i;
	}
#if 0 //modify 2019.8.21
	/* Use PLL as CODEC_CLKIN and DAC_MOD_CLK as BDIV_CLKIN */
	snd_soc_write(codec, AIC32X4_CLKMUX, AIC32X4_PLLCLKIN);
	snd_soc_write(codec, AIC32X4_IFACE3, AIC32X4_DACMOD2BCLK);

	/* We will fix R value to 1 and will make P & J=K.D as varialble */
	data = snd_soc_read(codec, AIC32X4_PLLPR);
	data &= ~(7 << 4);
	snd_soc_write(codec, AIC32X4_PLLPR,
		      (data | (aic32x4_divs[i].p_val << 4) | 0x01));

	snd_soc_write(codec, AIC32X4_PLLJ, aic32x4_divs[i].pll_j);

	snd_soc_write(codec, AIC32X4_PLLDMSB, (aic32x4_divs[i].pll_d >> 8));
	snd_soc_write(codec, AIC32X4_PLLDLSB,
		      (aic32x4_divs[i].pll_d & 0xff));

	/* NDAC divider value */
	data = snd_soc_read(codec, AIC32X4_NDAC);
	data &= ~(0x7f);
	snd_soc_write(codec, AIC32X4_NDAC, data | aic32x4_divs[i].ndac);

	/* MDAC divider value */
	data = snd_soc_read(codec, AIC32X4_MDAC);
	data &= ~(0x7f);
	snd_soc_write(codec, AIC32X4_MDAC, data | aic32x4_divs[i].mdac);

	/* DOSR MSB & LSB values */
	snd_soc_write(codec, AIC32X4_DOSRMSB, aic32x4_divs[i].dosr >> 8);
	snd_soc_write(codec, AIC32X4_DOSRLSB,
		      (aic32x4_divs[i].dosr & 0xff));

	/* NADC divider value */
	data = snd_soc_read(codec, AIC32X4_NADC);
	data &= ~(0x7f);
	snd_soc_write(codec, AIC32X4_NADC, data | aic32x4_divs[i].nadc);

	/* MADC divider value */
	data = snd_soc_read(codec, AIC32X4_MADC);
	data &= ~(0x7f);
	snd_soc_write(codec, AIC32X4_MADC, data | aic32x4_divs[i].madc);

	/* AOSR value */
	snd_soc_write(codec, AIC32X4_AOSR, aic32x4_divs[i].aosr);

	/* BCLK N divider */
	data = snd_soc_read(codec, AIC32X4_BCLKN);
	data &= ~(0x7f);
	snd_soc_write(codec, AIC32X4_BCLKN, data | aic32x4_divs[i].blck_N);

	data = snd_soc_read(codec, AIC32X4_IFACE1);
	data = data & ~(3 << 4);
	switch (params_width(params)) {
	case 16:
		break;
	case 20:
		data |= (AIC32X4_WORD_LEN_20BITS << AIC32X4_DOSRMSB_SHIFT);
		break;
	case 24:
		data |= (AIC32X4_WORD_LEN_24BITS << AIC32X4_DOSRMSB_SHIFT);
		break;
	case 32:
		data |= (AIC32X4_WORD_LEN_32BITS << AIC32X4_DOSRMSB_SHIFT);
		break;
	}
	snd_soc_write(codec, AIC32X4_IFACE1, data);
#endif
	if (params_channels(params) == 1) {
		data = AIC32X4_RDAC2LCHN | AIC32X4_LDAC2LCHN;
	} else {
		if (aic32x4->swapdacs)
			data = AIC32X4_RDAC2LCHN | AIC32X4_LDAC2RCHN;
		else
			data = AIC32X4_LDAC2LCHN | AIC32X4_RDAC2RCHN;
	}
	snd_soc_update_bits(codec, AIC32X4_DACSETUP, AIC32X4_DAC_CHAN_MASK,
			data);

	return 0;
}

I added “CONFIG_SND_SOC_TLV320AIC32X4=y” and “CONFIG_SND_SOC_TLV320AIC32X4_I2C=y” to the tegra_defconfig file.

tegra_defconfig

CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
CONFIG_IRQ_POLL=y
CONFIG_ARCH_TEGRA_18x_SOC=y
CONFIG_ARCH_TEGRA_19x_SOC=y
CONFIG_ARCH_TEGRA_23x_SOC=y
CONFIG_SND_SOC_TLV320AIC32X4=y
CONFIG_SND_SOC_TLV320AIC32X4_I2C=y

Kconfig

config SND_SOC_TEGRA_T186REF_MOBILE_ALT
	tristate "SoC Audio support for T186Ref Mobile"
	depends on SND_SOC_TEGRA_T186REF_ALT
	select SND_SOC_RT5659
	select SND_SOC_SGTL5000
        select SND_SOC_TLV320AIC32X4
	select SND_SOC_TLV320AIC32X4_I2C
	help
	  Say Y or M here.

tegra_asoc_utils_alt.c

int tegra_alt_asoc_utils_set_parent(struct tegra_asoc_audio_clock_info *data,
			int is_i2s_master)
{
	int ret = -ENODEV;

	if (is_i2s_master) {
		ret = clk_set_parent(data->clk_cdev1, data->clk_pll_a_out0);
		if (ret) {
			dev_err(data->dev, "Can't set clk cdev1/extern1 parent");
			return ret;
		}
	} else {
		ret = clk_set_parent(data->clk_cdev1, data->clk_m);
		if (ret) {
			dev_err(data->dev, "Can't set clk cdev1/extern1 parent");
			return ret;
		}

		//ret = clk_set_rate(data->clk_cdev1, 13000000); //modify 2019.8.21
		ret = clk_set_rate(data->clk_cdev1, 12000000); 
		if (ret) {
			dev_err(data->dev, "Can't set clk rate");
			return ret;
		}
	}

	return 0;
}

tegra_machine_driver_mobile.c

static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
					int rate,
					int channels,
					u64 formats,
					bool is_playback)
{
	struct snd_soc_card *card = runtime->card;
	struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
	struct snd_soc_pcm_stream *dai_params;
	unsigned int clk_out_rate = 0, mclk = 0;
	int err, codec_rate, clk_rate;
	struct snd_soc_pcm_runtime *rtd;

	codec_rate = tegra_machine_srate_values[machine->rate_via_kcontrol];
	clk_rate = (machine->rate_via_kcontrol) ? codec_rate : rate;

	if (!machine->soc_data->is_clk_rate_via_dt) {
		/* TODO remove this hardcoding */
		/* aud_mclk, 256 times the sample rate */
		clk_out_rate = clk_rate << 8;
		switch (clk_rate) {
		case 11025:
			mclk = 22579200;
			break;
		case 22050:
		case 44100:
		case 88200:
		case 176400:
			mclk = 45158400;
			break;
		case 8000:
			mclk = 24576000;
			break;
		case 16000:
		case 32000:
		case 48000:
		case 64000:
		case 96000:
		case 192000:
		default:
			mclk = 49152000;
			break;
		}

		err = tegra210_xbar_set_clock(mclk);
		if (err < 0) {
			dev_err(card->dev,
				"Can't configure xbar clock = %d Hz\n", mclk);
			return err;
		}
	}

	err = tegra_alt_asoc_utils_set_rate(&machine->audio_clock, clk_rate,
			mclk, clk_out_rate);
	if (err < 0) {
		dev_err(card->dev, "Can't configure clocks\n");
		return err;
	}

	if (machine->soc_data->is_clk_rate_via_dt)
		clk_out_rate = machine->audio_clock.set_clk_out_rate;

	pr_debug("pll_a_out0 = %d Hz, aud_mclk = %d Hz, codec rate = %d Hz\n",
		machine->audio_clock.set_mclk,
		machine->audio_clock.set_clk_out_rate, clk_rate);

	/* TODO: should we pass here clk_rate ? */
	err = tegra_machine_set_params(card, machine, rate, channels, formats);
	if (err < 0)
		return err;

    //add 2019.8.21
	rtd = snd_soc_get_pcm_runtime(card, "ti-playback-i2s1");
	printk(KERN_ERR "tegra_machine_dai_init:====ti-playback-i2s1-rtd =====\n");
	if (rtd) {
		dai_params =
		(struct snd_soc_pcm_stream *)rtd->dai_link->params;

		dai_params->rate_min = clk_rate;
		dai_params->formats = (machine->fmt_via_kcontrol == 2) ?
			(1ULL << SNDRV_PCM_FORMAT_S32_LE) : formats;

		if (machine->is_hs_supported) {
			err = snd_soc_dai_set_sysclk(rtd->codec_dai,
			0, 12000000, SND_SOC_CLOCK_IN);
			if (err < 0) {
				dev_err(card->dev, "codec_dai clock not set\n");
				return err;
			}
		}
	}

	rtd = snd_soc_get_pcm_runtime(card, "ti-playback-i2s2");
	printk(KERN_ERR "tegra_machine_dai_init:====ti-playback-i2s2-rtd =====\n");
	if (rtd) {
		dai_params =
		(struct snd_soc_pcm_stream *)rtd->dai_link->params;

		dai_params->rate_min = clk_rate;
		dai_params->formats = (machine->fmt_via_kcontrol == 2) ?
			(1ULL << SNDRV_PCM_FORMAT_S32_LE) : formats;

		if (machine->is_hs_supported) {
			err = snd_soc_dai_set_sysclk(rtd->codec_dai,
			0, 12000000, SND_SOC_CLOCK_IN);
			if (err < 0) {
				dev_err(card->dev, "codec_dai clock not set\n");
				return err;
			}
		}
	}
	return 0;
}
static void dai_link_setup(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
	struct snd_soc_codec_conf *tegra_machine_codec_conf = NULL;
	struct snd_soc_codec_conf *tegra_new_codec_conf = NULL;
	struct snd_soc_dai_link *tegra_machine_dai_links = NULL;
	struct snd_soc_dai_link *tegra_machine_codec_links = NULL;
	const char *codec_dai_name;
	int i;

	/* set new codec links and conf */
	tegra_machine_codec_links = tegra_machine_new_codec_links(pdev,
		tegra_machine_codec_links,
		&machine->num_codec_links);
	if (!tegra_machine_codec_links)
		goto err_alloc_dai_link;

	/* set codec init */
        //modify 2019.8.21
	for (i = 0; i < machine->num_codec_links; i++) {
		if (tegra_machine_codec_links[i].name) {
			if (strstr(tegra_machine_codec_links[i].name,
				"ti-playback-i2s1") ||
			    strstr(tegra_machine_codec_links[i].name,
				"ti-playback-i2s2")) {
				codec_dai_name =
				 tegra_machine_codec_links[i].codec_dai_name;
				if (!strcmp("dit-hifi", codec_dai_name)) {
					dev_info(&pdev->dev, "This is a dummy codec\n");
					machine->is_hs_supported = false;
				} else {
					machine->is_hs_supported = true;
					tegra_machine_codec_links[i].init =
						tegra_machine_rt565x_init;
				}
			} else if (strstr(tegra_machine_codec_links[i].name,
				"dspk-playback-r")) {
				tegra_machine_codec_links[i].init =
					tegra_machine_dspk_init;
			} else if (strstr(tegra_machine_codec_links[i].name,
				"dspk-playback-l")) {
				tegra_machine_codec_links[i].init =
					tegra_machine_dspk_init;
			} else if (strstr(tegra_machine_codec_links[i].name,
				"fe-pi-audio-z-v2")) {
				tegra_machine_codec_links[i].init =
					tegra_machine_fepi_init;
			}
		}
	}
    
	tegra_new_codec_conf = tegra_machine_new_codec_conf(pdev,
		tegra_new_codec_conf,
		&machine->num_codec_links);
	if (!tegra_new_codec_conf)
		goto err_alloc_dai_link;

	/* get the xbar dai link/codec conf structure */
	tegra_machine_dai_links = machine->soc_data->get_dai_link();
	if (!tegra_machine_dai_links)
		goto err_alloc_dai_link;

	tegra_machine_codec_conf = machine->soc_data->get_codec_conf();
	if (!tegra_machine_codec_conf)
		goto err_alloc_dai_link;

	/* set ADMAIF dai_ops */
	for (i = machine->soc_data->admaif_dai_link_start;
		i <= machine->soc_data->admaif_dai_link_end; i++)
		tegra_machine_set_dai_ops(i, &tegra_machine_pcm_ops);

	/* set sfc dai_init */
	tegra_machine_set_dai_init(machine->soc_data->sfc_dai_link,
		&tegra_machine_sfc_init);
#if IS_ENABLED(CONFIG_SND_SOC_TEGRA210_ADSP_ALT)
	/* set ADSP PCM/COMPR */
	for (i = machine->soc_data->adsp_pcm_dai_link_start;
		i <= machine->soc_data->adsp_pcm_dai_link_end; i++) {
		tegra_machine_set_dai_ops(i, &tegra_machine_pcm_ops);
	}

	/* set ADSP COMPR */
	for (i = machine->soc_data->adsp_compr_dai_link_start;
		i <= machine->soc_data->adsp_compr_dai_link_end; i++) {
		tegra_machine_set_dai_compr_ops(i,
			&tegra_machine_compr_ops);
	}
#endif

	if (machine->soc_data->is_asrc_available) {
	/* set ASRC params. The default is 2 channels */
		for (i = 0; i < 6; i++) {
			tegra_machine_set_dai_params(TEGRA186_DAI_LINK_ASRC1_TX1
				+ i, (struct snd_soc_pcm_stream *)
				&tegra_machine_asrc_link_params[i]);
			tegra_machine_set_dai_params(TEGRA186_DAI_LINK_ASRC1_RX1
				 + i, (struct snd_soc_pcm_stream *)
				&tegra_machine_asrc_link_params[i]);
		}
	}

	/* append machine specific dai_links */
	card->num_links = machine->soc_data->append_dai_link(
		tegra_machine_codec_links, 2 * machine->num_codec_links);
	tegra_machine_dai_links = machine->soc_data->get_dai_link();
	card->dai_link = tegra_machine_dai_links;

	/* append machine specific codec_conf */
	card->num_configs = machine->soc_data->append_codec_conf(
		tegra_new_codec_conf, machine->num_codec_links);
	tegra_machine_codec_conf = machine->soc_data->get_codec_conf();
	card->codec_conf = tegra_machine_codec_conf;

	return;

err_alloc_dai_link:
	tegra_machine_remove_dai_link();
	tegra_machine_remove_codec_conf();
}

tegra186-quill-common.dtsi

i2c@3180000 {
		status = "okay";
		aic32x4_1: tlv320aic32x4.2-0018@18{
		compatible = "ti,tlv320aic32x4";
		status = "okay";
		reg = <0x18>;
		clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "mclk";
		};
	};
	i2c@3160000 {
		status = "okay";
		aic32x4: tlv320aic32x4.0-0018@18{
		compatible = "ti,tlv320aic32x4";
		status = "okay";
		reg = <0x18>;
		clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "mclk";
		};
         };
        tegra_sound: sound {
		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
		//nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
		nvidia,model = "tegra-asoc:";
		nvidia,num-codec-link = <12>;
		nvidia,num-clk = <8>;
		nvidia,clk-rates = < 270950400	/* PLLA_x11025_RATE */
				     11289600	/* AUD_MCLK_x11025_RATE */
				     45158400	/* PLLA_OUT0_x11025_RATE */
				     45158400	/* AHUB_x11025_RATE */
				     245760000  /* PLLA_x8000_RATE */
				     12288000	/* AUD_MCLK_x8000_RATE */
				     49152000	/* PLLA_OUT0_x8000_RATE */
				     49152000 >;/* AHUB_x8000_RATE */
		clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
			<&tegra_car TEGRA186_CLK_PLLA>,
			<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
			<&tegra_car TEGRA186_CLK_AHUB>,
			<&tegra_car TEGRA186_CLK_CLK_M>,
			<&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
				"clk_m", "extern1";
		resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
		reset-names = "extern1_rst";

		status = "okay";
		nvidia,audio-routing =
			"x IN2_R",          "x Mic",
			"x IN2_L",          "x Mic",
			"x Headphone",      "x LOR",
			"x Headphone",      "x LOL",
			"y IN2_R",          "y Mic",
			"y IN2_L",          "y Mic",
			"y Headphone",      "y LOR",
			"y Headphone",      "y LOL";
			/*
			"x Headphone",		"x OUT",
			"x IN",			"x Mic",
			"y Headphone",		"y OUT",
			"y IN",			"y Mic",
			"z Headphone",		"z OUT",
			"z IN",			"z Mic",
			"m Headphone",		"m OUT",
			"m IN",			"m Mic",
			"n Headphone",		"n OUT",
			"n IN",			"n Mic",
			"o Headphone",		"o OUT",
			"o IN",			"o Mic",
			"a IN",			"a Mic",
			"b IN",			"b Mic",
			"c IN",			"c Mic",
			"d IN",			"d Mic",
			"d1 Headphone",		"d1 OUT",
			"d2 Headphone",		"d2 OUT";
			*/

		nvidia,xbar = <&tegra_axbar>;

		rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "ti-playback-i2s2";
			cpu-dai = <&tegra_i2s2>;
			codec-dai = <&aic32x4_1>;
			cpu-dai-name = "I2S2";
			codec-dai-name = "tlv320aic32x4-hifi";
			tx-mask = <0xFF>;
			rx-mask = <0xFF>;
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <1>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
		nvidia,dai-link-2 {
			link-name = "ti-playback-i2s1";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&aic32x4>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "tlv320aic32x4-hifi";
			tx-mask = <0xFF>;
			rx-mask = <0xFF>;
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <1>;
			ignore_suspend;
			name-prefix = "y";
			status = "okay";
		};
		nvidia,dai-link-3 {
			link-name = "spdif-dit-2";
			cpu-dai = <&tegra_i2s3>;
			codec-dai = <&spdif_dit2>;
			cpu-dai-name = "I2S3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "z";
			status = "disabled";
		};
		nvidia,dai-link-4 {
			link-name = "spdif-dit-3";
			cpu-dai = <&tegra_i2s4>;
			codec-dai = <&spdif_dit3>;
			cpu-dai-name = "I2S4";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "m";
			status = "disabled";
		};
		nvidia,dai-link-5 {
			link-name = "spdif-dit-4";
			cpu-dai = <&tegra_i2s5>;
			codec-dai = <&spdif_dit4>;
			cpu-dai-name = "I2S5";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "n";
			status = "disabled";
		};
		nvidia,dai-link-6 {
			link-name = "spdif-dit-6";
			cpu-dai = <&tegra_i2s6>;
			codec-dai = <&spdif_dit6>;
			cpu-dai-name = "I2S6";
			codec-dai-name = "dit-hifi";
			tx-mask = <0xFF>;
			rx-mask = <0xFF>;
			format = "dsp_a";
			bitclock-inversion;
			bit-format = "s16_le";
			bclk_ratio = <4>;
			srate = <8000>;
			num-channel = <1>;
			ignore_suspend;
			name-prefix = "o";
			status = "disabled";
		};
		nvidia,dai-link-7 {
			link-name = "spdif-dit-7";
			cpu-dai = <&tegra_dmic1>;
			codec-dai = <&spdif_dit7>;
			cpu-dai-name = "DMIC1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "a";
			status = "disabled";
		};
		nvidia,dai-link-8 {
			link-name = "spdif-dit-8";
			cpu-dai = <&tegra_dmic2>;
			codec-dai = <&spdif_dit8>;
			cpu-dai-name = "DMIC2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "b";
			status = "disabled";
		};
		nvidia,dai-link-9 {
			link-name = "spdif-dit-9";
			cpu-dai = <&tegra_dmic3>;
			codec-dai = <&spdif_dit9>;
			cpu-dai-name = "DMIC3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "c";
			status = "disabled";
		};
		nvidia,dai-link-10 {
			link-name = "spdif-dit-10";
			cpu-dai = <&tegra_dmic4>;
			codec-dai = <&spdif_dit10>;
			cpu-dai-name = "DMIC4";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "d";
			status = "disabled";
		};
		dspk_1_dai_link: nvidia,dai-link-11 {
			link-name = "dspk-playback-r";
			cpu-dai = <&tegra_dspk1>;
			codec-dai = <&spdif_dit11>;
			cpu-dai-name = "DSPK1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "d1";
			status = "disabled";
		};
		dspk_2_dai_link: nvidia,dai-link-12 {
			link-name = "dspk-playback-l";
			cpu-dai = <&tegra_dspk2>;
			codec-dai = <&spdif_dit12>;
			cpu-dai-name = "DSPK2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "d2";
			status = "disabled";
                };
	};

I modified the above code, is it still necessary to modify other files?

Thanks

Interesting. The code changes look fine. I assume same HW (+ SW changes) worked with 28.2.1 (Add two sound card drivers on TX2 - Jetson TX2 - NVIDIA Developer Forums).

I will have to check if something changed for I2C Buses -i2c@3180000/i2c@3160000 between BSPs. In the meantime, Can you try enabling one codec at a time and see if aic32x4_i2c_probe is getting compiled and called at all for any codec.

Hi,Sharad.

I tried to enable one codec at a time, but still prompted “tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered & tegra-asoc: sound: snd_soc_register_card failed (-517)” in the startup log.

Thanks

Can you execute below commands and share outputs:

$ sudo grep “gen1_i2c|cam_i2c” /sys/kernel/debug/tegra_pinctrl_reg

$ zcat /proc/config.gz | grep AIC32

Thanks,
Sharad

Hi,Sharad.

I executed these two commands, but there is no information returned on the terminal.
I modified tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg and the system will not start after flashing.

Thanks

My Bad!

There was a typo in my previous comment: Can you try below commands instead.

$ sudo zcat /proc/config.gz | grep AIC32

$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep i2c

[Also, I assume you do have a backup of tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg that was included in the BSP.]

Hi,Sharad

  1. I executed the below command and returned the result.
nvidia@tegra:~$ sudo zcat /proc/config.gz | grep AIC32
[sudo] password for nvidia: 
nvidia@tegra:~$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep i2c
Bank: 1 Reg: 0x0c302028 Val: 0x00001440 -> gen8_i2c_sda_pw1
Bank: 1 Reg: 0x0c302030 Val: 0x00001440 -> gen8_i2c_scl_pw0
Bank: 0 Reg: 0x02430010 Val: 0x00001440 -> cam_i2c_sda_po3
Bank: 0 Reg: 0x02430018 Val: 0x00001440 -> cam_i2c_scl_po2
Bank: 0 Reg: 0x02434060 Val: 0x00001460 -> gen1_i2c_scl_pc5
Bank: 0 Reg: 0x02434068 Val: 0x00001460 -> gen1_i2c_sda_pc6
Bank: 1 Reg: 0x0c301060 Val: 0x00001440 -> pwr_i2c_scl_ps0
Bank: 1 Reg: 0x0c301068 Val: 0x00001440 -> pwr_i2c_sda_ps1
Bank: 0 Reg: 0x0243d0b0 Val: 0x00001440 -> gen7_i2c_scl_pl0
Bank: 0 Reg: 0x0243d0b8 Val: 0x00001440 -> gen7_i2c_sda_pl1
Bank: 0 Reg: 0x0243d0c0 Val: 0x00001440 -> gen9_i2c_sda_pl3
Bank: 0 Reg: 0x0243d0c8 Val: 0x00001440 -> gen9_i2c_scl_pl2
  1. I backed up tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg.
    I think my operation is not correct, directly modified tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg, and then executed the flashing command $sudo ./flash.sh -r -K kernel/Image jetson -tx2 mmcblk0p1.
    How to use CFG format file?

Hi,Sharad

I tried to add the audio codec driver several times and still prompted “tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered” & “tegra-asoc: sound: snd_soc_register_card failed (-517)” & “vdd-1v8: voltage operation not allowed” & “sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)”

dmesg.log

[    4.676546] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.676622] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.677216] u32 classifier
[    4.677218]     Actions configured
[    4.677310] Initializing XFRM netlink socket
[    4.679011] NET: Registered protocol family 10
[    4.680358] NET: Registered protocol family 17
[    4.680368] NET: Registered protocol family 15
[    4.680573] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    4.680642] Bluetooth: RFCOMM socket layer initialized
[    4.680676] Bluetooth: RFCOMM ver 1.11
[    4.680680] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    4.680686] Bluetooth: HIDP socket layer initialized
[    4.680705] 9pnet: Installing 9P2000 support
[    4.680745] Key type dns_resolver registered
[    4.681001] Registered cp15_barrier emulation handler
[    4.681015] Registered setend emulation handler
[    4.682850] registered taskstats version 1
[    4.687416] isp 15600000.isp: initialized
[    4.692539] nvcsi 150c0000.nvcsi: initialized
[    4.700235] tegra-vi4 15700000.vi: initialized
[    4.701426] tegra-vi4 15700000.vi: ep of_device is not enabled /host1x/vi@15700000/ports/port@0/endpoint.
[    4.701430] tegra-vi4 15700000.vi: ep of_device is not enabled /host1x/vi@15700000/ports/port@1/endpoint.
[    4.701471] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.701539] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.702098] gpio tegra-gpio-aon wake29 for gpio=56(FF:0)
[    4.702194] gpio tegra-gpio-aon wake67 for gpio=57(FF:1)
[    4.702262] gpio tegra-gpio-aon wake68 for gpio=58(FF:2)
[    4.702522] input: gpio-keys as /devices/gpio-keys/input/input2
[    4.705817] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.705887] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.709668] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    4.709709] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    4.737408] tegra_rtc c2a0000.rtc: setting system clock to 2019-08-24 10:31:16 UTC (1566642676)
[    4.738867] mmcblk mmc0:0001: Card claimed for testing.
[    4.776990] bpmp: mounted debugfs mirror
[    4.778980] bwmgr: missing cdev-type property
[    4.784650] spmic-ldo0: disabling
[    4.784915] spmic-ldo1: disabling
[    4.785079] en-vdd-sd: disabling
[    4.785081] vdd-usb0-5v: disabling
[    4.785083] vdd-usb1-5v: disabling
[    4.785085] en-vdd-disp-3v3: disabling
[    4.785087] en-mdm-pwr-3v7: disabling
[    4.785112] en-vdd-disp-1v8: disabling
[    4.785114] en-vdd-cam-hv-2v8: disabling
[    4.785116] vdd-fan: disabling
[    4.785117] vdd-3v3: disabling
[    4.785119] en-vdd-vcm-2v8: disabling
[    4.785121] vdd-usb2-5v: disabling
[    4.785123] vdd-sys-bl: disabling
[    4.785126] ALSA device list:
[    4.785128]   #0: tegra-hda at 0x3518000 irq 383
[    6.764699] random: crng init done
[    7.684696] extcon-disp-state external-connection:disp-state: cable 40 state 1
[    7.693095] Extcon HDMI: HPD enabled
[    7.697865] tegradc 15210000.nvdisplay: hdmi: plugged
[    7.739473] EXT4-fs (mmcblk0p1): 9 orphan inodes deleted
[    7.746129] EXT4-fs (mmcblk0p1): recovery complete
[    7.756101] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    7.765474] VFS: Mounted root (ext4 filesystem) on device 179:1.
[    7.773881] devtmpfs: mounted
[    7.780356] Freeing unused kernel memory: 8512K
[    7.945669] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.996490] cgroup: cgroup2: unknown option "nsdelegate"
[    8.021969] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    8.049235] systemd[1]: Detected architecture arm64.
[    8.147709] systemd[1]: Set hostname to <tegra>.
[    8.238318] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    8.256951] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    8.445356] systemd[1]: Reached target User and Group Name Lookups.
[    8.455898] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    8.466870] systemd[1]: Reached target Swap.
[    8.477754] systemd[1]: Created slice System Slice.
[    8.486728] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    8.572391] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
[    8.598630] gpio tegra-gpio-aon wake30 for gpio=60(FF:4)
[    8.608931] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    8.618272] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    8.725535] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    8.735291] tegra-asoc: sound: snd_soc_register_card failed (-517)
[    8.922317] systemd-journald[2270]: Received request to flush runtime journal from PID 1
[    9.628406] using random self ethernet address
[    9.634241] using random host ethernet address
[    9.663280] Mass Storage Function, version: 2009/09/11
[    9.663286] LUN: removable file: (no medium)
[    9.675190] using random self ethernet address
[    9.681203] using random host ethernet address
[    9.728394] rndis0: HOST MAC 02:7d:46:a3:bc:78
[    9.728925] rndis0: MAC 02:7d:46:a3:bc:79
[    9.732733] usb0: HOST MAC 02:7d:46:a3:bc:7a
[    9.732760] usb0: MAC 02:7d:46:a3:bc:7b
[    9.732780] tegra-xudc-new 3550000.xudc: exiting ELPG
[    9.734834] tegra-xudc-new 3550000.xudc: exiting ELPG done
[    9.734849] tegra-xudc-new 3550000.xudc: ep 0 (type: 0, dir: out) enabled
[    9.734876] tegra-xudc-new 3550000.xudc: entering ELPG
[    9.736062] tegra-xudc-new 3550000.xudc: entering ELPG done
[    9.736084] tegra-xudc-new 3550000.xudc: exiting ELPG
[    9.739690] tegra-xudc-new 3550000.xudc: exiting ELPG done
[    9.739715] tegra-xudc-new 3550000.xudc: entering ELPG
[    9.740840] tegra-xudc-new 3550000.xudc: entering ELPG done
[    9.755547] tegra-xusb 3530000.xhci: cannot find firmware....retry after 1 second
[    9.771325] l4tbr0: port 1(rndis0) entered blocking state
[    9.771330] l4tbr0: port 1(rndis0) entered disabled state
[    9.771535] device rndis0 entered promiscuous mode
[    9.788374] IPv6: ADDRCONF(NETDEV_UP): rndis0: link is not ready
[    9.794207] l4tbr0: port 2(usb0) entered blocking state
[    9.794211] l4tbr0: port 2(usb0) entered disabled state
[    9.798014] device usb0 entered promiscuous mode
[    9.802960] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[    9.802967] l4tbr0: port 2(usb0) entered blocking state
[    9.802970] l4tbr0: port 2(usb0) entered forwarding state
[   10.076415] dhd_module_init in
[   10.076495] found wifi platform device bcmdhd_wlan
[   10.081080] wifi_platform_get_country_code_map: could not get country_code_map
[   10.081084] wifi_plat_dev_drv_probe:platform country code map is not available
[   10.081109] Power-up adapter 'DHD generic adapter'
[   10.081116] wifi_platform_set_power = 1
[   10.124940] tegra-i2c c240000.i2c: no acknowledge from address 0x69
[   10.151653] bmi160 1-0069: bmi_i2c_rd ERR: 0x00
[   10.159415] bmi160 1-0069: bmi_init _id_i2c ERR
[   10.159474] bmi160 1-0069: bmi_remove
[   10.159476] bmi160 1-0069: bmi_probe done
[   10.164778] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.164852] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.288740] wifi_platform_bus_enumerate device present 1
[   10.295154] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.306929] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.321245] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.330204] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.343590] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.352782] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.380723] wifi_platform_bus_enumerate device present 0
[   10.397680] F1 signature read @0x18000000=0x17214354
[   10.410074] nvgpu: 17000000.gp10b             railgate_enable_store:343  [INFO]  railgate is disabled.
[   10.420636] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[   10.421640] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[   10.421717] wifi_platform_get_mac_addr
[   10.422440] ids dhd_log_netlink_init
[   10.424997] wl_create_event_handler(): thread:wl_event_handler:1374 started
[   10.425000]  wl_event_handler : 
[   10.425002] tsk Enter, tsk = 0xffffffc1cf5c1a90
[   10.425557] dhd_attach(): thread:dhd_watchdog_thread:1376 started
[   10.425643] dhd_attach(): thread:dhd_dpc:1377 started
[   10.425704] dhd_attach(): thread:dhd_rxf:1378 started
[   10.425711] dhd_deferred_work_init: work queue initialized 
[   10.426003] 
               Dongle Host Driver, version 1.201.82 (r)
               Compiled from 
[   10.426636] Register interface [wlan0]  MAC: 00:04:4b:c7:81:8e

[   10.426641] dhd_prot_ioctl : bus is down. we have nothing to do
[   10.426776] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 71
[   10.427819] wifi_platform_set_power = 0
[   10.643984] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.653273] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.664565] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.673809] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.718054] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   10.776712] tegra-xusb 3530000.xhci: Firmware timestamp: 2018-12-26 10:30:04 UTC, Version: 55.12 release
[   10.804792] tegra-xusb 3530000.xhci: xHCI Host Controller
[   10.804816] tegra-xusb 3530000.xhci: new USB bus registered, assigned bus number 1
[   10.805685] tegra-xusb 3530000.xhci: hcc params 0x0184fd25 hci version 0x100 quirks 0x00050810
[   10.805724] tegra-xusb 3530000.xhci: irq 70, io mem 0x03530000
[   10.805863] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   10.805868] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   10.805872] usb usb1: Product: xHCI Host Controller
[   10.805875] usb usb1: Manufacturer: Linux 4.9.140-tegra xhci-hcd
[   10.805877] usb usb1: SerialNumber: 3530000.xhci
[   10.806269] hub 1-0:1.0: USB hub found
[   10.806297] hub 1-0:1.0: 4 ports detected
[   10.806985] tegra-xusb 3530000.xhci: xHCI Host Controller
[   10.806995] tegra-xusb 3530000.xhci: new USB bus registered, assigned bus number 2
[   10.809483] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[   10.809489] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   10.809492] usb usb2: Product: xHCI Host Controller
[   10.809495] usb usb2: Manufacturer: Linux 4.9.140-tegra xhci-hcd
[   10.809498] usb usb2: SerialNumber: 3530000.xhci
[   10.810380] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.819976] hub 2-0:1.0: USB hub found
[   10.820007] hub 2-0:1.0: 3 ports detected
[   10.820759] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.826294] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   10.828485] l4tbr0: port 2(usb0) entered disabled state
[   10.829790] Wake76 for irq=199
[   10.829792] Wake77 for irq=199
[   10.829794] Wake78 for irq=199
[   10.829795] Wake79 for irq=199
[   10.829796] Wake80 for irq=199
[   10.829798] Wake81 for irq=199
[   10.829799] Wake82 for irq=199
[   10.837490] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   10.846474] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   10.846525] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   10.917578] gpio tegra-gpio wake18 for gpio=101(M:5)
[   10.919647] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   10.920912] usb usb2: usb_suspend_both: status 0
[   11.132719] usb 1-2: new high-speed USB device number 2 using tegra-xusb
[   11.154222] usb 1-2: New USB device found, idVendor=05e3, idProduct=0608
[   11.154227] usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[   11.154230] usb 1-2: Product: USB2.0 Hub
[   11.155320] hub 1-2:1.0: USB hub found
[   11.155604] hub 1-2:1.0: 4 ports detected
[   11.161454] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   11.161493] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   11.240056] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   11.240171] Dongle Host Driver, version 1.201.82 (r) Compiled from 
[   11.240179] wl_android_wifi_on in
[   11.240183] wifi_platform_set_power = 1
[   11.444822] usb 1-2.1: new low-speed USB device number 3 using tegra-xusb
[   11.449813] vdd-1v8: voltage operation not allowed
[   11.449833] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.467452] usb 1-2.1: device descriptor read/8, error -32
[   11.469330] vdd-1v8: voltage operation not allowed
[   11.469361] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.490364] vdd-1v8: voltage operation not allowed
[   11.490400] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.493088] vdd-1v8: voltage operation not allowed
[   11.493116] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.595507] usb 1-2.1: device descriptor read/8, error -32
[   11.620645] vdd-1v8: voltage operation not allowed
[   11.620797] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.621984] vdd-1v8: voltage operation not allowed
[   11.622011] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.623899] vdd-1v8: voltage operation not allowed
[   11.623920] sdhci-tegra 3440000.sdhci: could not set regulator OCR (-1)
[   11.624051] sdhci-tegra 3440000.sdhci: Tuning done, restoring the best tap value : 71
[   11.626951] F1 signature read @0x18000000=0x17214354
[   11.649582] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[   11.653051] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[   11.784806] usb 1-2.1: new low-speed USB device number 4 using tegra-xusb
[   11.811854] usb 1-2.1: New USB device found, idVendor=1c4f, idProduct=0002
[   11.811870] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   11.811882] usb 1-2.1: Product: USB Keyboard
[   11.811891] usb 1-2.1: Manufacturer: SIGMACHIP
[   11.817701] input: SIGMACHIP USB Keyboard as /devices/3530000.xhci/usb1/1-2/1-2.1/1-2.1:1.0/0003:1C4F:0002.0001/input/input3
[   11.878719] hid-generic 0003:1C4F:0002.0001: input,hidraw0: USB HID v1.10 Keyboard [SIGMACHIP USB Keyboard] on usb-3530000.xhci-2.1/input0
[   11.883157] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   11.883241] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   11.884729] input: SIGMACHIP USB Keyboard as /devices/3530000.xhci/usb1/1-2/1-2.1/1-2.1:1.1/0003:1C4F:0002.0002/input/input4
[   11.889289] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[   11.945033] hid-generic 0003:1C4F:0002.0002: input,hidraw1: USB HID v1.10 Device [SIGMACHIP USB Keyboard] on usb-3530000.xhci-2.1/input1
[   11.949876] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   11.949913] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   11.952288] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[   11.952726] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[   11.952814] gpio tegra-gpio-aon wake69 for gpio=59(FF:3)
[   11.952817] Enabling wake69
[   11.953930] wifi_platform_get_mac_addr
[   11.956525] Firmware up: op_mode=0x0005, MAC=00:04:4b:c7:81:8e
[   11.963303] clm path from default:/lib/firmware/brcm/bcmdhd.clm_blob
[   11.963402] Skipping the clm download. len:0 memblk:          (null)
[   11.967392] dhd_preinit_ioctls pspretend_threshold for HostAPD failed  -23
[   11.975620] Firmware version = wl0: Oct 31 2018 11:34:03 version 7.35.349.66 (r708495 CY) FWID 01-ade683bb
[   11.979832] dhd_interworking_enable: failed to set WNM info, ret=-23
[   12.028737] usb 1-2.2: new low-speed USB device number 5 using tegra-xusb
[   12.054346] usb 1-2.2: New USB device found, idVendor=1c4f, idProduct=0034
[   12.054354] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   12.054359] usb 1-2.2: Product: Usb Mouse
[   12.054363] usb 1-2.2: Manufacturer: SIGMACHIP
[   12.058585] input: SIGMACHIP Usb Mouse as /devices/3530000.xhci/usb1/1-2/1-2.2/1-2.2:1.0/0003:1C4F:0034.0003/input/input5
[   12.060008] hid-generic 0003:1C4F:0034.0003: input,hidraw2: USB HID v1.10 Mouse [SIGMACHIP Usb Mouse] on usb-3530000.xhci-2.2/input0
[   12.075469] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[   12.075508] tegra-asoc: sound: snd_soc_register_card failed (-517)
[   12.159459] CFGP2P-ERROR) wl_cfgp2p_add_p2p_disc_if :

Thanks

Hi,

Looks like Codec driver is not getting built will the kernel image.

“sudo zcat /proc/config.gz | grep AIC32” should result in below :

CONFIG_SND_SOC_TLV320AIC32X4=y
CONFIG_SND_SOC_TLV320AIC32X4_I2C=y

I will reconfirm it at my end and get back.

Thanks,
Sharad

Hi,

Looks like Codec driver is not getting built will the kernel image.

“sudo zcat /proc/config.gz | grep AIC32” should result in below :

CONFIG_SND_SOC_TLV320AIC32X4=y
CONFIG_SND_SOC_TLV320AIC32X4_I2C=y

I will reconfirm it at my end and get back.

Thanks,
Sharad

Hi,Sharad

Will the audio driver issue be related to image file flashing?
I found that the modified code was compiled and flashed, and the code was not executed.

I use the following command to flashing the image file, the modified code is not executed, and the original code is still executed.

sudo ./flash.sh -r -k kernel jetson-tx2 mmcblk0p1

However, I use the following command to flashing the image file, the system does not start properly.

sudo ./flash.sh -r -K kernel/Image jetson-tx2 mmcblk0p1

Thanks

For Jetson TX2.
-k kernel partition is for uboot.bin and uboot loads the Image from rootfs path /boot/Image

so you just need to scp or copy Image using some media to target and reboot if you system is still booting fine.

open the flash.xml and you can see what binary is in which partition.

You can also flash complete by first copying the newly built Image to LinuxforTegra/kernel/ folder and flash using

sudo ./flash.sh jetson-tx2 mmcblk0p1

note that -r option does not repackage the system.img (which is rootfs) , so that option you should not provide if you are updating something to rootfs

Hi,

  1. I modified the audio driver file related to TLV32OAIC32X4. After flashing image, the system can start up. However, the system will not start after flashing the device tree. The system version is JetPack4.2.2

I uploaded the unmodified source code and the modified source code to GitHub.
https://github.com/lion-rsh/jetson-tx2-kernel32.2.1/commits/master/kernel_src

  1. How to Set Resistance in tlv320aic32x4.c ?
static const char * const resistor_text[] = {
	"Off", "10 kOhm", "20 kOhm", "40 kOhm",
};
/* Left mixer pins */
static SOC_ENUM_SINGLE_DECL(in1l_lpga_p_enum, AIC32X4_LMICPGAPIN, 6, resistor_text);
static SOC_ENUM_SINGLE_DECL(in2l_lpga_p_enum, AIC32X4_LMICPGAPIN, 4, resistor_text);
static SOC_ENUM_SINGLE_DECL(in3l_lpga_p_enum, AIC32X4_LMICPGAPIN, 2, resistor_text);
static SOC_ENUM_SINGLE_DECL(in1r_lpga_p_enum, AIC32X4_LMICPGAPIN, 0, resistor_text);

static SOC_ENUM_SINGLE_DECL(cml_lpga_n_enum, AIC32X4_LMICPGANIN, 6, resistor_text);
static SOC_ENUM_SINGLE_DECL(in2r_lpga_n_enum, AIC32X4_LMICPGANIN, 4, resistor_text);
static SOC_ENUM_SINGLE_DECL(in3r_lpga_n_enum, AIC32X4_LMICPGANIN, 2, resistor_text);

static const struct snd_kcontrol_new in1l_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("IN1_L L+ Switch", in1l_lpga_p_enum),
};
static const struct snd_kcontrol_new in2l_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("IN2_L L+ Switch", in2l_lpga_p_enum),
};
static const struct snd_kcontrol_new in3l_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("IN3_L L+ Switch", in3l_lpga_p_enum),
};
static const struct snd_kcontrol_new in1r_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("IN1_R L+ Switch", in1r_lpga_p_enum),
};
static const struct snd_kcontrol_new cml_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("CM_L L- Switch", cml_lpga_n_enum),
};
static const struct snd_kcontrol_new in2r_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("IN2_R L- Switch", in2r_lpga_n_enum),
};
static const struct snd_kcontrol_new in3r_to_lmixer_controls[] = {
	SOC_DAPM_ENUM("IN3_R L- Switch", in3r_lpga_n_enum),
};

/*  Right mixer pins */
static SOC_ENUM_SINGLE_DECL(in1r_rpga_p_enum, AIC32X4_RMICPGAPIN, 6, resistor_text);
static SOC_ENUM_SINGLE_DECL(in2r_rpga_p_enum, AIC32X4_RMICPGAPIN, 4, resistor_text);
static SOC_ENUM_SINGLE_DECL(in3r_rpga_p_enum, AIC32X4_RMICPGAPIN, 2, resistor_text);
static SOC_ENUM_SINGLE_DECL(in2l_rpga_p_enum, AIC32X4_RMICPGAPIN, 0, resistor_text);
static SOC_ENUM_SINGLE_DECL(cmr_rpga_n_enum, AIC32X4_RMICPGANIN, 6, resistor_text);
static SOC_ENUM_SINGLE_DECL(in1l_rpga_n_enum, AIC32X4_RMICPGANIN, 4, resistor_text);
static SOC_ENUM_SINGLE_DECL(in3l_rpga_n_enum, AIC32X4_RMICPGANIN, 2, resistor_text);

static const struct snd_kcontrol_new in1r_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("IN1_R R+ Switch", in1r_rpga_p_enum),
};
static const struct snd_kcontrol_new in2r_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("IN2_R R+ Switch", in2r_rpga_p_enum),
};
static const struct snd_kcontrol_new in3r_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("IN3_R R+ Switch", in3r_rpga_p_enum),
};
static const struct snd_kcontrol_new in2l_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("IN2_L R+ Switch", in2l_rpga_p_enum),
};
static const struct snd_kcontrol_new cmr_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("CM_R R- Switch", cmr_rpga_n_enum),
};
static const struct snd_kcontrol_new in1l_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("IN1_L R- Switch", in1l_rpga_n_enum),
};
static const struct snd_kcontrol_new in3l_to_rmixer_controls[] = {
	SOC_DAPM_ENUM("IN3_L R- Switch", in3l_rpga_n_enum),
};

static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
	//SND_SOC_DAPM_DAC("Left DAC", "Left Playback", AIC32X4_DACSETUP, 7, 0),
	SND_SOC_DAPM_DAC("Left DAC", "Playback", AIC32X4_DACSETUP, 7, 0),
	SND_SOC_DAPM_MIXER("HPL Output Mixer", SND_SOC_NOPM, 0, 0,
			   &hpl_output_mixer_controls[0],
			   ARRAY_SIZE(hpl_output_mixer_controls)),
	SND_SOC_DAPM_PGA("HPL Power", AIC32X4_OUTPWRCTL, 5, 0, NULL, 0),

	SND_SOC_DAPM_MIXER("LOL Output Mixer", SND_SOC_NOPM, 0, 0,
			   &lol_output_mixer_controls[0],
			   ARRAY_SIZE(lol_output_mixer_controls)),
	SND_SOC_DAPM_PGA("LOL Power", AIC32X4_OUTPWRCTL, 3, 0, NULL, 0),

	//SND_SOC_DAPM_DAC("Right DAC", "Right Playback", AIC32X4_DACSETUP, 6, 0),
	SND_SOC_DAPM_DAC("Right DAC", "Playback", AIC32X4_DACSETUP, 6, 0),
	SND_SOC_DAPM_MIXER("HPR Output Mixer", SND_SOC_NOPM, 0, 0,
			   &hpr_output_mixer_controls[0],
			   ARRAY_SIZE(hpr_output_mixer_controls)),
	SND_SOC_DAPM_PGA("HPR Power", AIC32X4_OUTPWRCTL, 4, 0, NULL, 0),
	SND_SOC_DAPM_MIXER("LOR Output Mixer", SND_SOC_NOPM, 0, 0,
			   &lor_output_mixer_controls[0],
			   ARRAY_SIZE(lor_output_mixer_controls)),
	SND_SOC_DAPM_PGA("LOR Power", AIC32X4_OUTPWRCTL, 2, 0, NULL, 0),

	//SND_SOC_DAPM_ADC("Right ADC", "Right Capture", AIC32X4_ADCSETUP, 6, 0),
	SND_SOC_DAPM_ADC("Right ADC", "Capture", AIC32X4_ADCSETUP, 6, 0),
	SND_SOC_DAPM_MUX("IN1_R to Right Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in1r_to_rmixer_controls),
	SND_SOC_DAPM_MUX("IN2_R to Right Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in2r_to_rmixer_controls),
	SND_SOC_DAPM_MUX("IN3_R to Right Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in3r_to_rmixer_controls),
	SND_SOC_DAPM_MUX("IN2_L to Right Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in2l_to_rmixer_controls),
	SND_SOC_DAPM_MUX("CM_R to Right Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
			cmr_to_rmixer_controls),
	SND_SOC_DAPM_MUX("IN1_L to Right Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
			in1l_to_rmixer_controls),
	SND_SOC_DAPM_MUX("IN3_L to Right Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
			in3l_to_rmixer_controls),

	//SND_SOC_DAPM_ADC("Left ADC", "Left Capture", AIC32X4_ADCSETUP, 7, 0),
	SND_SOC_DAPM_ADC("Left ADC", "Capture", AIC32X4_ADCSETUP, 7, 0),
	SND_SOC_DAPM_MUX("IN1_L to Left Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in1l_to_lmixer_controls),
	SND_SOC_DAPM_MUX("IN2_L to Left Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in2l_to_lmixer_controls),
	SND_SOC_DAPM_MUX("IN3_L to Left Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in3l_to_lmixer_controls),
	SND_SOC_DAPM_MUX("IN1_R to Left Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
			in1r_to_lmixer_controls),
	SND_SOC_DAPM_MUX("CM_L to Left Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
			cml_to_lmixer_controls),
	SND_SOC_DAPM_MUX("IN2_R to Left Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
			in2r_to_lmixer_controls),
	SND_SOC_DAPM_MUX("IN3_R to Left Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
			in3r_to_lmixer_controls),

	SND_SOC_DAPM_MICBIAS("Mic Bias", AIC32X4_MICBIAS, 6, 0),

	SND_SOC_DAPM_OUTPUT("HPL"),
	SND_SOC_DAPM_OUTPUT("HPR"),
	SND_SOC_DAPM_OUTPUT("LOL"),
	SND_SOC_DAPM_OUTPUT("LOR"),
	SND_SOC_DAPM_INPUT("IN1_L"),
	SND_SOC_DAPM_INPUT("IN1_R"),
	SND_SOC_DAPM_INPUT("IN2_L"),
	SND_SOC_DAPM_INPUT("IN2_R"),
	SND_SOC_DAPM_INPUT("IN3_L"),
	SND_SOC_DAPM_INPUT("IN3_R"),
};

Thanks.

Hi,

  1. However, the system will not start after flashing the device tree. The system version is JetPack4.2.2

Can you check if codec driver tlv320aic32x4 probes are successful? Kindly attach boot logs with modified DT files.

  1. How to Set Resistance in tlv320aic32x4.c ?

Unfortunately we haven’t used tlv320aic32x4. So I suggest to get in touch with TI support.

Thanks,
Sharad