static s32 disp_lcd_speed_limit(disp_panel_para *panel, u32 *min_dclk, u32 *max_dclk) { #if defined(CONFIG_MACH_SUN50IW10) unsigned long markid = 0; unsigned int qa_val = 0; unsigned int ic_ver = 0; unsigned int display_cfg_flag = 0; /*init unlimit*/ *min_dclk = 0; *max_dclk = 9999; qa_val = readl(0x0300621c); qa_val = (qa_val >> 28) & 0x00000003; ic_ver = readl(0x03000024) & 0x00000007; markid = readl(0x03006200) & 0x0000ffff; display_cfg_flag = (readl(0x03006218) >> 12) & 0x00000001; /*B810 and bad ic not support DSI*/ if ((qa_val >= 2 && panel->lcd_if == LCD_IF_DSI) || (markid == 0x4000)) { /*bad IC not support DSI*/ *min_dclk = 9999; *max_dclk = 0; goto OUT; } switch (markid) { case 0x3c00: /*A530*/ { /*ic version e*/ if ((ic_ver >= 4) && (!display_cfg_flag) && (panel->lcd_if != LCD_IF_DSI)) { /*only support DSI*/ *min_dclk = 9999; *max_dclk = 0; goto OUT; } if ((ic_ver == 0) && (panel->lcd_if == LCD_IF_DSI)) { /*not support DSI*/ *min_dclk = 9999; *max_dclk = 0; goto OUT; } if (panel->lcd_if == LCD_IF_DSI) { if (qa_val == 0) *min_dclk = 40; /*1024*600@60*/ /* normal qa and B/C ic */ if (qa_val == 1 && ic_ver == 0) { *min_dclk = 64; /*1280*720@60*/ } } else { /*LVDS or RGB*/ *min_dclk = 40; /*1024*600@60*/ } *max_dclk = 85; /*1280*720@60*/ } break; case 0x0400: /*A100*/ { if (panel->lcd_if == LCD_IF_DSI) { if (qa_val == 0) *min_dclk = 40; /*1024*600@60*/ /* normal qa and B/C ic */ if (qa_val == 1 && ic_ver == 0) { *min_dclk = 64; /*1280*720@60*/ } } else { /*LVDS or RGB*/ *min_dclk = 40; /*1024*600@60*/ } *max_dclk = 85; /*1280*720@60*/ } break; case 0x1400: /*A133*/ { if (panel->lcd_if == LCD_IF_DSI) { if ((qa_val == 0 && ic_ver == 0) || (qa_val == 1 && ic_ver == 3)) { /*D 01 or B/C 00*/ *min_dclk = 40; } else if (qa_val == 1 && ic_ver == 0) { /*B/C 01*/ *min_dclk = 64; /*1280*720@60*/ } } *max_dclk = 200; /*1920*1200@60*/ } break; case 0x1000: /*R818/MR813*/ case 0x2000: { /*not bad ic*/ *max_dclk = 200; /*1920*1200@60*/ } break; case 0x0800: { /*T509*/ if (panel->lcd_if == LCD_IF_DSI) { if (qa_val == 0 && ic_ver == 0) *min_dclk = 40;/*1024*600@60*/ else *min_dclk = 0; } *max_dclk = 200; /*1920*1200@60*/ } break; default: break; } OUT: tick_printf( "soc ic_ver:0x%x, qa_val:0x%x, markid:0x%x dclk[%u-%u] display_cfg_flag:%d\n", ic_ver, qa_val, markid, *min_dclk, *max_dclk, display_cfg_flag); #endif /*unlimit */ return 0; }