主题 : 删除GPIO key button功能 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 84588
精华: 0
发帖: 9
金钱: 45 两
威望: 9 点
综合积分: 18 分
注册时间: 2012-12-24
最后登录: 2013-02-28
楼主  发表于: 2012-12-27 11:52

 删除GPIO key button功能

我想要在Tiny6410增加一个I2C的电容触屏装置,
其中需要有两个GPIO串口作为interrupt和reset的功能,
我将GPN0作为interrupt功能,
在march-mini6410.c 修改以下
struct gpio_keys_button gpio_buttons[ ]={
/*{ .gpio = S3C64XX_GPN(0),
  .code = 158,
  .desc = "HOME",
  .active_low = 1,
  .wakeup = 0,
},*/

开机讯息:
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
Install novatek touch driver.
------------[ cut here ]------------
WARNING: at drivers/gpio/gpiolib.c:99 gpio_ensure_requested+0x48/0x114()
autorequest GPIO-144
Modules linked in:
[<c016a9a4>] (unwind_backtrace+0x0/0xe4) from [<c017f51c>] (warn_slowpath_common+0x4c/0x64)
[<c017f51c>] (warn_slowpath_common+0x4c/0x64) from [<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c)
[<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c) from [<c02e91f0>] (gpio_ensure_requested+0x48/0x114)
[<c02e91f0>] (gpio_ensure_requested+0x48/0x114) from [<c02e9474>] (gpio_direction_output+0x84/0x178)
[<c02e9474>] (gpio_direction_output+0x84/0x178) from [<c03c0160>] (novatek_ts_probe+0xe8/0x384)
[<c03c0160>] (novatek_ts_probe+0xe8/0x384) from [<c03c60f0>] (i2c_device_probe+0x94/0xc0)
[<c03c60f0>] (i2c_device_probe+0x94/0xc0) from [<c031bd7c>] (driver_probe_device+0xa8/0x158)
[<c031bd7c>] (driver_probe_device+0xa8/0x158) from [<c031be8c>] (__driver_attach+0x60/0x84)
[<c031be8c>] (__driver_attach+0x60/0x84) from [<c031b098>] (bus_for_each_dev+0x4c/0x78)
[<c031b098>] (bus_for_each_dev+0x4c/0x78) from [<c031b704>] (bus_add_driver+0x94/0x210)
[<c031b704>] (bus_add_driver+0x94/0x210) from [<c031c108>] (driver_register+0xa8/0x12c)
[<c031c108>] (driver_register+0xa8/0x12c) from [<c03c63f0>] (i2c_register_driver+0x40/0x90)
[<c03c63f0>] (i2c_register_driver+0x40/0x90) from [<c01654fc>] (do_one_initcall+0xbc/0x190)
[<c01654fc>] (do_one_initcall+0xbc/0x190) from [<c0008b10>] (kernel_init+0x98/0x14c)
[<c0008b10>] (kernel_init+0x98/0x14c) from [<c01668b0>] (kernel_thread_exit+0x0/0x8)
---[ end trace 398c04c3300125aa ]---
s3c6400_setup_sdhci_cfg_card: CTRL 2=c0004120, 3=00008080
mmc0: new high speed SDHC card at address aaaa
mmcblk0: mmc0:aaaa SU04G 3.69 GiB
mmcblk0: p1
s3c6400_setup_sdhci_cfg_card: CTRL 2=c0004120, 3=80808080
input: Novatek Capacitive TouchScreen as /devices/virtual/input/input1
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:290 enable_irq+0x5c/0xa4()
Unbalanced enable for IRQ 109
Modules linked in:
[<c016a9a4>] (unwind_backtrace+0x0/0xe4) from [<c017f51c>] (warn_slowpath_common+0x4c/0x64)
[<c017f51c>] (warn_slowpath_common+0x4c/0x64) from [<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c)
[<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c) from [<c01b8ed4>] (enable_irq+0x5c/0xa4)
[<c01b8ed4>] (enable_irq+0x5c/0xa4) from [<c03c037c>] (novatek_ts_probe+0x304/0x384)
[<c03c037c>] (novatek_ts_probe+0x304/0x384) from [<c03c60f0>] (i2c_device_probe+0x94/0xc0)
[<c03c60f0>] (i2c_device_probe+0x94/0xc0) from [<c031bd7c>] (driver_probe_device+0xa8/0x158)
[<c031bd7c>] (driver_probe_device+0xa8/0x158) from [<c031be8c>] (__driver_attach+0x60/0x84)
[<c031be8c>] (__driver_attach+0x60/0x84) from [<c031b098>] (bus_for_each_dev+0x4c/0x78)
[<c031b098>] (bus_for_each_dev+0x4c/0x78) from [<c031b704>] (bus_add_driver+0x94/0x210)
[<c031b704>] (bus_add_driver+0x94/0x210) from [<c031c108>] (driver_register+0xa8/0x12c)
[<c031c108>] (driver_register+0xa8/0x12c) from [<c03c63f0>] (i2c_register_driver+0x40/0x90)
[<c03c63f0>] (i2c_register_driver+0x40/0x90) from [<c01654fc>] (do_one_initcall+0xbc/0x190)
[<c01654fc>] (do_one_initcall+0xbc/0x190) from [<c0008b10>] (kernel_init+0x98/0x14c)
[<c0008b10>] (kernel_init+0x98/0x14c) from [<c01668b0>] (kernel_thread_exit+0x0/0x8)
---[ end trace 398c04c3300125ab ]---
one_wire_status: 4
s3c-rtc s3c64xx-rtc: setting system clock to 2000-01-11 01:01:00 UTC (947552460)
Freeing init memory: 1396K

我觉得是GPIO冲突所导致,不知道有没有判断错误。
又改如何解决?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-12-27 12:05
WARNING: at drivers/gpio/gpiolib.c:99 gpio_ensure_requested+0x48/0x114()
autorequest GPIO-144
Modules linked in:
[<c016a9a4>] (unwind_backtrace+0x0/0xe4) from [<c017f51c>] (warn_slowpath_common+0x4c/0x64)
[<c017f51c>] (warn_slowpath_common+0x4c/0x64) from [<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c)
[<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c) from [<c02e91f0>] (gpio_ensure_requested+0x48/0x114)
[<c02e91f0>] (gpio_ensure_requested+0x48/0x114) from [<c02e9474>] (gpio_direction_output+0x84/0x178)
[<c02e9474>] (gpio_direction_output+0x84/0x178) from [<c03c0160>] (novatek_ts_probe+0xe8/0x384)
[<c03c0160>] (novatek_ts_probe+0xe8/0x384) from [<c03c60f0>] (i2c_device_probe+0x94/0xc0)

这个看起来是因为在novatek_ts_probe()里调用gpio_direction_output()的时候,没有先调用gpio_request()导致的。这只是个警告,不会影响功能

WARNING: at kernel/irq/manage.c:290 enable_irq+0x5c/0xa4()
Unbalanced enable for IRQ 109
Modules linked in:
[<c016a9a4>] (unwind_backtrace+0x0/0xe4) from [<c017f51c>] (warn_slowpath_common+0x4c/0x64)
[<c017f51c>] (warn_slowpath_common+0x4c/0x64) from [<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c)
[<c017f5b4>] (warn_slowpath_fmt+0x2c/0x3c) from [<c01b8ed4>] (enable_irq+0x5c/0xa4)
[<c01b8ed4>] (enable_irq+0x5c/0xa4) from [<c03c037c>] (novatek_ts_probe+0x304/0x384)
[<c03c037c>] (novatek_ts_probe+0x304/0x384) from [<c03c60f0>] (i2c_device_probe+0x94/0xc0)

这是因为在novatek_ts_probe()里调用了enable_irq(). 通常情况下,调用request_irq()就enable了相应的中断,不需要再调用enable_irq()
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 84588
精华: 0
发帖: 9
金钱: 45 两
威望: 9 点
综合积分: 18 分
注册时间: 2012-12-24
最后登录: 2013-02-28
2楼  发表于: 2012-12-27 16:06
谢谢