char buf[2] = {0x00, 0xA5};
ret = ct36x_update_write(ts, 0x7F, buf, 2);
- mdelay(10);
+ mdelay(5);
return ret;
}
char buf = 0x00;
ret =ct36x_update_write(ts, 0x7F, &buf, 1);
- mdelay(10);
+ mdelay(5);
return ret;
}
ret = ct36x_write(ts, buf, 3);
if(ret < 0)
return ret;
- mdelay(20);
+ mdelay(5);
buf[0] = 0x00;
buf[1] = 0xE1;
ret = ct36x_write(ts, buf, 2);
if(ret < 0)
return ret;
- mdelay(500);
+ mdelay(330);
buf[0] = 0xFF;
buf[1] = 0x8E;
ret = ct36x_write(ts, buf, 3);
if(ret < 0)
return ret;
- mdelay(20);
+ mdelay(5);
ret = ct36x_chip_rst_offset(ts);
if(ret < 0){
if(ret < 0)
return ret;
- mdelay(20);
+ mdelay(5);
fwchksum = ((buf[0]<<8) | buf[1]);
return fwchksum;
ret = ct36x_write(ts, buf, 3);
if(ret < 0)
return ret;
- mdelay(10);
+ mdelay(5);
buf[0] = 0x00;
ret = ct36x_write(ts, buf, 1);
if(ret < 0)
return ret;
- mdelay(10);
+ mdelay(5);
// do read version
ret = ct36x_read(ts, &ver, 1);
if(ret < 0)
return ret;
- mdelay(10);
+ mdelay(5);
return ver;
}
static void ct363_reset_hw(struct ct36x_data *ts)
{
- gpio_direction_output(ts->rst_io.gpio, ts->rst_io.active_low);
- msleep(50);
+ //gpio_direction_output(ts->rst_io.gpio, ts->rst_io.active_low);
+ //msleep(50);
gpio_set_value(ts->rst_io.gpio, !ts->rst_io.active_low);
- msleep(50);
+ msleep(10);
gpio_set_value(ts->rst_io.gpio, ts->rst_io.active_low);
- msleep(500);
+ msleep(230);
}
static int ct363_init(struct ct36x_data *ts)
/* Hardware reset */
ct363_reset_hw(ts);
// Get binary Checksum
+
+ #if 1
binchksum = ct36x_chip_get_binchksum();
ct36x_dbg(ts, "CT363 init: binchksum = %d\n", binchksum);
}
/* Hardware reset */
- ct363_reset_hw(ts);
+ //ct363_reset_hw(ts);
+ gpio_set_value(ts->rst_io.gpio, !ts->rst_io.active_low);
+ msleep(10);
+ gpio_set_value(ts->rst_io.gpio, ts->rst_io.active_low);
msleep(5);
-
+ #endif
ts->point_num = CT363_POINT_NUM;
ct363 = kzalloc(sizeof(struct ct363_priv), GFP_KERNEL);
ts->irq_io.gpio = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)&irq_flags);
ts->rst_io.gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
- printk("the irq_flags is %ld,rst_flags is %d\n",irq_flags,rst_flags);
+ //printk("the irq_flags is %ld,rst_flags is %d\n",irq_flags,rst_flags);
ret = of_property_read_u32_array(np, "orientation",orientation,4);
if (ret < 0)
if (gpio_is_valid(ts->rst_io.gpio)) {
ts->rst_io.active_low = (rst_flags & OF_GPIO_ACTIVE_LOW) ? 0 : 1;
- printk("the ts->rst_io.active_low is %d ========\n",ts->rst_io.active_low);
+ //printk("the ts->rst_io.active_low is %d ========\n",ts->rst_io.active_low);
ret = devm_gpio_request_one(&client->dev, ts->rst_io.gpio, (rst_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, "ct363 reset pin");
if (ret != 0) {
dev_err(&client->dev, "ct363 gpio_request error\n");
return -EIO;
}
- msleep(100);
+ //msleep(100);
} else {
dev_info(&client->dev, "reset pin invalid\n");
}