您尚未登录。

楼主 # 2024-12-17 02:29:37

chenyinchang
会员
注册时间: 2024-12-03
已发帖子: 5
积分: 20

f1c200 sunxi-gpadc 3.5.1SDK驱动失败,实在解决不了了请求各位大佬帮忙看看

之前很多问题通过找论坛帖子就能解决,这个实在解决不了了,不知道有什么问题,望各位大佬帮忙看看
已经在device driver - input - sensor 中勾选 (*)SUNXI GPADC

sun3iw1p1-c200s-F1C200S.dtsi配置如下:

		gpadc:gpadc@0x01c24800{
			compatible = "allwinner,sunxi-gpadc";
			reg = <0x0 0x01c24800 0x0 0x400>;
			interrupts = <20>;
			clocks = <&clk_gpadc>;
			status = "okay";
		};

sun3iw1p1-clk.dtsi配置如下:

		clk_gpadc: gpadc {
			#clock-cells = <0>;
			compatible = "allwinner,sunxi-periph-clock";
			clock-output-names = "gpadc";
		};

sys_config.fex配置如下:

[gpadc]
gpadc_used = 1
channel_num = 1
channel_select = 0x01
channel_data_select = 0
channel_compare_select = 0x01
channel_cld_select = 0x01
channel_chd_select = 0
channel0_compare_lowdata = 1700000
channel0_compare_higdata = 1200000
key_cnt = 4
key0_vol = 164
key0_val = 115
key1_vol = 415
key1_val = 114
key2_vol = 700
key2_val = 139
key3_vol = 1000
key3_val = 28

发生如下报错:

[    1.044016] sunxi_gpadc has no clk
[    1.047915] ------------[ cut here ]------------
[    1.053083] WARNING: at kernel/irq/manage.c:1267 __free_irq+0x8c/0x154()
[    1.060511] Trying to free already-free IRQ 116
[    1.065531] Modules linked in:
[    1.068933] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.65 #33
[    1.075493] Backtrace: 
[    1.078263] [<c0013328>] (dump_backtrace+0x0/0x104) from [<c0013534>] (show_stack+0x18/0x1c)
[    1.087618]  r7:000004f3 r6:c044454b r5:00000009 r4:c186bd20
[    1.093947] [<c001351c>] (show_stack+0x0/0x1c) from [<c0392ce8>] (dump_stack+0x20/0x28)
[    1.102863] [<c0392cc8>] (dump_stack+0x0/0x28) from [<c001b9dc>] (warn_slowpath_common+0x54/0x70)
[    1.112729] [<c001b988>] (warn_slowpath_common+0x0/0x70) from [<c001ba30>] (warn_slowpath_fmt+0x38/0x40)
[    1.123238]  r9:c04c0c84 r8:c1975100 r7:00000074 r6:a0000013 r5:c04d8898
r4:00000000
[    1.131984] [<c001b9f8>] (warn_slowpath_fmt+0x0/0x40) from [<c005f5e4>] (__free_irq+0x8c/0x154)
[    1.141623]  r3:00000074 r2:c04445b2
[    1.145615] [<c005f558>] (__free_irq+0x0/0x154) from [<c005f874>] (free_irq+0x5c/0x84)
[    1.154389]  r9:c04c0c84 r8:00000000 r7:c189e200 r6:c1975100 r5:00000074
r4:c04d8898
[    1.163132] [<c005f818>] (free_irq+0x0/0x84) from [<c026a398>] (sunxi_gpadc_probe+0xfc/0x6b0)
[    1.172579]  r7:c189e200 r6:fffffffe r5:ffffffea r4:c05c9598
[    1.178901] [<c026a29c>] (sunxi_gpadc_probe+0x0/0x6b0) from [<c01e59ec>] (platform_drv_probe+0x1c/0x20)
[    1.189333] [<c01e59d0>] (platform_drv_probe+0x0/0x20) from [<c01e47c0>] (driver_probe_device+0x144/0x1f8)
[    1.200053] [<c01e467c>] (driver_probe_device+0x0/0x1f8) from [<c01e4914>] (__driver_attach+0x54/0x94)
[    1.210366]  r9:c04c0c84 r8:00000000 r7:00000000 r6:c05a575c r5:c189e244
r4:c189e210
[    1.219115] [<c01e48c0>] (__driver_attach+0x0/0x94) from [<c01e2e10>] (bus_for_each_dev+0x88/0x98)
[    1.229045]  r7:00000000 r6:c01e48c0 r5:c05a575c r4:00000000
[    1.235367] [<c01e2d88>] (bus_for_each_dev+0x0/0x98) from [<c01e4270>] (driver_attach+0x20/0x28)
[    1.245103]  r6:c059c268 r5:c196ea80 r4:c05a575c
[    1.250262] [<c01e4250>] (driver_attach+0x0/0x28) from [<c01e3ea0>] (bus_add_driver+0x148/0x220)
[    1.260024] [<c01e3d58>] (bus_add_driver+0x0/0x220) from [<c01e4ec4>] (driver_register+0xa8/0x124)
[    1.269951]  r8:00000000 r7:c04c4e40 r6:c05b0820 r5:c04b7120 r4:c05a575c
[    1.277431] [<c01e4e1c>] (driver_register+0x0/0x124) from [<c01e5f4c>] (platform_driver_register+0x4c/0x60)
[    1.288225]  r9:c04c0c84 r8:00000000 r7:c04c4e40 r6:c05b0820 r5:c04b7120
r4:c186a000
[    1.296984] [<c01e5f00>] (platform_driver_register+0x0/0x60) from [<c04b7134>] (sunxi_gpadc_driver_init+0x14/0x1c)
[    1.308489] [<c04b7120>] (sunxi_gpadc_driver_init+0x0/0x1c) from [<c000a4d4>] (do_one_initcall+0x11c/0x148)
[    1.319335] [<c000a3b8>] (do_one_initcall+0x0/0x148) from [<c04a6c0c>] (kernel_init_freeable+0x1a4/0x1e4)
[    1.329966] [<c04a6a68>] (kernel_init_freeable+0x0/0x1e4) from [<c038fb6c>] (kernel_init+0x10/0xe8)
[    1.339992]  r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c038fb5c
r4:00000000
[    1.348732] [<c038fb5c>] (kernel_init+0x0/0xe8) from [<c000f930>] (ret_from_fork+0x14/0x24)
[    1.357986]  r5:c038fb5c r4:00000000
[    1.362016] ---[ end trace 17cce2252984e847 ]---
[    1.367428] sunxi-gpadc: probe of gpadc failed with error -22

离线

#1 2024-12-17 10:24:28

memory
会员
注册时间: 2021-08-11
已发帖子: 487
积分: 464

Re: f1c200 sunxi-gpadc 3.5.1SDK驱动失败,实在解决不了了请求各位大佬帮忙看看

[    1.044016] sunxi_gpadc has no clk

离线

楼主 #2 2024-12-17 16:40:57

chenyinchang
会员
注册时间: 2024-12-03
已发帖子: 5
积分: 20

Re: f1c200 sunxi-gpadc 3.5.1SDK驱动失败,实在解决不了了请求各位大佬帮忙看看

memory 说:

[    1.044016] sunxi_gpadc has no clk

一开始我也以为是这个问题,但发现sunxi_keyboard也会报这一条(个人感觉,更偏向提示,非警告)。keyboard驱动是正常加载的。

我往下翻看了clk相关文件,发现从头到尾都没有对gpadc外设时钟相关的描述,所以我认为本身f1c200/100本身就是没有gpadc功能的。


另外,c100/c200不是gpadc,而是tp!我对比了寄存器手册发现gpadc其实是tp的plus版本,应该也算是lradc的增强版本(因为adc位数更多,寄存器设置没做对比,但使用方式基本一样)。

所以,3.5.1SDK压根就没有TP相关的驱动和文档,当作普通ADC使用也没有,需要自己编写。我找到之前主线上线的sun4相关驱动和大家讨论的内容:https://whycan.com/t_1596.html

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn