}
gpio_direction_output(TOUCH_RESET_PIN, 0);
- gpio_direction_output(TOUCH_INT_PIN, 0);
- gpio_set_value(TOUCH_INT_PIN,GPIO_HIGH);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ mdelay(10);
+ gpio_direction_input(TOUCH_INT_PIN);
+ mdelay(10);
gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
- gpio_pull_updown(TOUCH_INT_PIN, 0);
+ msleep(300);
return 0;
}
}
gpio_direction_output(TOUCH_RESET_PIN, 0);
gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
- msleep(100);
- gpio_direction_output(TOUCH_INT_PIN, 0);
- gpio_set_value(TOUCH_INT_PIN,GPIO_LOW);
mdelay(10);
- msleep(50);
+ gpio_direction_input(TOUCH_INT_PIN);
+ mdelay(10);
gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
- msleep(100);
- gpio_direction_output(TOUCH_INT_PIN, 1);
- gpio_pull_updown(TOUCH_INT_PIN, 0);
+ msleep(300);
return 0;
}
E_UPGRADE_ERR_TYPE fts_ctpm_fw_upgrade(u8* pbt_buf, int dw_lenth)
{
u8 cmd,reg_val[2] = {0};
+ u8 buffer[2] = {0};
u8 packet_buf[FTS_PACKET_LENGTH + 6];
u8 auc_i2c_write_buf[10];
u8 bt_ecc;
/*******Step 7: reset the new FW**********/
cmd_write(0x07,0x00,0x00,0x00,1);
-
+ mdelay(100);//100ms
+ fts_register_read(0xfc, buffer, 1);
+ if (buffer[0] == 1)
+ {
+ cmd=4;
+ fts_register_write(0xfc, &cmd);
+ mdelay(2500);//2500ms
+ do
+ {
+ fts_register_read(0xfc, buffer, 1);
+ mdelay(100);//100ms
+ }while (buffer[0] != 1);
+ }
return ERR_OK;
}
if(ret>0)
return ret;
ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
+ if(ret>0)
+ return ret;
+ ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
+ if(ret>0)
+ return ret;
+ ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
+ if(ret>0)
+ return ret;
+ ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
return ret;
}
if(ret>0)
return ret;
ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
+ if(ret>0)
+ return ret;
+ ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
+ if(ret>0)
+ return ret;
+ ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
+ if(ret>0)
+ return ret;
+ ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
return ret;
}
struct goodix_ts_data *ts = container_of(work, struct goodix_ts_data, work);
uint8_t point_data[53]={ 0 };
int ret,i,offset,points;
+ int points_chect;
int x,y,w;
+ unsigned int count = 0;
+ uint8_t check_sum = 0;
- ret = gt819_read_regs(ts->client,1, point_data, 1);
+ ret = gt819_read_regs(ts->client,1, point_data, 2);
if (ret < 0) {
dev_err(&ts->client->dev, "i2c_read_bytes fail:%d!\n",ret);
enable_irq(ts->irq);
return;
}
+ check_sum =point_data[0]+point_data[1];
points = point_data[0] & 0x1f;
//dev_info(&ts->client->dev, "points = %d\n",points);
for(i=0;0!=points;i++)
points>>=1;
points = i;
- ret = gt819_read_regs(ts->client,3, point_data, points*5);
+ points_chect = points;
+ ret = gt819_read_regs(ts->client,3, point_data, points*5+1);
if (ret < 0) {
dev_err(&ts->client->dev, "i2c_read_bytes fail:%d!\n",ret);
enable_irq(ts->irq);
return;
}
+ //add by Nitiion
+ for(points_chect *= 5; points_chect > 0; points_chect--)
+ {
+ check_sum += point_data[count++];
+ }
+ check_sum += point_data[count];
+ if(check_sum != 0) //checksum verify error
+ {
+ printk("coor checksum error!\n");
+ enable_irq(ts->irq);
+ return;
+ }
+
for(i=0;i<points;i++){
offset = i*5;
x = (((s16)(point_data[offset+0]))<<8) | ((s16)point_data[offset+1]);