一个按键驱动

简介: # cd /opt/EmbedSky/linux-2.6.30.4/drivers/input/keyboard # vim Kconfig   if INPUT_KEYBOARD +++++ config Embed...

# cd /opt/EmbedSky/linux-2.6.30.4/drivers/input/keyboard

# vim Kconfig

 

if INPUT_KEYBOARD

+++++

config EmbedSky_BUTTONS
    tristate "TQ2440/SKY2440 buttons"
    depends on ARCH_S3C2440
    default y
    help
          EmbedSky TQ2440/SKY2440 buttons.   

+++++

 

# vim Makefile

 

obj-$(CONFIG_KEYBOARD_LOCOMO)        += locomokbd.o

++++
obj-$(CONFIG_EmbedSky_BUTTONS)        += EmbedSky_buttons.o

++++
obj-$(CONFIG_KEYBOARD_NEWTON)        += newtonkbd.o

 

 

[root@localhost linux-2.6.30.4]# make menuconfig

Device Drivers  --->  

Input device support  ---> 

         [*]   Keyboards  --->    

                  --- Keyboards                                                                                                                             

                      TQ2440/SKY2440 buttons     

 

[root@localhost linux-2.6.30.4]# make SUBDIR=drivers/input/keyboard/ modules

 

  CC [M]  drivers/input/keyboard/EmbedSky_buttons.o
drivers/input/keyboard/EmbedSky_buttons.c:16:32: error: asm/arch/regs-gpio.h: No such file or directory
drivers/input/keyboard/EmbedSky_buttons.c:17:26: error: asm/hardware.h: No such file or directory
drivers/input/keyboard/EmbedSky_buttons.c:34: error: 'S3C2410_GPF1' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:34: error: 'S3C2410_GPF1_EINT1' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:35: error: 'S3C2410_GPF4' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:35: error: 'S3C2410_GPF4_EINT4' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:36: error: 'S3C2410_GPF2' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:36: error: 'S3C2410_GPF2_EINT2' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:37: error: 'S3C2410_GPF0' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c:37: error: 'S3C2410_GPF0_EINT0' undeclared here (not in a function)
drivers/input/keyboard/EmbedSky_buttons.c: In function 'buttons_interrupt':
drivers/input/keyboard/EmbedSky_buttons.c:54: error: implicit declaration of function 's3c2410_gpio_getpin'
drivers/input/keyboard/EmbedSky_buttons.c: In function 'EmbedSky_buttons_open':
drivers/input/keyboard/EmbedSky_buttons.c:76: error: implicit declaration of function 's3c2410_gpio_cfgpin'
drivers/input/keyboard/EmbedSky_buttons.c:78: warning: passing argument 3 of 'request_irq' makes integer from pointer without a cast
drivers/input/keyboard/EmbedSky_buttons.c: In function 'EmbedSky_buttons_init':
drivers/input/keyboard/EmbedSky_buttons.c:194: error: implicit declaration of function 'class_device_create'
drivers/input/keyboard/EmbedSky_buttons.c: In function 'EmbedSky_buttons_exit':
drivers/input/keyboard/EmbedSky_buttons.c:207: error: implicit declaration of function 'class_device_destroy'
make[3]: *** [drivers/input/keyboard/EmbedSky_buttons.o] 错误 1
make[2]: *** [drivers/input/keyboard] 错误 2
make[1]: *** [drivers/input] 错误 2
make: *** [drivers] 错误 2

 

你应该是拷贝的2.6.25.8中的GPIO的驱动到2.6.30.4的内核中,而两者的驱动源码有差别的,特别是注册驱动时的API上。

 

[root@localhost linux-2.6.30.4]# vim drivers/input/keyboard/EmbedSky_buttons.c

相关文章
|
19天前
|
开发者
STM32中断详解及其编程实践
STM32中断详解及其编程实践
31 1
|
7月前
|
Linux
Linux驱动开发(按键驱动)
Linux驱动开发(按键驱动)
88 0
|
8月前
|
Linux 调度
Linux驱动中断下半部的三种方法
Linux驱动中断下半部的三种方法
|
9月前
|
Linux 程序员
Linux驱动入门(6.2)按键驱动和LED驱动 --- 将逻辑电平与物理电平分离
Linux驱动入门(6.2)按键驱动和LED驱动 --- 将逻辑电平与物理电平分离
359 0
|
11月前
野火F1开发板STM32案例-外部中断(按键)使用
野火F1开发板STM32案例-外部中断(按键)使用
75 0
|
12月前
编写使用中断的按键驱动程序
编写使用中断的按键驱动程序
83 0
|
芯片
STM32CubeMX按键模块化 点灯
我们继续讲解 stm32 f103,这篇文章将详细 为大家讲解 如何 使用 按键点亮 RGB 灯。
124 0
STM32 使用外部中断实现按键模块化
STM32 使用外部中断实现按键模块化
95 0
|
Linux
linux驱动开发 使用设备树编写一个led驱动程序
linux驱动开发 使用设备树编写一个led驱动程序
223 0