static void LCD_panel_init(u32 sel) { __u32 i; char model_name[25]; disp_sys_script_get_item("lcd0","lcd_model_name", (int*)model_name, 25); sunxi_lcd_dsi_clk_enable(sel); sunxi_lcd_delay_ms(20); sunxi_lcd_dsi_dcs_write_0para(sel,DSI_DCS_SOFT_RESET); sunxi_lcd_delay_ms(10); for(i=0;;i++) { if(LCM_LT080B21BA94_setting[i].count == REGFLAG_END_OF_TABLE) break; else if (LCM_LT080B21BA94_setting[i].count == REGFLAG_DELAY) sunxi_lcd_delay_ms(LCM_LT080B21BA94_setting[i].para_list[0]); else dsi_dcs_wr(sel,LCM_LT080B21BA94_setting[i].cmd,LCM_LT080B21BA94_setting[i].para_list,LCM_LT080B21BA94_setting[i].count); //break; } return; }
static void LCD_panel_init(__u32 sel) { __u32 i; __u32 rx_num ; __u8 rx_bf0,rx_bf1,rx_bf2; __u32 hx8394d_used=0; sunxi_lcd_pin_cfg(sel, 1); sunxi_lcd_delay_ms(10); panel_rst(1); //add by lyp@20140423 sunxi_lcd_delay_ms(50);//add by lyp@20140423 panel_rst(0); sunxi_lcd_delay_ms(20); panel_rst(1); sunxi_lcd_delay_ms(200); for(i=0;;i++) { if(hx8394d_test_config_para[i].cmd == 0x02) break; else if (hx8394d_test_config_para[i].cmd == 0x01) sunxi_lcd_delay_ms(hx8394d_test_config_para[i].count); else dsi_dcs_wr(0,hx8394d_test_config_para[i].cmd,hx8394d_test_config_para[i].para_list,hx8394d_test_config_para[i].count); } dsi_dcs_rd(0,0xDA,&rx_bf0,&rx_num); dsi_dcs_rd(0,0xDB,&rx_bf1,&rx_num); dsi_dcs_rd(0,0xDC,&rx_bf2,&rx_num); if((rx_bf0 == 0x83) && (rx_bf1 == 0x94) && (rx_bf2 == 0xd) ){ hx8394d_used = 1; if(hx8394d_used) for(i=0;;i++) { if(hx8394d_initialization_setting[i].cmd == 0x02) break; else if (hx8394d_initialization_setting[i].cmd == 0x01) sunxi_lcd_delay_ms(hx8394d_initialization_setting[i].count); else dsi_dcs_wr(0,hx8394d_initialization_setting[i].cmd,hx8394d_initialization_setting[i].para_list,hx8394d_initialization_setting[i].count); } } else {//used otm1283 for(i=0;;i++) { if(otm1283_initialization_setting[i].cmd == 0x02) break; else if (otm1283_initialization_setting[i].cmd == 0x01) sunxi_lcd_delay_ms(otm1283_initialization_setting[i].count); else dsi_dcs_wr(0,otm1283_initialization_setting[i].cmd,otm1283_initialization_setting[i].para_list,otm1283_initialization_setting[i].count); } } //sunxi_lcd_dsi_write(sel,DSI_DCS_EXIT_SLEEP_MODE, 0, 0); //sunxi_lcd_delay_ms(200); sunxi_lcd_dsi_clk_enable(sel); //sunxi_lcd_dsi_write(sel,DSI_DCS_SET_DISPLAY_ON, 0, 0); //sunxi_lcd_delay_ms(200); return; }