|
通过工具:
mediatek/source/dct/DrvGen.exe
配置并替换dws文件:
mediatek/custom/bbk75_emmc_gb2/kernel/dct/dct/codegen.dws
1、在下面文件的MTK6575标签栏添加对应的flash芯片型号信息:
mediatek/build/tools/emigen/MT6575/MemoryDeviceList_MT6575.xls
2、从以下文件获取flash芯片对应的序号(从第1列为0,开始数,如到第L列则为11): mediatek/build/tools/ptgen/emmc_region.xls
3、mediatek/custom/bbk15_td_ics/preloader/inc/custom_MemoryDevice.h
#define BOARD_ID LENOVO75 #define CS_PART_NUMBER[0] KMSJS000KM_B308
将上面的宏更改为MemoryDeviceList_MT6575.xls中对应的内容
4、mediatek/config/bbk15_td_ics/ProjectConfig.mk
将EMMC_CHIP更改为第2步获取的数值,如EMMC_CHIP = 11。
(1)、配置mediatek/config/bbk15_td_ics/ProjectConfig.mk
CUSTOM_KERNEL_LCM = sharp_S6D05A1X12_mcu CUSTOM_UBOOT_LCM = sharp_S6D05A1X12_mcu LCM_WIDTH = 320 LCM_HEIGHT = 480 BOOT_LOGO = cmcc_hvga
(2)、增加 lcm 驱动目录及文件
mediatek/custom/common/kernel/lcm/sharp_S6D05A1X12_mcu/
#ifdef BUILD_UBOOT #include#define print(x...) printf(x) #else #include #define print(x...) printk(x) #endif
#ifdef BUILD_UBOOT #include#define print(x...) printf(x) #else #include #define print(x...) printk(x) #endif
(3)、修改 mt65xx_lcm_list.c 使支持刚添加的驱动
mediatek/custom/common/kernel/lcm/mt65xx_lcm_list.c
extern LCM_DRIVER sharp_S6D05A1X12_mcu_drv; ... #if defined(SHARP_S6D05A1X12_MCU) &sharp_S6D05A1X12_mcu_drv, #endif
打开 mediatek/custom/common/kernel/lcm/sharp_S6D05A1X12_mcu/sharp_S6D05A1X12_mcu.c,根据BB管脚定义和实际硬件连接,更改如下GPIO宏定义:
#define LSA0_GPIO_PIN (GPIO49) #define LSCE_GPIO_PIN (GPIO47) #define LSCK_GPIO_PIN (GPIO51) #define LSDA_GPIO_PIN (GPIO52) #define DPICK_GPIO_PIN (GPIO41) #define DPIDE_GPIO_PIN (GPIO30) #define DPIVSYNC_GPIO_PIN (GPIO21) #define DPIHSYNC_GPIO_PIN (GPIO19)
背光配置包括uboot和kernal中的文件:
mediatek/custom/bbk15_td_ics/kernel/leds/mt65xx/cust_leds.c
mediatek/custom/bbk15_td_ics/uboot/cust_leds.c
主要配置
... {"lcd-backlight", MT65XX_LED_MODE_CUST, (int)Cust_SetBacklight}, ...
中的响应函数"Cust_SetBacklight",在其中要保证背光能亮,由于是打版软件,这里只先配置成gpio让其保持最亮。
查背光IC datasheet可知,只需设置VFB为低、CE为高即可:
... //GPIO162->BL_EN->CE mt_set_gpio_mode(GPIO162,GPIO_MODE_00); mt_set_gpio_dir(GPIO162,GPIO_DIR_OUT); mt_set_gpio_out(GPIO162,GPIO_OUT_ONE); //GPIO67->PWM1->VFB mt_set_gpio_mode(GPIO67,GPIO_MODE_00); mt_set_gpio_dir(GPIO67,GPIO_DIR_OUT); mt_set_gpio_out(GPIO67,GPIO_OUT_ZERO); ...
如:
#define GPIO_CTP_RST_PIN GPIO100 #define GPIO_CTP_RST_PIN_M_GPIO GPIO_MODE_00 #define GPIO_CTP_EINT_PIN GPIO75 #define GPIO_CTP_EINT_PIN_M_GPIO GPIO_MODE_00 #define GPIO_CTP_EINT_PIN_M_EINT GPIO_MODE_01 #define GPIO_CTP_EINT_PIN_M_PWM GPIO_MODE_02
CUSTOM_KERNEL_TOUCHPANEL = qt602240
添加头文件:
mediatek/custom/bbk15_td_ics/kernel/touchpanel/qt602240/
添加C文件:
mediatek/custom/common/kernel/touchpanel/qt602240/
mediatek/custom/bbk15_td_ics/kernel/touchpanel/qt602240/
更改以下宏定义为对应平台:
#define TPD_POWER_SOURCE MT6575_POWER_VGP2
check触摸屏驱动ic的i2c地址,确保代码与datasheet中保持一致:
static unsigned short force[] = {3, 0x4a, I2C_CLIENT_END,I2C_CLIENT_END}; //0x4a则为i2c地址
另外注意check一下此头文件中的其他宏定义信息,确保触屏与LCM适配,如:
//#define TPD_RES_X 480 //#define TPD_RES_Y 800 //#define TPD_CALIBRATION_MATRIX {962,0,0,0,1600,0,0,0}; #define TPD_CALIBRATION_MATRIX {320*2,0,0,0,480*2,0,0,0};
一般在对应的.detect(重新供电操作), .suspend(关闭供电操作), .resume(打开供电操作)中添加进行相关操作,供电功能函数如下:
hwPowerDown(TPD_POWER_SOURCE,"TP"); //停止供电 hwPowerOn(TPD_POWER_SOURCE,VOL_2800,"TP"); //开始供电
另外也可直接在pmic的probe函数中配置(注意找对对应的pm电压输出口和电压大小):
mediatek/platform/mt6575/kernel/drivers/power/pmic_mt6329.c
static int mt6329_driver_probe(struct i2c_client *client, const struct i2c_device_id *id) { ... pmic_ldo_enable(MT65XX_POWER_LDO_VGP2,KAL_TRUE); pmic_ldo_vol_sel(MT65XX_POWER_LDO_VGP2,UPMU_VOLT_2_8_0_0_V); ... }
方法一:在force中进行i2c id的指定,然后用i2c_add_driver挂载到对应的i2c总线上去:
static unsigned short force[] = {3, 0x4a, I2C_CLIENT_END,I2C_CLIENT_END};
方法二:在mtk6575_dev.c中进行设置:
static struct i2c_board_info __initdata i2c_devs0[]={ { I2C_BOARD_INFO("fan5405", (0xd4>>1)),}, { I2C_BOARD_INFO("qt602240ts", (0x94>>1)),}, };
qt602240ts在配置完成时默认是使用鼠标模式,此时可将以下文件push到 /system/usr/idc/ 即可设置为点触模式:
out/target/product/bbk15_td_ics/system/usr/idc/qt602240ts.idc
# Basic Parameters touch.deviceType = touchScreen touch.orientationAware = 1 # Size touch.size.calibration = diameter touch.size.scale = 10 touch.size.bias = 0 touch.size.isSummed = 0 # Pressure # Driver reports signal strength as pressure. # # A normal thumb touch typically registers about 200 signal strength # units although we don't expect these values to be accurate. touch.pressure.calibration = amplitude touch.pressure.scale = 0.005 # Orientation touch.orientation.calibration = none