接下來,我們添加LED 設備的內核配置選項,打開drivers/char/Kconfig 文件,添加如下紅色部分內容: config DEVKMEM ????????? bool "/dev/kmem virtual device support" ????????? default y ????????? help ???????????? Say Y here if you want to support the /dev/kmem device. The ???????????? /dev/kmem device is rarely used, but can be used for certain ???????????? kind of kernel debugging operations. ???????????? When in doubt, say "N". config LEDS_MINI2440 ?????????? tristate "LED Support for Mini2440 GPIO LEDs" ?????????? depends on MACH_MINI2440 ?????????? default y if MACH_MINI2440
?????????? help ????????????????? This option enables support for LEDs connected to GPIO lines ?????????????????? on Mini2440 boards. config MINI2440_ADC ?????????? bool "ADC driver for FriendlyARM Mini2440 development boards" ?????????? depends on MACH_MINI2440 ?????????? default y if MACH_MINI2440 ?????????? help ??????????????? this is ADC driver for FriendlyARM Mini2440 development boards ??????????????? Notes: the touch-screen-driver required this option 接下來,再根據該驅動的配置定義,把對應的驅動目標文件加入內核中,打開linux-2.6.32.2/drivers/char/Makefile 文件,添加如下紅色部分內容: obj-$(CONFIG_JS_RTC) += js-rtc.o js-rtc-y = rtc.o obj-$(CONFIG_LEDS_MINI2440) += mini2440_leds.o obj-$(CONFIG_MINI2440_ADC) += mini2440_adc.o # Files generated that shall be removed upon make clean clean-files := consolemap_deftbl.c defkeymap.c 這樣,我們就在內核中添加做好了LED 驅動