此文是基于AM1808平台的LCD 驱动移植过程。
一。修改LCD panel参数,文件: Da8xx-fb.c
static struct da8xx_panel known_lcd_panels[] = {
/* Sharp LCD035Q3DG01 */
[0] = {
.name = "Sharp_LCD035Q3DG01",
.width = 320,
.height = 240,
.hfp = 8,
.hbp = 6,
.hsw = 0,
.vfp = 2,
.vbp = 2,
.vsw = 0,
.pxl_clk = 4608000,
.invert_pxl_clk = 1,
},
/* Sharp LK043T1DG01 */
[1] = {
.name = "Sharp_LK043T1DG01",
.width = 480,
.height = 272,
.hfp = 2,
.hbp = 2,
.hsw = 41,
.vfp = 3,
.vbp = 3,
.vsw = 10,
.pxl_clk = 7833600,
.invert_pxl_clk = 0,
},
/* LinCuiting SET 2015_10_14 LCD70P800480 */
[2] = {
.name = "MCUzone_LCD70",
.width = 800,
.height = 480,
.hfp = 209,
.hbp = 25,//46,
.hsw = 19,
.vfp = 21,
.vbp = 12,//23,
.vsw = 9,
.pxl_clk = 33300000,
.invert_pxl_clk = 0,
},
};
二。da8xx_lcdc_platform_data加入自己的屏,文件:Devices-da8xx.c
struct da8xx_lcdc_platform_data mcuzone_lcd70p800480_pdata = {
.manu_name = "MCUzone",
.controller_data = &lcd_cfg,
.type = "MCUzone_LCD70",
};
三。修改头文件。文件:Da8xx.h, Mux.h
1.Da8xx.h
extern const short da8xx_lcdc_platform_data mcuzone_lcd70p800480_pdata;
2.Mux.h
/* GPIO function */
DA850_GPIO2_0,
DA850_GPIO2_4,
DA850_GPIO2_6,
DA850_GPIO2_8,
DA850_GPIO2_14,
DA850_GPIO2_15,
DA850_GPIO4_0,
DA850_GPIO4_1,
DA850_GPIO1_4,
DA850_GPIO1_5,
DA850_GPIO0_11,
DA850_GPIO6_13,
DA850_RTC_ALARM,
DA850_GPIO7_4,
DA850_GPIO0_15,
DA850_GPIO6_9,
DA850_GPIO6_10, //lct set
DA850_GPIO8_10, //lct set
四。Da850.c
/* GPIO function */
。。。。。。。。。。。
。。。。。。。。。。。
MUX_CFG(DA850, GPIO8_10, 18, 28, 15, 8, false) //lct set
五。板级信息:注册屏。文件:Board-da850-evm.c
#define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 11)//lct set
#define DA850_LCD_BL_PIN GPIO_TO_PIN(8, 10)//lct set
//lct set
static const short da850_evm_lcdc_pins[] = {
DA850_GPIO6_10, DA850_GPIO8_10,
-1
};
static struct platform_device *da850_evm_devices[] __initdata = {
&da850_evm_nandflash_device,
// &da850_evm_norflash_device,
};
static __init void da850_evm_init(void)
{
。。。。。。。。。。。。。。。。。。。。。
。。。。。。。。。。。。。。。。。。。。。
。。。。。。。。。。。。。。。。。。。。。
#if 0
#warning build for LCD43
sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
#else
#warning build for LCD70
mcuzone_lcd70p800480_pdata.panel_power_ctrl = da850_panel_power_ctrl,
ret = da8xx_register_lcdc(&mcuzone_lcd70p800480_pdata);
printk("%s:%s:da8xx_register_lcdc, ==========ret=%d\n", __FILE__, __func__, ret);
#endif
。。。。。。。。。。。。。。。。。。。。。。。
。。。。。。。。。。。。。。。。。。。。。。。
。。。。。。。。。。。。。。。。。。。。。。。
}