【1】添加Linux觸摸屏驅動:
添加驅動代碼檔案:
lichee\linux-2.6.36\drivers\input\touchscreen\mg-i2c-ts.c
lichee\linux-2.6.36\drivers\input\touchscreen\mg-i2c-ts.h
kconfig檔案lichee\linux-2.6.36\drivers\input\touchscreen\Kconfig添加:
config TOUCHSCREEN_MG_I2C
tristate "Morgan multi-touch device"
depends on I2C
help
Say Y here if you have a Morgan multi-touch device
If unsure, say N.
Makefile檔案lichee\linux-2.6.36\drivers\input\touchscreen\Makefile添加:
obj-$(CONFIG_TOUCHSCREEN_MG_I2C) += mg-i2c-ts.o
★驅動源碼内gpio配置可做成讀取配置檔案模式,如mg-i2c-ts.c裡:
gpio_int_hdle = gpio_request_ex("ctp_para", "ctp_int_port");
if(!gpio_int_hdle) {
pr_warning("touch panel IRQ_EINT21_para request gpio fail!\n");
goto exit_gpio_int_request_failed;
}
★配置檔案用打包工具crane_pack選擇build for evb-v13,點選edit,搜尋[ctp_para],例如ctp_int_port 即配置中斷腳。
ctp_int_port = port:PH21<6><default>
編譯核心:
./build.sh -p sun4i_crane
【2】android2.3.4\device\softwinner\crane-evb-v13\mkfs.sh添加
cp $DRV_DIR/mg-i2c-ts.ko $PRODUCT_ROOT/drv/mg-i2c-ts.ko
【3】android啟動檔案init.sun4i.rc注釋和添加
#insmod /drv/ft5x_ts.ko
insmod /drv/mg-i2c-ts.ko
序列槽輸出調試資訊
在檔案tools\crane-win-v2\wboot\bootfs\linux\params添加loglevel=8
console=ttyS0,115200 root=/dev/nandb rw init=/init [email protected] [email protected]loglevel=8;