exynos4412_迅为开发板gpio的操作

exynos4412_迅为开发板gpio的操作_第1张图片

 

当使用有复用的gpio,在内核中解除后,重新编译内核烧写到开发板,以模块方式打开新设备时,出现以下问题的解决方法

[  108.272880] WARNING: at drivers/gpio/gpiolib.c:101 gpio_ensure_requested+0x5c/0x118()
[  108.280681] autorequest GPIO-7
[  108.283719] Modules linked in: sht11_test
[  108.287712] Backtrace: 
[  108.290154] [] (dump_backtrace+0x0/0x11c) from [] (dump_stack+0x18/0x1c)
[  108.298563]  r6:c0860bb4 r5:00000065 r4:d49c1d08 r3:d49c0000
[  108.304211] [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x5c/0x6c)
[  108.313063] [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_fmt+0x38/0x40)
[  108.322519]  r8:00000007 r7:00000000 r6:c099f4f4 r5:c09010b0 r4:c099f4f8
[  108.329029] r3:00000009
[  108.331638] [] (warn_slowpath_fmt+0x0/0x40) from [] (gpio_ensure_requested+0x5c/0x118)
[  108.341268]  r3:00000007 r2:c0860bcc
[  108.344831] [] (gpio_ensure_requested+0x0/0x118) from [] (gpio_direction_output+0x98/0x100)
[  108.354904] [] (gpio_direction_output+0x0/0x100) from [] (I2C_Init+0x18/0x28 [sht11_test])
[  108.364884] [] (I2C_Init+0x0/0x28 [sht11_test]) from [] (sht11_open+0x10/0x24 [sht11_test])
[  108.374953] [] (sht11_open+0x0/0x24 [sht11_test]) from [] (chrdev_open+0x124/0x1f4)
[  108.384326] [] (chrdev_open+0x0/0x1f4) from [] (__dentry_open+0x164/0x2d8)
[  108.392914]  r7:d59e1be8 r6:d62cd820 r5:d582e220 r4:d4851640
[  108.398560] [] (__dentry_open+0x0/0x2d8) from [] (nameidata_to_filp+0x68/0x70)
[  108.407502] [] (nameidata_to_filp+0x0/0x70) from [] (do_last+0xc8/0x700)
[  108.415916]  r7:00000026 r6:00000000 r5:00000902 r4:d49c1ed0
[  108.421562] [] (do_last+0x0/0x700) from [] (path_openat+0xc4/0x3c4)
[  108.429548] [] (path_openat+0x0/0x3c4) from [] (do_filp_open+0x38/0x8c)
[  108.437880] [] (do_filp_open+0x0/0x8c) from [] (do_sys_open+0xe0/0x1a4)
[  108.446209]  r8:00000001 r7:ffffff9c r6:00000003 r5:00000902 r4:d6351000
[  108.452897] [] (do_sys_open+0x0/0x1a4) from [] (sys_open+0x24/0x28)
[  108.460883] [] (sys_open+0x0/0x28) from [] (ret_fast_syscall+0x0/0x30)
[  108.469125] ---[ end trace d03bf197bac8f492 ]--

在gpio_direction_output(gpio,1);之前加上gpio_request(gpio, NULL);即可解决

你可能感兴趣的:(itop4412相关学习)