# 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