static int s6e63m0_set_acl(struct s6e63m0_dsi_lcd *lcd) { int ret = 0; if (lcd->acl_enable) { dev_dbg(lcd->dev,"current lcd-> bl [%d]\n",lcd->bl); switch (lcd->bl) { case 0 ... 2: /* 30cd ~ 60cd */ if (lcd->cur_acl != 0) { panel_write(SEQ_ACL_NULL_DSI); dev_dbg(lcd->dev, "ACL_cutoff_set Percentage : off!!\n"); lcd->cur_acl = 0; } break; case 3 ... 24: /* 70cd ~ 250 */ if (lcd->cur_acl != 40) { panel_write(SEQ_ACL_40P_DSI); dev_dbg(lcd->dev, "ACL_cutoff_set Percentage : 40!!\n"); lcd->cur_acl = 40; } break; default: if (lcd->cur_acl != 40) { panel_write(SEQ_ACL_40P_DSI); dev_dbg(lcd->dev, "ACL_cutoff_set Percentage : 40!!\n"); lcd->cur_acl = 40; } dev_dbg(lcd->dev, " cur_acl=%d\n", lcd->cur_acl); break; } } else {
void panel_read_id(void) { int nMaxReadByte = 16, dataSize = SEC_DSI_MTP_DATA_LEN; u8 *pPanelID = gPanelID; u8 *pMtpData = gMtpData; pr_info("%s\n", __func__); /* Read panel ID*/ panel_read(0xDA, pPanelID, 1); panel_read(0xDB, pPanelID+1, 1); panel_read(0xDC, pPanelID+2, 1); /* Read mtpdata*/ pr_info("%s: Write direct_access00_seq\n", __func__); panel_write(&direct_access00_seq[0]); panel_read(0xD3, pMtpData, nMaxReadByte); pr_info("%s: Write direct_access01_seq\n", __func__); panel_write(&direct_access10_seq[0]); panel_read(0xD3, pMtpData+nMaxReadByte, dataSize-nMaxReadByte); #if 0 { int n = 0; for(n = 0; n < dataSize ; n++) printk("[DISPDRV] mtpData[%d] = 0x%02X\n", n, pMtpData[n]); } #endif }
bool panel_console_evt(PANEL *p, int evt) { int k, b; char buf[1024]; bool (*cb)(PANEL*,char*); cb = (void*)p->attr[PANEL_MGR_STORE]; b = p->attr[PANEL_MGR_STORE+1]; if( evt == PANEL_FOCUS ) { panel_focus(p); panel_write(p,">>"); panel_focus(p); while(1) { k = panel_getline(p,buf,"\n~\x0D"); if( buf[k-1] == b ) break; buf[k-1] = 0; panel_write(p,buf); panel_write(p,"\n"); if( !cb(p,buf) ) break; panel_write(p,"\n\n>>"); panel_focus(p); panel_focus(p); } panel_write(p,"\n"); } return true; }
bool panel_grid(PANEL *p, char*(*item)(int,int), int* maxw, int w, int h, bool (*cb)(PANEL*,int,int)) { int i, j, width, topX, topY; char linesep[1024], buf[1024], *t; p->attr[PANEL_MGR_STORE] = (int)item; p->attr[PANEL_MGR_STORE+1] = (int)cb; p->attr[PANEL_MGR_STORE+2] = (int)maxw; panel_getcursorpos(p,&topX,&topY); p->attr[PANEL_MGR_STORE+3] = topX; p->attr[PANEL_MGR_STORE+4] = topY; p->attr[PANEL_MGR_STORE+5] = w; p->attr[PANEL_MGR_STORE+6] = h; width = 0; for(i=0; i<w; i++) width += maxw[i]; width += w+1; memset(linesep,'-',width); linesep[width] = 0; t = 0; for(i=0; i<h; i++) { panel_write(p,linesep); panel_write(p,"\n"); for(j=0; j<w; j++) { t = item(j,i); if( t != 0 ) { sprintf(buf,"|%-*.*s",maxw[j],maxw[j],t); panel_write(p,buf); } else { break; } } if( t==0 ) break; panel_write(p,"|\n"); } panel_setcursorpos(p,topX+1,topY+1); panel_writeattr(p,menu_highlight,maxw[0]); }
void panel_initialize(char *init_seq) { u8 *pPanelID = gPanelID; pr_info("%s\n", __func__); panel_write(init_seq); //panel_read_id(); }
bool panel_list(PANEL *p, char* (*items)(int), int def, bool (*cb)(PANEL*,int)) { int i, len, k, x, y, top, bottom; char* txt; bool emode; panel_write(p,"\n"); panel_getcursorpos(p,&x,&top); p->attr[PANEL_MGR_STORE] = top; p->attr[PANEL_MGR_STORE+2] = (int)cb; p->attr[PANEL_MGR_STORE+3] = (int)items; for(i=0; (txt=items(i))!=0; i++) { panel_write(p,txt); panel_write(p,"\n"); } p->attr[PANEL_MGR_STORE+1] = i; panel_setcursorpos(p,x,top+def); panel_writeattr(p,menu_highlight,20); panel_display(p); return true; }
static int s6e63m0_set_gamma(struct s6e63m0_dsi_lcd *lcd) { int ret = 0; dev_dbg(lcd->dev,"%s : bl=[%d]\n", __func__, lcd->bl); #if 1 { int j; printk("gamma_sequence : "); for (j = 0; j < GAMMA_PARAM_LEN ; j++) printk("[0x%02x], ", gamma_table_sm2[lcd->bl][j+3]); } #endif panel_write(gamma_table_sm2[lcd->bl]); panel_write(gamma_update_seq); return ret; }
void panel_initialize(char *init_seq) { int nMaxReadByte = 16, dataSize = 21; u8 *pPanelID = gPanelID; u8 *pMtpData = gMtpData; pr_info("%s\n", __func__); panel_write(init_seq); //panel_read_id(); }
void backlight_control(int brigtness) { set_bl_seq[2] = brigtness; panel_write(set_bl_seq); }