您好!
我在本主题 https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1104527/tlv320aic3263-linux-kernel-v5-4-driver/中将 aic3263与给定的驱动程序结合使用。 我定义了2种不同的模式并使用 mkcfw 工具创建.bin 文件、但我不理解如何更改模式。 我在 tlv320aic326x.c 文件中找到 aic3262_set_mode_get 函数。 根据函数说明、我尝试运行 tinymix 命令来列出模式。 但是、当我运行 tinymix 命令时、aic3xxx_get_mode 函数中会发生内核严重错误、并且系统会重新启动。
我在 aic3xxx_get_mode 函数中添加了一些调试打印、如下所示。 我想、我无法访问 CFW_ST态 ps 变量的内容。
static int aic3xxx_get_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { printk("--- get mode ---: 1\n"); struct soc_enum *e = (struct soc_enum *) kcontrol->private_value; printk("--- get mode ---: 2\n"); struct cfw_state *ps = (struct cfw_state *) e->mask; printk("--- get mode ---: 3 ps : %s\n",(ps == NULL ? "NULL" : "NOT NULL")); printk("--- get mode ---: 4 ps->cur_mode_id : %d\n",ps->cur_mode_id); // printk("--- get mode ---: mode=%d pfw=%d ovly=%d cfg=%d",ps->cur_mode, ps->cur_pfw, ps->cur_ovly, ps->cur_cfg); printk("--- get mode ---: 5 ucontrol : %s\n",(ucontrol == NULL ? "NULL" : "NOT NULL")); ucontrol->value.enumerated.item[0] = ps->cur_mode_id; printk("--- get mode ---: exit\n"); return 0; }
[ 139.514325] --- get mode ---: 1 [ 139.522545] --- get mode ---: 2 [ 139.525689] --- get mode ---: 3 ps : NOT NULL [ 139.530063] Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000072388938 [ 139.540804] Mem abort info: [ 139.544336] ESR = 0x96000004 [ 139.547424] EC = 0x25: DABT (current EL), IL = 32 bits [ 139.552750] SET = 0, FnV = 0 [ 139.555832] EA = 0, S1PTW = 0 [ 139.559720] Data abort info: [ 139.562627] ISV = 0, ISS = 0x00000004 [ 139.566477] CM = 0, WnR = 0 [ 139.569438] user pgtable: 4k pages, 48-bit VAs, pgdp=00000008cf4e3000 [ 139.575886] [0000000072388938] pgd=0000000000000000 [ 139.580774] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 139.586344] Modules linked in: [last unloaded: brcmutil] [ 139.591654] CPU: 4 PID: 2095 Comm: tinymix Not tainted 5.4.47 #82 [ 139.597740] Hardware name: Variscite VAR-SOM-MX8 LVDS (DT) [ 139.603223] pstate: 60400005 (nZCv daif +PAN -UAO) [ 139.608022] pc : aic3xxx_get_mode+0x5c/0xa8 [ 139.612206] lr : aic3xxx_get_mode+0x5c/0xa8 [ 139.616383] sp : ffff80002b16bc00 [ 139.619693] x29: ffff80002b16bc20 x28: ffff00082d7e8000 [ 139.625001] x27: 0000000000000000 x26: 0000000000000000 [ 139.630309] x25: 0000000056000000 x24: 0000000000000000 [ 139.635617] x23: ffff000872381530 x22: ffff800011843294 [ 139.640925] x21: ffff80001195f6ee x20: 0000000072388900 [ 139.646233] x19: ffff00084f41b000 x18: 0000000000000000 [ 139.651541] x17: 0000000000000041 x16: ffff80001134bfe8 [ 139.656849] x15: ffff8000115ba427 x14: 0000000000000050 [ 139.662157] x13: 0000000000003837 x12: 0000000000000000 [ 139.667465] x11: 0000000000000000 x10: 00000000ffffffff [ 139.672774] x9 : 1bcaf463bca62a00 x8 : 1bcaf463bca62a00 [ 139.678082] x7 : 3a2073702033203a x6 : ffff8000120cb9b1 [ 139.683390] x5 : 0000000000000000 x4 : 0000000000000000 [ 139.688698] x3 : ffff8000107f0220 x2 : fffffffffffffb85 [ 139.694006] x1 : 0000000000000000 x0 : 0000000000000021 [ 139.699314] Call trace: [ 139.701758] aic3xxx_get_mode+0x5c/0xa8 [ 139.705589] snd_ctl_ioctl+0x8cc/0x16d8 [ 139.709421] do_vfs_ioctl+0x648/0x14b8 [ 139.713162] __arm64_sys_ioctl+0x70/0x98 [ 139.717084] el0_svc_common+0x98/0x150 [ 139.720826] el0_svc_handler+0x68/0x80 [ 139.724570] el0_svc+0x8/0xc [ 139.727449] Code: d0004c80 9a9502c1 911b4400 97c672d5 (b9403a81) [ 139.733550] ---[ end trace 067dcb5bf62a504c ]--- [ 139.738165] Kernel panic - not syncing: Fatal exception [ 139.743387] SMP: stopping secondary CPUs [ 139.747310] Kernel Offset: disabled [ 139.750798] CPU features: 0x00000002,2100600c [ 139.755149] Memory Limit: none [ 139.758202] Rebooting in 5 seconds..
我是否做了一些错误 、如何正确更改模式?
谢谢。