mtk lk disp dispair

platform.c

void platform_early_init(void)

{

g_fb_size = mt_disp_get_vram_size();

}

UINT32 mt_disp_get_vram_size(void)

{

return DISP_GetVRamSize();

}

UINT32 DISP_GetVRamSize(void)

{
mtk lk disp dispair

if (0 == vramSize)

{

disp_drv_init_context();

}

}

void platform_init(void)

{

#ifndef DISABLE_DISPLAY_IN_LK_FOR_82_BRINGUP

mt_disp_init((void *)g_fb_base);

#endif

}

mt_disp_drv.c

void mt_disp_init(void *lcdbase)

{

if(DISP_STATUS_OK != DISP_Change_LCM_Resolution(lcm_fake_width, lcm_fake_height))

DISP_CHECK_RET(DISP_Init((UINT32)lcdbase, (UINT32)lcdbase, FALSE));

}

disp_drv.c

static const DISP_DRIVER *disp_drv = NULL;

const LCM_DRIVER *lcm_drv = NULL;

static BOOL isLCMFound = FALSE;

static BOOL isLCMConnected = FALSE;

主要函数

DISP_STATUS DISP_Init(UINT32 fbVA, UINT32 fbPA, BOOL isLcmInited)

{

if (!disp_drv_init_context()){

return DISP_STATUS_NOT_IMPLEMENTED;

}

r = (disp_drv->init) ?

(disp_drv->init(fbVA, fbPA, isLcmInited)) :

}

static BOOL disp_drv_init_context(void)

{

if(!isLCMFound)

DISP_DetectDevice();

}

BOOL DISP_DetectDevice(void)

{

lcm_drv = disp_drv_get_lcm_driver(NULL);

disp_dump_lcm_parameters(lcm_params);

}

mt65xx_lcm_list.c

unsigned int lcm_count = sizeof(lcm_driver_list)/sizeof(LCM_DRIVER*);

extern unsigned int lcm_count;

const LCM_DRIVER *disp_drv_get_lcm_driver(const char *lcm_name)

{

printk("[LCM Auto Detect], we have %d lcm drivers built inn", lcm_count);

printk("[LCM Auto Detect], try to find driver for [%s]n",

if(lcm_count ==1)

{

lcm = lcm_driver_list[0];

lcm->set_util_funcs(&lcm_utils);

lcm->get_params(&s_lcm_params);

u4IndexOfLCMList = 0;

lcm_params = &s_lcm_params;

lcm_drv = lcm;

isLCMFound = TRUE;

goto done;

}

done:

if(LCM_TYPE_DSI == lcm_params->type)

{

init_dsi(FALSE);

MASKREG32(DSI_BASE + 0x10, 0x2, 0x2);

data_array[0] = 0x00043700;

DSI_set_cmdq(data_array, 1, 1);

ret = DSI_dcs_read_lcm_reg_v2(0x2A, &buffer,4);

if(ret == 0)

{

isLCMConnected = 0;

printk("lcm is not connectedn");

}

else

{

isLCMConnected = 1;

printk("lcm is connected,return size = %dn",ret);

}

DSI_Deinit();

}

return lcm_drv;

}

DSI_dcs_read_lcm_reg_v2(0x0A, &buffer,1);

此语句是读取Display Power Mode

1.dsi

disp_drv_dsi.c

void init_dsi(BOOL isDsiPoweredOn)

{

//initialize DSI_PHY

DSI_PHY_clk_setting(lcm_params);

DSI_CHECK_RET(DSI_Init(isDsiPoweredOn));

}

UINT32 DSI_dcs_read_lcm_reg_v2(UINT8 cmd, UINT8 *buffer, UINT8 buffer_size)

{

do

{

t0.CONFG = 0x04; ///BTA

t0.Data0 = cmd;

if (buffer_size < 0x3)

t0.Data_ID = DSI_DCS_READ_PACKET_ID;

else

t0.Data_ID = DSI_GERNERIC_READ_LONG_PACKET_ID;

t0.Data1 = 0;

while(DSI_REG->DSI_INTSTA.RD_RDY == 0) ///read clear

{

///keep polling

msleep(1);

read_timeout_ms --;

if(read_timeout_ms == 0)

{

DISP_LOG_PRINT(ANDROID_LOG_INFO, "DSI", " Polling DSI read ready timeout!!!n");

DSI_DumpRegisters();

///do necessary reset here

DSI_Reset();

return 0;

}

}

}

  

爱华网本文地址 » http://www.413yy.cn/a/25101011/59334.html

更多阅读

转载 5寸CMMB手机评测——CSAP88 cmmb官网

这是我见过的最好的一部CMMB终端,向这个厂家致敬了!愿意开发软件做好软件的好商人......原文地址:5寸CMMB手机评测——CSAP88作者:睛彩不是qing彩随着三星NOTE的流行,大屏智能手机也逐渐被用户所接受,基于MTK大屏方案的兴起,国产手机也越来

mtk手机线刷详细教程(含工具) mtk的线刷工具

mtk手机线刷详细教程(含工具)——简介备份后再刷,备份自行百度mtk手机线刷详细教程(含工具)——工具/原料sp-flash tool:网盘下载 http://dl.vmall.com/c0mnx6vza2(自己下一个版本)驱动 网盘下载 http://dl.vmall.com/c095meleab(

国产,国外,杂牌手机指令代码 国产杂牌机刷机

==================MT芯片的机子的指令==================杂牌机解锁万能码:*746*737381#解锁输入 *#3646633# 速度要快,慢了就不行了.M有的机器能用,有的不行。先试下不行再用别的方法了。mTK万能密码: *#3698741# 选出厂设置,OKMTK

声明:《mtk lk disp dispair》为网友女汉子坚强分享!如侵犯到您的合法权益请联系我们删除