Skip to content

Commit

Permalink
w400: lcd: update specified panel support for basic board [1/2]
Browse files Browse the repository at this point in the history
PD#165090

Problem:
w400 use new panel

Solution:
add new panel support
remove useless panel

Verify:
g12b w400

Change-Id: Ia5d97a2d003bf4a0648360e265b141a468d846d6
Signed-off-by: Evoke Zhang <[email protected]>
  • Loading branch information
Evoke Zhang committed Jul 2, 2018
1 parent b9221ff commit d5c0a23
Show file tree
Hide file tree
Showing 2 changed files with 487 additions and 452 deletions.
176 changes: 48 additions & 128 deletions board/amlogic/g12b_w400_v1/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,6 @@ static struct lcd_power_step_s lcd_power_off_step[] = {
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};

static struct lcd_power_step_s lcd_power_on_step_TV070WSM[] = {
{LCD_POWER_TYPE_CPU, 1,0,200,}, /* lcd power */
#if 0
{LCD_POWER_TYPE_CPU, 0,1,10,}, /* lcd_reset */
{LCD_POWER_TYPE_CPU, 0,0,20,}, /* lcd_reset */
{LCD_POWER_TYPE_CPU, 0,1,20,}, /* lcd_reset */
#endif
{LCD_POWER_TYPE_SIGNAL,0,0,0,}, /* signal */
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};
static struct lcd_power_step_s lcd_power_off_step_TV070WSM[] = {
{LCD_POWER_TYPE_SIGNAL,0,0,0,}, /* signal */
{LCD_POWER_TYPE_CPU, 0,0,20,}, /* lcd_reset */
{LCD_POWER_TYPE_CPU, 1,1,100,}, /* power off */
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};

static struct lcd_power_step_s lcd_power_on_step_P070ACB[] = {
{LCD_POWER_TYPE_CPU, 1,0,200,}, /* lcd power */
{LCD_POWER_TYPE_SIGNAL,0,0,0,}, /* signal */
Expand All @@ -70,35 +53,6 @@ static struct lcd_power_step_s lcd_power_off_step_P070ACB[] = {
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};

static struct lcd_power_step_s lcd_power_on_step_TL050FHV02CT[] = {
{LCD_POWER_TYPE_CPU, 1,0,200,}, /* lcd power */
{LCD_POWER_TYPE_CPU, 0,1,20,}, /* lcd reset: 1 */
{LCD_POWER_TYPE_CPU, 0,0,10,}, /* lcd reset: 0 */
{LCD_POWER_TYPE_CPU, 0,1,20,}, /* lcd reset: 1 */
{LCD_POWER_TYPE_SIGNAL,0,0,0,}, /* signal */
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};
static struct lcd_power_step_s lcd_power_off_step_TL050FHV02CT[] = {
{LCD_POWER_TYPE_SIGNAL,0,0,0,}, /* signal */
{LCD_POWER_TYPE_CPU, 0,0,20,}, /* lcd_reset */
{LCD_POWER_TYPE_CPU, 1,1,100,}, /* power off */
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};

static struct lcd_power_step_s lcd_power_on_step_TL070WSH27[] = {
{LCD_POWER_TYPE_CPU, 1,0,100,}, /* lcd power */
{LCD_POWER_TYPE_CPU, 0,0,10,}, /* lcd reset: 0 */
{LCD_POWER_TYPE_CPU, 0,1,20,}, /* lcd reset: 1 */
{LCD_POWER_TYPE_SIGNAL,0,0,0,}, /* signal */
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};
static struct lcd_power_step_s lcd_power_off_step_TL070WSH27[] = {
{LCD_POWER_TYPE_SIGNAL,0,0,10,}, /* signal */
{LCD_POWER_TYPE_CPU, 0,0,10,}, /* lcd_reset */
{LCD_POWER_TYPE_CPU, 1,1,100,}, /* power off */
{LCD_POWER_TYPE_MAX, 0,0,0,}, /* ending flag */
};

static char lcd_bl_gpio[BL_GPIO_NUM_MAX][LCD_CPU_GPIO_NAME_MAX] = {
"GPIOH_4", /* BL_EN */
"GPIOH_5", /* BL_PWM */
Expand All @@ -124,16 +78,16 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
Rsv_val,Rsv_val,Rsv_val,Rsv_val,
10,10,Rsv_val},

{/* TV070WSM*/
{/* TL070WSH27*/
"lcd_1",LCD_MIPI,8,
/* basic timing */
600,1024,700,1053,24,36,0,2,8,0,
1024,600,1250,630,80,100,0,5,20,0,
/* clk_attr */
0,0,1,44250000,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
0,0,1,47250000,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
/* mipi_attr */
4,360,0,1,0,2,0,0,Rsv_val,1,
4,300,0,1,0,2,1,0,Rsv_val,Rsv_val,
/* power step */
lcd_power_on_step_TV070WSM, lcd_power_off_step_TV070WSM,
lcd_power_on_step, lcd_power_off_step,
/* backlight */
100,255,10,128,128,
BL_CTRL_PWM,0,1,0,200,200,
Expand All @@ -142,16 +96,16 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
Rsv_val,Rsv_val,Rsv_val,Rsv_val,
10,10,Rsv_val},

{/* P070ACB*/
{/* TL070HDV03CT*/
"lcd_2",LCD_MIPI,8,
/* basic timing */
600,1024,680,1194,24,36,0,10,80,0,
720,1280,970,1364,10,120,0,4,40,0,
/* clk_attr */
0,0,1,48715200,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
0,0,1,79385000,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
/* mipi_attr */
4,400,0,1,0,2,0,0,Rsv_val,2,
4,500,0,1,0,2,1,0,Rsv_val,2,
/* power step */
lcd_power_on_step_P070ACB, lcd_power_off_step_P070ACB,
lcd_power_on_step, lcd_power_off_step,
/* backlight */
100,255,10,128,128,
BL_CTRL_PWM,0,1,0,200,200,
Expand All @@ -160,34 +114,16 @@ struct ext_lcd_config_s ext_lcd_config[LCD_NUM_MAX] = {
Rsv_val,Rsv_val,Rsv_val,Rsv_val,
10,10,Rsv_val},

{/* TL050FHV02CT*/
{/* P070ACB_FT*/
"lcd_3",LCD_MIPI,8,
/* basic timing */
1080,1920,1125,2100,5,30,0,44,108,0,
/* clk_attr */
0,0,1,118125000,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
/* mipi_attr */
4,960,0,1,0,2,1,0,Rsv_val,3,
/* power step */
lcd_power_on_step_TL050FHV02CT, lcd_power_off_step_TL050FHV02CT,
/* backlight */
100,255,10,128,128,
BL_CTRL_PWM,0,1,0,200,200,
BL_PWM_NEGATIVE,BL_PWM_F,180,100,25,1,1,
Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
Rsv_val,Rsv_val,Rsv_val,Rsv_val,
10,10,Rsv_val},

{/* TL070WSH27*/
"lcd_4",LCD_MIPI,8,
/* basic timing */
1024,600,1250,630,80,100,0,5,20,0,
600,1024,680,1194,24,36,0,10,80,0,
/* clk_attr */
0,0,1,47250000,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
0,0,1,48715200,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,Rsv_val,
/* mipi_attr */
4,300,0,1,0,2,1,0,Rsv_val,Rsv_val,
4,400,0,1,0,2,0,0,Rsv_val,3,
/* power step */
lcd_power_on_step_TL070WSH27, lcd_power_off_step_TL070WSH27,
lcd_power_on_step_P070ACB, lcd_power_off_step_P070ACB,
/* backlight */
100,255,10,128,128,
BL_CTRL_PWM,0,1,0,200,200,
Expand Down Expand Up @@ -236,15 +172,25 @@ static unsigned char mipi_init_off_table[DSI_INIT_OFF_MAX] = {//table size < 50
0xff,0xff, //ending flag
};

static unsigned char mipi_init_on_table_TV070WSM[DSI_INIT_ON_MAX] = {//table size < 100
static unsigned char mipi_init_on_table_TL070WSH27[DSI_INIT_ON_MAX] = {//table size < 100
0x05, 1, 0x11,
0xff, 200,
0x05, 1, 0x29,
0xff, 20,
0xff, 0xff, //ending flag
};
static unsigned char mipi_init_off_table_TL070WSH27[DSI_INIT_OFF_MAX] = {//table size < 50
0x05, 1, 0x28,
0xff, 10,
0xf0, 3, 0, 1, 30, /* reset high, delay 30ms */
0xf0, 3, 0, 0, 10, /* reset low, delay 10ms */
0xf0, 3, 0, 1, 30, /* reset high, delay 30ms */
0xfc, 2, 0x04, 3, /* check_reg, check_cnt */
0x05, 1, 0x10,
0xff, 10,
0xff,0xff, //ending flag
};

static unsigned char mipi_init_on_table_TL070HDV03CT[DSI_INIT_ON_MAX] = {//table size < 100
0xff, 0xff, //ending flag
};
static unsigned char mipi_init_off_table_TV070WSM[DSI_INIT_OFF_MAX] = {//table size < 50
static unsigned char mipi_init_off_table_TL070HDV03CT[DSI_INIT_OFF_MAX] = {//table size < 50
0xff,0xff, //ending flag
};

Expand All @@ -260,28 +206,6 @@ static unsigned char mipi_init_off_table_P070ACB[DSI_INIT_OFF_MAX] = {//table si
0xff,0xff, //ending flag
};

static unsigned char mipi_init_on_table_TL050FHV02CT[DSI_INIT_ON_MAX] = {//table size < 100
0xff,0xff, //ending flag
};
static unsigned char mipi_init_off_table_TL050FHV02CT[DSI_INIT_OFF_MAX] = {//table size < 50
0xff,0xff, //ending flag
};

static unsigned char mipi_init_on_table_TL070WSH27[DSI_INIT_ON_MAX] = {//table size < 100
0x05, 1, 0x11,
0xff, 100,
0x05, 1, 0x29,
0xff, 20,
0xff, 0xff, //ending flag
};
static unsigned char mipi_init_off_table_TL070WSH27[DSI_INIT_OFF_MAX] = {//table size < 50
0x05, 1, 0x28,
0xff, 100,
0x05, 1, 0x10,
0xff, 10,
0xff, 0xff, //ending flag
};

static struct dsi_config_s lcd_mipi_config = {
.lane_num = 4,
.bit_rate_max = 550, /* MHz */
Expand Down Expand Up @@ -424,32 +348,32 @@ struct lcd_extern_config_s ext_config_dtf[LCD_EXTERN_NUM_MAX] = {
.table_init_on = ext_init_on_table,
.table_init_off = ext_init_off_table,
},
{ /* TV070WSM */
{ /* TL070WSH27 */
.index = 1,
.name = "mipi_default",
.type = LCD_EXTERN_MIPI, /* LCD_EXTERN_I2C, LCD_EXTERN_SPI, LCD_EXTERN_MIPI, LCD_EXTERN_MAX */
.status = 1, /* 0=disable, 1=enable */
.cmd_size = LCD_EXTERN_CMD_SIZE_DYNAMIC,
.table_init_on = ext_init_on_table_TV070WSM,
.table_init_off = ext_init_off_table_TV070WSM,
.table_init_on = ext_init_on_table_TL070WSH27,
.table_init_off = ext_init_off_table_TL070WSH27,
},
{ /* P070ACB */
{ /* TL070HDV03CT */
.index = 2,
.name = "mipi_default",
.type = LCD_EXTERN_MIPI, /* LCD_EXTERN_I2C, LCD_EXTERN_SPI, LCD_EXTERN_MIPI, LCD_EXTERN_MAX */
.status = 1, /* 0=disable, 1=enable */
.cmd_size = LCD_EXTERN_CMD_SIZE_DYNAMIC,
.table_init_on = ext_init_on_table_P070ACB,
.table_init_off = ext_init_off_table_P070ACB,
.table_init_on = ext_init_on_table_TL070HDV03CT,
.table_init_off = ext_init_off_table_TL070HDV03CT,
},
{ /* TL050FHV02CT */
{ /* P070ACB_FT */
.index = 3,
.name = "mipi_default",
.type = LCD_EXTERN_MIPI, /* LCD_EXTERN_I2C, LCD_EXTERN_SPI, LCD_EXTERN_MIPI, LCD_EXTERN_MAX */
.status = 1, /* 0=disable, 1=enable */
.cmd_size = LCD_EXTERN_CMD_SIZE_DYNAMIC,
.table_init_on = ext_init_on_table_TL050FHV02CT,
.table_init_off = ext_init_off_table_TL050FHV02CT,
.table_init_on = ext_init_on_table_P070ACB_FT,
.table_init_off = ext_init_off_table_P070ACB_FT,
},
{
.index = LCD_EXTERN_INDEX_INVALID,
Expand Down Expand Up @@ -514,22 +438,18 @@ void lcd_config_bsp_init(void)
ext_lcd = &ext_lcd_config[i];
if (strcmp(ext_lcd->panel_type, str) == 0) {
switch (i) {
case 1:/* TV070WSM*/
lcd_mipi_config.dsi_init_on = mipi_init_on_table_TV070WSM;
lcd_mipi_config.dsi_init_off = mipi_init_off_table_TV070WSM;
case 1: /* TL070WSH27 */
lcd_mipi_config.dsi_init_on = mipi_init_on_table_TL070WSH27;
lcd_mipi_config.dsi_init_off = mipi_init_off_table_TL070WSH27;
break;
case 2: /* TL070HDV03CT */
lcd_mipi_config.dsi_init_on = mipi_init_on_table_TL070HDV03CT;
lcd_mipi_config.dsi_init_off = mipi_init_off_table_TL070HDV03CT;
break;
case 2:/* P070ACB*/
case 3:/* P070ACB_FT*/
lcd_mipi_config.dsi_init_on = mipi_init_on_table_P070ACB;
lcd_mipi_config.dsi_init_off = mipi_init_off_table_P070ACB;
break;
case 3:
lcd_mipi_config.dsi_init_on = mipi_init_on_table_TL050FHV02CT;
lcd_mipi_config.dsi_init_off = mipi_init_off_table_TL050FHV02CT;
break;
case 4:
lcd_mipi_config.dsi_init_on = mipi_init_on_table_TL070WSH27;
lcd_mipi_config.dsi_init_off = mipi_init_off_table_TL070WSH27;
break;
case 0:
default:
lcd_mipi_config.dsi_init_on = mipi_init_on_table;
Expand Down
Loading

0 comments on commit d5c0a23

Please sign in to comment.