static unsigned int test_compare_id(void)
{
	unsigned int id=0;
	unsigned int id1=0;
	unsigned char buffer[2];
	unsigned int array[16];  

	array[0]=0x00043902;
	array[1]=0x8983FFB9;// page enable
	dsi_set_cmdq(&array, 2, 1);
	MDELAY(10);

	array[0] = 0x00023700;// return byte number
	dsi_set_cmdq(&array, 1, 1);
	MDELAY(10);

	read_reg_v2(0xF4, buffer, 2);
	id = buffer[0]; 
        id1 = buffer[0]<<8 |buffer[1]; 

	LCM_DBG("[WUHAI] -- hx8389b 0x%x , 0x%x , 0x%x , 0x%x \n",buffer[0],buffer[1],id,id1);
	
	if(LCM_ID_HX8389B == id){
			//#if defined(BUILD_UBOOT) || defined(BUILD_LK)
				if(lcm_adc_read_chip_id())
					return 1;
				else
					return  0;//Default LCM
			//#endif
			return 1;
		}
	return 0	;

}
Ejemplo n.º 2
0
static unsigned int lcm_compare_id(void)
{

	int   array[4];
	char  buffer[3];
	char  id0=0;
	char  id1=0;
	char  id2=0;


	lcm_reset();//must be ahead of this function.
		
#if defined BUILD_UBOOT
	if(lcm_adc_read_chip_id())
		return 1;
#endif
		
	array[0] = 0x00033700;// read id return two byte,version and id
	dsi_set_cmdq(array, 1, 1);

	read_reg_v2(0xDA,buffer, 1);

	
	array[0] = 0x00033700;// read id return two byte,version and id
	dsi_set_cmdq(array, 1, 1);
	read_reg_v2(0xDB,buffer+1, 1);

	
	array[0] = 0x00033700;// read id return two byte,version and id
	dsi_set_cmdq(array, 1, 1);
	read_reg_v2(0xDC,buffer+2, 1);
	
	id0 = buffer[0]; //should be 0x00
	id1 = buffer[1];//should be 0xaa
	id2 = buffer[2];//should be 0x55
#ifdef BUILD_UBOOT
	printf("%s, id0 = 0x%08x\n", __func__, id0);//should be 0x00
	printf("%s, id1 = 0x%08x\n", __func__, id1);//should be 0xaa
	printf("%s, id2 = 0x%08x\n", __func__, id2);//should be 0x55
#endif
	
	return 1;
}