NT35510 esdcheck

mipi dsi cmd mode:

893 static unsigned int lcm_esd_check(void)
 894 {
 895     static int err_count = 0;
 896     unsigned char buffer_1[12];
 897     unsigned int array[16]={0};
 898     int i;
 899     unsigned char fResult;
 900         
 901         /* esd check for nt35510 begin*/
 902                 
 903         /* esd check for nt35510 end*/
 904
 905     array[0] = 0x00063700;//0AH only 1 para
 906         dsi_set_cmdq(array, 1, 1);
 907                  
 908     read_reg_v2(0x0A, buffer_1, 7);     
 909
 910         for(i=0;i<11;i++)
 911         {
 912                 buffer_1[i]=0;
 913         }
 914         
 915     if(err_report_buf[1] == 0x9C)               
 916     {
 917     
 918         if((err_report_buf[4] == 0x02))
 919         {
 920             err_count ++;
 921
 922                         array[0]=0x00063902;
 923                         array[1]=0x52AA55F0;
 924                         array[2]=0x00000108;
 925                         dsi_set_cmdq(array, 3, 1);
 926                 //MDELAY(10);   
 927                         array[0] = 0x000c3700;//0AH only 1 para
 928                         dsi_set_cmdq(array, 1, 1);
 929                  
 930                 read_reg_v2(0xD1, buffer_1, 12);
 931         }
 932         else
 933          {
 934             err_count = 0;
 935          }
 936      }
 937     else
 938       {
 939             err_count ++;
 940        }
 941 #ifdef BUILD_UBOOT
 942                         //printf("nt35510 check id = 0x%08x\n", buffer_1[i]);
 943 #else
 944                         printk("nt35510 check id err_count = %d\n", err_count);
 945 #endif
 946
 947 #if 1
 948       if(err_count >= 3)                       
 949        {
 950             err_count = 0;
 951             fResult = 1;
 952        }
 953       else
 954         {
 955              fResult = 0;
 956         }
 957
 958     if(fResult)
 959         {
 960                 return 1;
 961     }
 962     else
 963         {
 964                 return 0;
 965         }
 966         #endif
 967 }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值