目標:
把驅動程式加入到可選擇的menuconfig中!
所需檔案:
pxa300原始碼
lt_backlight.c(driver source code)
1.把lt_backlight.c放進E:\cygwin\home\Jim\300\src\preview-kit\linux\drivers\char中
2.在同目錄底下E:\cygwin\home\Jim\300\src\preview-kit\linux\drivers\char的Kconfig要加入以下設定
config LITTLETON_BACKLIGHT bool "backlight driver for Littleton Platform" depends on PXA3xx && MACH_LITTLETON && PXA3xx_MICCO help Please say Y here if want to support LCD/Keypad backlight auto-off/auto-dim for Littleton Platform
3.在同目錄底下E:\cygwin\home\Jim\300\src\preview-kit\linux\drivers\char的Makefile要增加編譯
obj-$(CONFIG_LITTLETON_BACKLIGHT) += lt_backlight.o
另外,如何解釋這三個步驟呢?
一開始只有去看littletonl_defconfig(pxa300的預設config檔)
E:\cygwin\home\Jim\300\src\preview-kit\linux\arch\arm\configs\littletonl_defconfig
但後來發現它會自動產生autoconf.h
E:\cygwin\home\Jim\300\src\preview-kit\linux\include\linux\autoconf.h
在littletonl_defconfig之中,有這麼一行:
CONFIG_LITTLETON_BACKLIGHT=y
搭配上本書內容,於是找到了\300\src\preview-kit\linux\drivers\char\Makefile
obj-$(CONFIG_LITTLETON_BACKLIGHT) += lt_backlight.o 當littletonl_defconfig被選擇成要編進kernel的時候,就編譯成.obj檔
於是大約瞭解了添加driver的步驟
沒有留言:
張貼留言