主题中讨论的其他器件:ADC3140EVM-PDK、
大家好!
一段时间以来、我已经尝试 通过 Linux 内核驱动程序将 TLV320ADC3140与 Raspberry Pi 一起使用。 我正在使用连接到 Raspberry Pi 4的 ADC3140EVM-PDK 评估模块(www.ti.com/.../ADC3140EVM-PDK)。 我阅读了一些资源、包括音频论坛中的帖子: https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1044970/tlv320adc5140-device-tree-on-raspberry-pi
tlv320adcx140 内核模块在设备上编译并通过设备树重叠进行配置:
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2837", "brcm,bcm2836", "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&i2s_clk_consumer>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
ti_codec: tlv320adc3140@4c {
compatible = "ti,tlv320adc3140";
reg = <0x4c>;
#sound-dai-cells = <0>;
ti,mic-bias-source = <0>;
ti,gpi-config = <0 0 0 0>;
ti,gpio-config = <2 2>;
ti,gpo-config-1 = <0 0>;
ti,gpo-config-2 = <0 0>;
reset-gpios = <&gpio 4 0>;
};
};
};
fragment@2 {
target = <&sound>;
__overlay__ {
compatible = "simple-audio-card";
i2s-controller = <&i2s_clk_consumer>;
status = "okay";
simple-audio-card,name = "TI";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&codec_dai>;
simple-audio-card,frame-master = <&codec_dai>;
cpu_dai: simple-audio-card,cpu {
sound-dai = <&i2s_clk_consumer>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
};
codec_dai: simple-audio-card,codec {
sound-dai = <&ti_codec>;
};
};
};
};
当我引导系统时、大部分时间似乎正确加载了模块、探测工作正常、并且 ALSA 接口 可用。 然而,不时,特别是 每当开始录音,奇怪的事情开始发生。 我会定期通过 I2C 收到以下写入寄存器的错误:
[ 4.229373] tlv320adcx140-codec 1-004c: ASoC: error at snd_soc_component_update_bits on tlv320adcx140-codec.1-004c for register: [0x00000007] -5 [ 4.229600] tlv320adcx140-codec 1-004c: ASoC: error at snd_soc_component_update_bits on tlv320adcx140-codec.1-004c for register: [0x00000013] -5
在以下中、内核停止、器件无法再使用:
[ 4.229836] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 [ 4.229853] Mem abort info: [ 4.229856] ESR = 0x0000000096000005 [ 4.229861] EC = 0x25: DABT (current EL), IL = 32 bits [ 4.229866] SET = 0, FnV = 0 [ 4.229871] EA = 0, S1PTW = 0 [ 4.229875] FSC = 0x05: level 1 translation fault [ 4.229879] Data abort info: [ 4.229883] ISV = 0, ISS = 0x00000005 [ 4.229887] CM = 0, WnR = 0 [ 4.229891] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000041fcc000 [ 4.229897] [0000000000000018] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 [ 4.229912] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP [ 4.229920] Modules linked in: tlv320adcx140(O) binfmt_misc regmap_i2c hci_uart snd_soc_simple_card snd_soc_simple_card_utils brcmfmac btbcm snd_soc_bcm2835_i2s bluetooth rpivid_hevc(C) brcmutil snd_soc_core bcm2835_codec(C) bcm2835_v4l2(C) raspberrypi_hwmon bcm2835_isp(C) bcm2835_mmal_vchiq(C) v4l2_mem2mem videobuf2_dma_contig videobuf2_vmalloc snd_compress videobuf2_memops snd_bcm2835(C) snd_pcm_dmaengine videobuf2_v4l2 snd_pcm videobuf2_common ecdh_generic ecc snd_timer libaes videodev mc snd raspberrypi_gpiomem vc_sm_cma(C) nvmem_rmem uio_pdrv_genirq uio batman_adv bridge stp llc cfg80211 rfkill i2c_dev drm dm_mod drm_panel_orientation_quirks backlight fuse ip_tables x_tables ipv6 i2c_bcm2835 [ 4.230035] CPU: 1 PID: 9 Comm: kworker/u8:0 Tainted: G C O 6.1.0-rpi8-rpi-v8 #1 Debian 1:6.1.73-1+rpt1 [ 4.230045] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT) [ 4.230050] Workqueue: events_unbound deferred_probe_work_func [ 4.230065] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 4.230072] pc : adcx140_pwr_ctrl+0x8c/0xfc [tlv320adcx140] [ 4.230092] lr : adcx140_pwr_ctrl+0x84/0xfc [tlv320adcx140] [ 4.230103] sp : ffffffc00806b990 [ 4.230107] x29: ffffffc00806b990 x28: 0000000000000000 x27: ffffff8042b88080 [ 4.230118] x26: ffffffeb4ff34000 x25: 0000000000000001 x24: 0000000000000080 [ 4.230127] x23: ffffff80440d1d80 x22: 0000000000000001 x21: 0000000000000000 [ 4.230136] x20: 00000000000000e0 x19: ffffff80440d1d80 x18: 00000000fffffffd [ 4.230145] x17: 0000000000000000 x16: ffffffeb793fad10 x15: ffffffc00806b590 [ 4.230154] x14: 0000000000000001 x13: 2930347830202c62 x12: 3778302865746972 [ 4.230163] x11: 775f70616d676572 x10: 0000000000001a30 x9 : ffffffeb78fb37fc [ 4.230172] x8 : ffffff8040271a90 x7 : 0000000000000000 x6 : 000000000e3ec98d [ 4.230181] x5 : 0040001000000020 x4 : 0000000000000000 x3 : 00000000fffffffb [ 4.230190] x2 : 0000000000000000 x1 : ffffff8040270000 x0 : 00000000fffffffb [ 4.230200] Call trace: [ 4.230205] adcx140_pwr_ctrl+0x8c/0xfc [tlv320adcx140] [ 4.230217] adcx140_set_dai_fmt+0x210/0x22c [tlv320adcx140] [ 4.230228] snd_soc_dai_set_fmt+0x34/0xa0 [snd_soc_core] [ 4.230311] snd_soc_runtime_set_dai_fmt+0x5c/0x150 [snd_soc_core] [ 4.230356] snd_soc_bind_card+0x638/0xb80 [snd_soc_core] [ 4.230399] snd_soc_register_card+0xf8/0x110 [snd_soc_core] [ 4.230444] devm_snd_soc_register_card+0x54/0xb0 [snd_soc_core] [ 4.230488] asoc_simple_probe+0x20c/0x3bc [snd_soc_simple_card] [ 4.230499] platform_probe+0x70/0xcc [ 4.230508] really_probe+0xc4/0x2e0 [ 4.230514] __driver_probe_device+0x80/0x120 [ 4.230520] driver_probe_device+0xe0/0x164 [ 4.230526] __device_attach_driver+0xc0/0x13c [ 4.230532] bus_for_each_drv+0x84/0xe0 [ 4.230541] __device_attach+0xa4/0x1a0 [ 4.230546] device_initial_probe+0x1c/0x2c [ 4.230552] bus_probe_device+0xa4/0xb0 [ 4.230557] deferred_probe_work_func+0x90/0xd0 [ 4.230563] process_one_work+0x200/0x474 [ 4.230572] worker_thread+0x74/0x43c [ 4.230579] kthread+0x110/0x114 [ 4.230586] ret_from_fork+0x10/0x20 [ 4.230595] Code: 531a6442 9400025a 2a0003e3 34000140 (f9400ea0) [ 4.230602] ---[ end trace 0000000000000000 ]---
我想知道我的操作有什么问题、或者 内核模块代码中是否有错误、或者是否存在某些配置错误。
如果有人可以在这里提供帮助或分享使用 CHIP 系列和 Raspberry Pi SBC 的成功案例、那太棒了。
谢谢
乔纳斯