{
int ret = -1;
- #if 1
- u8 config_info[] = {
- 0x06,0xA2,
- 0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,
- 0x10,0x12,0x00,0x00,0x10,0x00,0x20,0x00,
- 0x30,0x00,0x40,0x00,0x50,0x00,0x60,0x00,
- 0xE0,0x00,0xD0,0x00,0xC0,0x00,0xB0,0x00,
- 0xA0,0x00,0x90,0x00,0x80,0x00,0x70,0x00,
- 0x00,0x00,0x01,0x13,0x90,0x90,0x90,0x38,
- 0x38,0x38,0x0F,0x0E,0x0A,0x40 ,0x30,0x00,
- 0x3f,00,MAX_FINGER_NUM,0x00,0x14,0x00,0x1C,0x01,
- 0x01,0x3E,0x35,0x68,0x58,0x00,0x00,0x06,
- 0x19,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x14,0x10,0x51,0x02,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x20,0x40,0x60,0x90,0x08,0x40,
- 0x30,0x32,0x20,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x01
- };
- #endif
-
- #if 0
+#if 1
u8 config_info[] = {
0x06,0xA2,
0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,
0x30,0x00,0x40,0x00,0x50,0x00,0x60,0x00,
0xE0,0x00,0xD0,0x00,0xC0,0x00,0xB0,0x00,
0xA0,0x00,0x90,0x00,0x80,0x00,0x70,0x00,
- 0x00,0x00,0x11,0x13,0x80,0x80,0x80,0x12,
- 0x12,0x12,0x0F,0x0F,0x0A,0x50,0x3C,0x49,
- 0x03,0x00,0x05,0x00,0x14,0xFA,0x1B,0x00,
- 0x00,0x4D,0x3D,0x81,0x65,0x00,0x00,0x06,
+ 0xF0,0x00,0x13,0x13,0x90,0x90,0x90,0x27,
+ 0x27,0x27,0x0F,0x0E,0x0A,0x40,0x30,0x01,
+ 0x03,0x00,MAX_FINGER_NUM,0x00,0x14,0xFA,0x1B,0x00,
+ 0x00,0x66,0x5A,0x6A,0x5E,0x00,0x00,0x05,
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x14,0x10,0xAB,0x02,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,
- 0x00,0x3C,0x28,0x00,0x00,0x00,0x00,0x00,
+ 0x14,0x10,0xEF,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0x40,0x70,0x90,0x0F,0x40,
+ 0x30,0x3C,0x28,0x00,0x00,0x00,0x00,0x00,
0x00,0x01
+ };
+#endif
- };
- #endif
ret = i2c_write_bytes(ts->client, config_info, (sizeof(config_info)/sizeof(config_info[0])));
if (ret < 0)
return ret;
u8 retry = 0;
unsigned int count = 0;
unsigned int position = 0;
- int ret = -1;
int temp = 0;
int x = 0, y = 0 , pressure;
struct gt818_ts_data *ts = container_of(work, struct gt818_ts_data, work);
- ret = i2c_read_bytes(ts->client, touch_status, sizeof(touch_status)/sizeof(touch_status[0]));
+ i2c_pre_cmd(ts);
+ i2c_read_bytes(ts->client, touch_status, sizeof(touch_status)/sizeof(touch_status[0]));
+ i2c_end_cmd(ts);
- if(ret <= 0) {
- for(retry = 0; retry < 3; retry++)
- {
- ret = i2c_pre_cmd(ts);
- if(ret <= 0)
- continue;
- else
- break;
- }
- if(ret <= 0) {
- dev_err(&(ts->client->dev),"I2C transfer error. Number:%d\n ", ret);
- ts->bad_data = 1;
- ts->retry++;
- goto XFER_ERROR;
- }
- else{
- i2c_read_bytes(ts->client, touch_status, sizeof(touch_status)/sizeof(touch_status[0]));
- }
- }
//judge whether the data is ready
if((touch_status[2] & 0x30) != 0x20)
{
msleep(30);
ret = i2c_pre_cmd(ts);
- if(ret >0){
+ if(ret > 0){
printk(KERN_INFO"**gt818 resume**\n");
}
else{
printk(KERN_INFO"**gt818 resume fail**\n");
}
-
+ i2c_end_cmd(ts);
return ret;
default:
goto err_init_godix_ts;
}
goodix_read_version(ts);
-// i2c_end_cmd(ts);
+
+ i2c_end_cmd(ts);
INIT_WORK(&ts->work, goodix_ts_work_func); //init work_struct
ts->input_dev = input_allocate_device();
if (ts->input_dev == NULL) {
ts->early_suspend.resume = goodix_ts_late_resume;
register_early_suspend(&ts->early_suspend);
#endif
- dev_info(&client->dev,"Start %s in %s mode\n",
+ dev_info(&client->dev,"Start %s in %s mode\n",
ts->input_dev->name, ts->use_irq ? "interrupt" : "polling");
if (ts->use_irq)
return 0;
err_init_godix_ts:
-// i2c_end_cmd(ts);
+ i2c_end_cmd(ts);
if(ts->use_irq)
{
ts->use_irq = 0;